Skip to content

Commit

Permalink
Show image pull progress in a separate Echelon node
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Sep 22, 2020
1 parent 45f73bd commit 9def86d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/executor/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ func RunDockerizedAgent(ctx context.Context, config *RunConfig, params *Params)
}

if config.DockerOptions.ShouldPullImage(params.Image) {
logger.Debugf("pulling image %s", params.Image)
dockerPullLogger := logger.Scoped("docker pull")
dockerPullLogger.Infof("Pulling image %s...", params.Image)
progress, err := cli.ImagePull(ctx, params.Image, types.ImagePullOptions{})
if err != nil {
dockerPullLogger.Errorf("Failed to pull %s: %v", params.Image, err)
dockerPullLogger.Finish(false)
return err
}
_, err = io.Copy(ioutil.Discard, progress)
dockerPullLogger.Finish(err == nil)
if err != nil {
return err
}
Expand Down

0 comments on commit 9def86d

Please sign in to comment.