From 2a25558b1d0760c3a7bbf680331793b2ad9b4696 Mon Sep 17 00:00:00 2001 From: Ketan Umare <16888709+kumare3@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:26:31 -0700 Subject: [PATCH] Absolute path for Source dir (#126) Signed-off-by: Ketan Umare --- flytectl/cmd/sandbox/start.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/flytectl/cmd/sandbox/start.go b/flytectl/cmd/sandbox/start.go index 122b87f7cc..6a78d639e4 100644 --- a/flytectl/cmd/sandbox/start.go +++ b/flytectl/cmd/sandbox/start.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "os" + "path/filepath" "github.com/flyteorg/flytectl/pkg/docker" @@ -67,19 +68,25 @@ func startSandbox(ctx context.Context, cli docker.Docker, reader io.Reader) (*bu } if len(sandboxConfig.DefaultConfig.Source) > 0 { + source, err := filepath.Abs(sandboxConfig.DefaultConfig.Source) + if err != nil { + return nil, err + } docker.Volumes = append(docker.Volumes, mount.Mount{ Type: mount.TypeBind, - Source: sandboxConfig.DefaultConfig.Source, + Source: source, Target: docker.FlyteSnackDir, }) } + fmt.Printf("%v pulling docker image %s\n", emoji.Whale, docker.ImageName) os.Setenv("KUBECONFIG", docker.Kubeconfig) os.Setenv("FLYTECTL_CONFIG", docker.FlytectlConfig) if err := docker.PullDockerImage(ctx, cli, docker.ImageName); err != nil { return nil, err } + fmt.Printf("%v booting Flyte-sandbox container\n", emoji.FactoryWorker) exposedPorts, portBindings, _ := docker.GetSandboxPorts() ID, err := docker.StartContainer(ctx, cli, docker.Volumes, exposedPorts, portBindings, docker.FlyteSandboxClusterName, docker.ImageName) if err != nil {