Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
DEBUG
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
  • Loading branch information
Sebastien Boeuf committed Apr 28, 2017
1 parent 336403a commit f20f54d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
19 changes: 14 additions & 5 deletions create.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,50 +76,59 @@ var createCommand = cli.Command{

func create(containerID, bundlePath, console, pidFilePath string,
runtimeConfig oci.RuntimeConfig) error {
ccLog.Error("##### CREATE 1 #####")
// Checks the MUST and MUST NOT from OCI runtime specification
if err := validCreateParams(containerID, bundlePath); err != nil {
return err
}

ccLog.Error("##### CREATE 2 #####")
podConfig, ociSpec, err := getConfigs(bundlePath, containerID, console, runtimeConfig)
if err != nil {
return err
}

ccLog.Error("##### CREATE 3 #####")
pod, err := vc.CreatePod(podConfig)
if err != nil {
return err
}

ccLog.Error("##### CREATE 4 #####")
// Start the shim to retrieve its PID.
containers := pod.GetContainers()
if len(containers) != 1 {
return fmt.Errorf("BUG: Container list from pod is wrong, expecting only one container, found %d containers", len(containers))
}

ccLog.Error("##### CREATE 5 #####")
process := containers[0].Process()

// config.json provides a cgroups path that has to be used to create "tasks"
// and "cgroups.procs" files. Those files have to be filled with a PID, which
// is shim's in our case. This is mandatory to make sure there is no one
// else (like Docker) trying to create those files on our behalf. We want to
// know those files location so that we can remove them when delete is called.
cgroupsPathList, err := processCgroupsPath(ociSpec)
_, err = processCgroupsPath(ociSpec)
if err != nil {
return err
}
ccLog.Error("##### CREATE 6 #####")
/*
if err := createCgroupsFiles(cgroupsPathList, process.Pid); err != nil {
return err
}
*/

if err := createCgroupsFiles(cgroupsPathList, process.Pid); err != nil {
return err
}

ccLog.Error("##### CREATE 7 #####")
// Creation of PID file has to be the last thing done in the create
// because containerd considers the create complete after this file
// is created.
if err := createPIDFile(pidFilePath, process.Pid); err != nil {
return err
}

ccLog.Errorf("##### CREATE 8: PID = %d #####", process.Pid)
return nil
}

Expand Down
3 changes: 3 additions & 0 deletions start.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ var startCommand = cli.Command{
}

func start(containerID string) error {
ccLog.Error("##### START 1 #####")
// Checks the MUST and MUST NOT from OCI runtime specification
if err := validContainer(containerID); err != nil {
return err
}

ccLog.Error("##### START 2 #####")
if _, err := vc.StartPod(containerID); err != nil {
return err
}

ccLog.Error("##### START 3 #####")
return nil
}
6 changes: 6 additions & 0 deletions vendor/github.com/containers/virtcontainers/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions vendor/github.com/containers/virtcontainers/cc_shim.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/containers/virtcontainers/pod.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f20f54d

Please sign in to comment.