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

Rename flytesnacks flag to sourcesPath #116

Merged
merged 1 commit into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ PACKAGE ?=github.com/flyteorg/flytestdlib

LD_FLAGS="-s -w -X $(PACKAGE)/version.Version=$(GIT_VERSION) -X $(PACKAGE)/version.Build=$(GIT_HASH) -X $(PACKAGE)/version.BuildTime=$(TIMESTAMP)"



define PIP_COMPILE
pip-compile $(1) --upgrade --verbose
endef
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/subcommand/sandbox/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/config/subcommand/sandbox/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/config/subcommand/sandbox/sandbox_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var (
DefaultConfig = &Config{}
)

// Config
// Config represents the config parameters exposed for the `sandbox` command.
type Config struct {
SnacksRepo string `json:"flytesnacks" pflag:", Path of your flytesnacks repository"`
SourcesPath string `json:"sourcesPath" pflag:",Path to your source code path where flyte workflows and tasks are."`
}
6 changes: 3 additions & 3 deletions cmd/sandbox/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Start will run the flyte sandbox cluster inside a docker container and setup the
Mount your flytesnacks repository code inside sandbox
::

bin/flytectl sandbox start --flytesnacks=$HOME/flyteorg/flytesnacks
bin/flytectl sandbox start --sourcesPath=$HOME/flyteorg/flytesnacks
Usage
`
)
Expand Down Expand Up @@ -65,10 +65,10 @@ func startSandbox(ctx context.Context, cli docker.Docker, reader io.Reader) (*bu
return nil, err
}

if len(sandboxConfig.DefaultConfig.SnacksRepo) > 0 {
if len(sandboxConfig.DefaultConfig.SourcesPath) > 0 {
docker.Volumes = append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
}
Expand Down
28 changes: 14 additions & 14 deletions cmd/sandbox/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -97,10 +97,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -133,10 +133,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -177,10 +177,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -213,10 +213,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -249,10 +249,10 @@ func TestStartSandboxFunc(t *testing.T) {
errCh := make(chan error)
bodyStatus := make(chan container.ContainerWaitOKBody)
mockDocker := &mocks.Docker{}
sandboxConfig.DefaultConfig.SnacksRepo = f.UserHomeDir()
sandboxConfig.DefaultConfig.SourcesPath = f.UserHomeDir()
volumes := append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.SnacksRepo,
Source: sandboxConfig.DefaultConfig.SourcesPath,
Target: docker.FlyteSnackDir,
})
mockDocker.OnContainerCreate(ctx, &container.Config{
Expand Down Expand Up @@ -312,7 +312,7 @@ func TestStartSandboxFunc(t *testing.T) {
}).Return(reader, nil)
mockDocker.OnContainerWaitMatch(ctx, mock.Anything, container.WaitConditionNotRunning).Return(bodyStatus, errCh)
docker.Client = mockDocker
sandboxConfig.DefaultConfig.SnacksRepo = ""
sandboxConfig.DefaultConfig.SourcesPath = ""
err := startSandboxCluster(ctx, []string{}, cmdCtx)
assert.Nil(t, err)
})
Expand Down Expand Up @@ -348,7 +348,7 @@ func TestStartSandboxFunc(t *testing.T) {
}).Return(reader, nil)
mockDocker.OnContainerWaitMatch(ctx, mock.Anything, container.WaitConditionNotRunning).Return(bodyStatus, errCh)
docker.Client = mockDocker
sandboxConfig.DefaultConfig.SnacksRepo = ""
sandboxConfig.DefaultConfig.SourcesPath = ""
err := startSandboxCluster(ctx, []string{}, cmdCtx)
assert.NotNil(t, err)
})
Expand Down
4 changes: 2 additions & 2 deletions docs/source/gen/flytectl_sandbox_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Start will run the flyte sandbox cluster inside a docker container and setup the
Mount your flytesnacks repository code inside sandbox
::

bin/flytectl sandbox start --flytesnacks=$HOME/flyteorg/flytesnacks
bin/flytectl sandbox start --sourcesPath=$HOME/flyteorg/flytesnacks
Usage


Expand All @@ -31,7 +31,7 @@ Options

::

--flytesnacks string Path of your flytesnacks repository
--sourcesPath string Path to your source code path where flyte workflows and tasks are.
-h, --help help for start

Options inherited from parent commands
Expand Down