diff --git a/doc-requirements.in b/doc-requirements.in index 1bcf77f9..0bdd65dd 100644 --- a/doc-requirements.in +++ b/doc-requirements.in @@ -5,5 +5,5 @@ sphinx-material sphinx-code-include sphinx-copybutton sphinx_fontawesome -sphinxcontrib-yt +sphinxcontrib-youtube sphinx-panels diff --git a/doc-requirements.txt b/doc-requirements.txt index 070d7493..65b0f20e 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -90,7 +90,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -sphinxcontrib-yt==0.2.2 +sphinxcontrib-youtube==1.2.0 # via -r doc-requirements.in text-unidecode==1.3 # via python-slugify diff --git a/docs/source/conf.py b/docs/source/conf.py index 419e02fd..9d28a8f1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -43,7 +43,7 @@ "sphinx-prompt", "sphinx_copybutton", "sphinx_fontawesome", - "sphinxcontrib.yt", + "sphinxcontrib.youtube", "sphinx_panels", ] diff --git a/pkg/sandbox/start.go b/pkg/sandbox/start.go index 744bc0a9..344003ca 100644 --- a/pkg/sandbox/start.go +++ b/pkg/sandbox/start.go @@ -162,7 +162,7 @@ func startSandbox(ctx context.Context, cli docker.Docker, g github.GHRepoService return nil, err } fmt.Printf("Existing details of your sandbox") - util.PrintSandboxMessage(consolePort, docker.Kubeconfig, sandboxConfig.DryRun) + util.PrintSandboxStartMessage(consolePort, docker.Kubeconfig, sandboxConfig.DryRun) return nil, nil } } @@ -429,7 +429,7 @@ func StartDemoCluster(ctx context.Context, args []string, sandboxConfig *sandbox if err != nil { return err } - util.PrintDemoMessage(util.DemoConsolePort, docker.Kubeconfig, sandboxConfig.DryRun) + util.PrintDemoStartMessage(util.DemoConsolePort, docker.Kubeconfig, sandboxConfig.DryRun) return nil } @@ -444,6 +444,6 @@ func StartSandboxCluster(ctx context.Context, args []string, sandboxConfig *sand if err != nil { return err } - util.PrintSandboxMessage(util.SandBoxConsolePort, docker.SandboxKubeconfig, sandboxConfig.DryRun) + util.PrintSandboxStartMessage(util.SandBoxConsolePort, docker.SandboxKubeconfig, sandboxConfig.DryRun) return nil } diff --git a/pkg/sandbox/teardown.go b/pkg/sandbox/teardown.go index 3881617d..231a4eb3 100644 --- a/pkg/sandbox/teardown.go +++ b/pkg/sandbox/teardown.go @@ -10,6 +10,7 @@ import ( "github.com/flyteorg/flytectl/pkg/configutil" "github.com/flyteorg/flytectl/pkg/docker" "github.com/flyteorg/flytectl/pkg/k8s" + "github.com/flyteorg/flytectl/pkg/util" ) func Teardown(ctx context.Context, cli docker.Docker, teardownFlags *sandboxCmdConfig.TeardownFlags) error { @@ -38,6 +39,7 @@ func Teardown(ctx context.Context, cli docker.Docker, teardownFlags *sandboxCmdC } fmt.Printf("%v %v Sandbox cluster is removed successfully.\n", emoji.Broom, emoji.Broom) + util.PrintSandboxTeardownMessage(util.SandBoxConsolePort, docker.SandboxKubeconfig) return nil } diff --git a/pkg/util/util.go b/pkg/util/util.go index a851ac4e..146ba6ec 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -72,8 +72,8 @@ func SetupFlyteDir() error { return nil } -// PrintDemoMessage will print sandbox success message -func PrintDemoMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bool) { +// PrintDemoStartMessage will print demo start success message +func PrintDemoStartMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bool) { kubeconfig := strings.Join([]string{ "$KUBECONFIG", kubeconfigLocation, @@ -84,10 +84,9 @@ func PrintDemoMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bo successMsg = fmt.Sprintf("%v http://localhost:%v/console", ProgressSuccessMessagePending, flyteConsolePort) } else { successMsg = fmt.Sprintf("%v http://localhost:%v/console", ProgressSuccessMessage, flyteConsolePort) - } fmt.Printf("%v %v %v %v %v \n", emoji.ManTechnologist, successMsg, emoji.Rocket, emoji.Rocket, emoji.PartyPopper) - fmt.Printf("%v Run the following command to export sandbox environment variables for accessing flytectl\n", emoji.Sparkle) + fmt.Printf("%v Run the following command to export demo environment variables for accessing flytectl\n", emoji.Sparkle) fmt.Printf(" export FLYTECTL_CONFIG=%v \n", configutil.FlytectlConfig) if dryRun { fmt.Printf("%v Run the following command to export kubeconfig variables for accessing flyte pods locally\n", emoji.Sparkle) @@ -97,8 +96,8 @@ func PrintDemoMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bo fmt.Printf("%s The Minio API is hosted on localhost:30002. Use http://localhost:30080/minio/login for Minio console\n", emoji.OpenFileFolder) } -// PrintSandboxMessage will print sandbox success message -func PrintSandboxMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bool) { +// PrintSandboxStartMessage will print sandbox start success message +func PrintSandboxStartMessage(flyteConsolePort int, kubeconfigLocation string, dryRun bool) { kubeconfig := strings.Join([]string{ "$KUBECONFIG", kubeconfigLocation, @@ -109,7 +108,6 @@ func PrintSandboxMessage(flyteConsolePort int, kubeconfigLocation string, dryRun successMsg = fmt.Sprintf("%v http://localhost:%v/console", ProgressSuccessMessagePending, flyteConsolePort) } else { successMsg = fmt.Sprintf("%v http://localhost:%v/console", ProgressSuccessMessage, flyteConsolePort) - } fmt.Printf("%v %v %v %v %v \n", emoji.ManTechnologist, successMsg, emoji.Rocket, emoji.Rocket, emoji.PartyPopper) fmt.Printf("%v Run the following command to export sandbox environment variables for accessing flytectl\n", emoji.Sparkle) @@ -120,6 +118,12 @@ func PrintSandboxMessage(flyteConsolePort int, kubeconfigLocation string, dryRun } } +// PrintSandboxTeardownMessage will print sandbox teardown success message +func PrintSandboxTeardownMessage(flyteConsolePort int, kubeconfigLocation string) { + fmt.Printf("%v Run the following command to unset sandbox environment variables for accessing flytectl\n", emoji.Sparkle) + fmt.Printf(" unset FLYTECTL_CONFIG \n") +} + // SendRequest will create request and return the response func SendRequest(method, url string, option io.Reader) (*http.Response, error) { client := &http.Client{} diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 492dc262..dd9de2a1 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -27,9 +27,15 @@ func TestSetupFlyteDir(t *testing.T) { assert.Nil(t, SetupFlyteDir()) } -func TestPrintSandboxMessage(t *testing.T) { +func TestPrintSandboxStartMessage(t *testing.T) { t.Run("Print Sandbox Message", func(t *testing.T) { - PrintSandboxMessage(SandBoxConsolePort, docker.SandboxKubeconfig, false) + PrintSandboxStartMessage(SandBoxConsolePort, docker.SandboxKubeconfig, false) + }) +} + +func TestPrintSandboxTeardownMessage(t *testing.T) { + t.Run("Print Sandbox Message", func(t *testing.T) { + PrintSandboxTeardownMessage(SandBoxConsolePort, docker.SandboxKubeconfig) }) }