summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
c1d1f05)
Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>
set -ex
cd "$WORKSPACE/services/api"
export RAILS_ENV=test
set -ex
cd "$WORKSPACE/services/api"
export RAILS_ENV=test
- if "$bundle" exec rails db:environment:set ; then
+ if bin/rails db:environment:set ; then
"$bundle" exec rake db:drop
fi
"$bundle" exec rake db:setup
"$bundle" exec rake db:drop
fi
"$bundle" exec rake db:setup
// "It should hold only portable information about the container."
// and for Singularity TBD
type ContainerConfig struct {
// "It should hold only portable information about the container."
// and for Singularity TBD
type ContainerConfig struct {
OpenStdin bool
StdinOnce bool
AttachStdin bool
OpenStdin bool
StdinOnce bool
AttachStdin bool
GetContainerConfig() (ContainerConfig, error)
GetHostConfig() (HostConfig, error)
GetContainerConfig() (ContainerConfig, error)
GetHostConfig() (HostConfig, error)
+ GetImage() (imageID string)
+ SetImage(imageID string)
+
ContainerAttach(ctx context.Context, container string, options ContainerAttachOptions) (HijackedResponse, error)
ContainerCreate(ctx context.Context, config ContainerConfig, hostConfig HostConfig, networkingConfig *NetworkingConfig, containerName string) (ContainerCreateResponse, error)
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) error
ContainerAttach(ctx context.Context, container string, options ContainerAttachOptions) (HijackedResponse, error)
ContainerCreate(ctx context.Context, config ContainerConfig, hostConfig HostConfig, networkingConfig *NetworkingConfig, containerName string) (ContainerCreateResponse, error)
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) error
ContainerExecRunner ThinContainerExecRunner
//Docker ThinDockerClient
ContainerExecRunner ThinContainerExecRunner
//Docker ThinDockerClient
- ContainerConfig dockercontainer.Config //FIXME: translate this to the ThinContainerRunner interface
- HostConfig dockercontainer.HostConfig //FIXME: translate this to the ThinContainerRunner interface
+ //ContainerConfig dockercontainer.Config //FIXME: translate this to the ThinContainerRunner interface
+ HostConfig dockercontainer.HostConfig //FIXME: translate this to the ThinContainerRunner interface
//--------------
// Dispatcher client is initialized with the Dispatcher token.
//--------------
// Dispatcher client is initialized with the Dispatcher token.
runner.CrunchLog.Print("Docker image is available")
}
runner.CrunchLog.Print("Docker image is available")
}
- runner.ContainerConfig.Image = imageID
+ runner.ContainerExecRunner.SetImage(imageID)
runner.ContainerKeepClient.ClearBlockCache()
runner.ContainerKeepClient.ClearBlockCache()
// (1) Test loading image from keep
c.Check(kc.Called, Equals, false)
// (1) Test loading image from keep
c.Check(kc.Called, Equals, false)
- c.Check(cr.ContainerConfig.Image, Equals, "")
+ c.Check(cr.ContainerExecRunner.GetImage(), Equals, "")
}()
c.Check(kc.Called, Equals, true)
}()
c.Check(kc.Called, Equals, true)
- c.Check(cr.ContainerConfig.Image, Equals, hwImageID)
+ c.Check(cr.ContainerExecRunner.GetImage(), Equals, hwImageID)
_, _, err = cr.ContainerExecRunner.ImageInspectWithRaw(nil, hwImageID)
c.Check(err, IsNil)
// (2) Test using image that's already loaded
kc.Called = false
_, _, err = cr.ContainerExecRunner.ImageInspectWithRaw(nil, hwImageID)
c.Check(err, IsNil)
// (2) Test using image that's already loaded
kc.Called = false
- cr.ContainerConfig.Image = ""
+ cr.ContainerExecRunner.SetImage("")
err = cr.LoadImage()
c.Check(err, IsNil)
c.Check(kc.Called, Equals, false)
err = cr.LoadImage()
c.Check(err, IsNil)
c.Check(kc.Called, Equals, false)
- c.Check(cr.ContainerConfig.Image, Equals, hwImageID)
+ c.Check(cr.ContainerExecRunner.GetImage(), Equals, hwImageID)
func (a *DockerAdapter) GetHostConfig() (HostConfig, error) {
return a.hostConfig, nil
}
func (a *DockerAdapter) GetHostConfig() (HostConfig, error) {
return a.hostConfig, nil
}
+func (a *DockerAdapter) GetImage() (imageID string) {
+ return a.containerConfig.Image
+}
+
+func (a *DockerAdapter) SetImage(imageID string) {
+ a.containerConfig.Image = imageID
+}
func adapter(docker ThinDockerClient) ThinContainerExecRunner {
return_object := &DockerAdapter{docker: docker}
func adapter(docker ThinDockerClient) ThinContainerExecRunner {
return_object := &DockerAdapter{docker: docker}
return c.hostConfig, nil
}
return c.hostConfig, nil
}
+func (c SingularityClient) GetImage() (imageID string) {
+ return c.containerConfig.Image
+}
+
+func (c SingularityClient) SetImage(imageID string) {
+ c.containerConfig.Image = imageID
+}
+
func (c SingularityClient) ContainerAttach(ctx context.Context, container string, options ContainerAttachOptions) (HijackedResponse, error) {
fmt.Printf("placeholder for container ContainerAttach %s", container)
func (c SingularityClient) ContainerAttach(ctx context.Context, container string, options ContainerAttachOptions) (HijackedResponse, error) {
fmt.Printf("placeholder for container ContainerAttach %s", container)