Skip to content

Commit

Permalink
fix: pre-create the workdir (#1174)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>

Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy committed Nov 10, 2022
1 parent 66d9cb0 commit b1eb44e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/lang/ir/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/tensorchord/envd/pkg/config"
"github.com/tensorchord/envd/pkg/flag"
"github.com/tensorchord/envd/pkg/types"
"github.com/tensorchord/envd/pkg/util/fileutil"
"github.com/tensorchord/envd/pkg/version"
)

Expand Down Expand Up @@ -270,7 +271,10 @@ func (g Graph) copySSHKey(root llb.State) (llb.State, error) {
}

func (g Graph) compileMountDir(root llb.State) llb.State {
mount := root
// create the ENVD_WORKDIR as a placeholder (envd-server may not mount this dir)
workDir := fileutil.EnvdHomeDir(g.EnvironmentName)
mount := root.File(llb.Mkdir(workDir, 0755, llb.WithParents(true), llb.WithUIDGID(g.uid, g.gid)),
llb.WithCustomNamef("[internal] create work dir: %s", workDir))
for _, m := range g.Mount {
mount = mount.File(llb.Mkdir(m.Destination, 0755, llb.WithParents(true),
llb.WithUIDGID(g.uid, g.gid)),
Expand Down

0 comments on commit b1eb44e

Please sign in to comment.