Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Absolute path for Source dir (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 authored Jul 1, 2021
1 parent bf60ec1 commit 2ab940a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/sandbox/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"

"github.com/flyteorg/flytectl/pkg/docker"

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2ab940a

Please sign in to comment.