+func (c *Container) runWithRetry(cmd string) error {
+ nTries := 5
+ for i := 0; i < nTries; i++ {
+ err := exechelper.Run(cmd)
+ if err == nil {
+ return nil
+ }
+ time.Sleep(1 * time.Second)
+ }
+ return fmt.Errorf("failed to run container command")
+}
+
+func (c *Container) create() error {
+ cmd := "docker create " + c.getContainerArguments()
+ c.suite.log(cmd)
+ return exechelper.Run(cmd)
+}
+
+func (c *Container) allocateCpus() {
+ c.suite.startedContainers = append(c.suite.startedContainers, c)
+ c.allocatedCpus = c.suite.AllocateCpus()
+ c.suite.log("Allocated CPUs " + fmt.Sprint(c.allocatedCpus) + " to container " + c.name)
+}
+
+func (c *Container) start() error {
+ cmd := "docker start " + c.name
+ c.suite.log(cmd)
+ return c.runWithRetry(cmd)
+}
+
+func (c *Container) prepareCommand() (string, error) {