Skip to content

Commit

Permalink
feat #246: envd up a GPU image without GPUs (#474)
Browse files Browse the repository at this point in the history
* feat #246

Signed-off-by: GitHub <noreply@github.com>

* code fmt

Signed-off-by: GitHub <noreply@github.com>

* nits

Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
kenwoodjw authored Jun 21, 2022
1 parent a23a7b5 commit 35c6b76
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/app/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ var CommandUp = &cli.Command{
Usage: "detach from the container",
Value: false,
},
&cli.BoolFlag{
Name: "no-gpu",
Usage: "launch the CPU container",
Value: false,
},
},

Action: up,
Expand Down Expand Up @@ -143,7 +148,13 @@ func up(clicontext *cli.Context) error {
if err := builder.Build(clicontext.Context, clicontext.Path("public-key")); err != nil {
return errors.Wrap(err, "failed to build the image")
}
gpu := builder.GPUEnabled()
gpu_enable := clicontext.Bool("no-gpu")
var gpu bool
if gpu_enable {
gpu = false
} else {
gpu = builder.GPUEnabled()
}

dockerClient, err := docker.NewClient(clicontext.Context)
if err != nil {
Expand Down

0 comments on commit 35c6b76

Please sign in to comment.