Skip to content

Commit

Permalink
fix: Remove cwd in conda to enable remote cache (#1125)
Browse files Browse the repository at this point in the history
fix: Remove cwd in conda

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege committed Oct 31, 2022
1 parent 535e26a commit 0bdca3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/lang/ir/conda.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (g Graph) compileCondaEnvironment(root llb.State) (llb.State, error) {
}
// Create a conda environment.
cmd := fmt.Sprintf("bash -c \"%s create -n envd python=%s\"", g.condaCommandPath(), pythonVersion)
run = run.Dir(g.getWorkingDir()).Run(llb.Shlex(cmd),
run = run.Run(llb.Shlex(cmd),
llb.WithCustomNamef("[internal] create conda environment: %s", cmd))

switch g.Shell {
Expand Down
5 changes: 4 additions & 1 deletion pkg/lang/ir/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func (g Graph) compilePython(aptStage llb.State) (llb.State, error) {
llb.WithCustomName("[internal] conda python environment"))
diffSystemStage := llb.Diff(shellStage, systemStage,
llb.WithCustomName("[internal] install system packages"))
prePythonStage := llb.Merge([]llb.State{diffSystemStage, diffCondaEnvStage, shellStage}, llb.WithCustomName("pre-python stage"))
prePythonStage := llb.Merge([]llb.State{
diffSystemStage,
diffCondaEnvStage,
shellStage}, llb.WithCustomName("pre-python stage"))

condaStage := llb.Diff(prePythonStage,
g.compileCondaPackages(prePythonStage),
Expand Down

0 comments on commit 0bdca3c

Please sign in to comment.