Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: customize demo cluster port #5969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vincent0426
Copy link

Tracking issue

Closes #3792

Why are the changes needed?

What changes were proposed in this pull request?

  1. Add a new parameter port, e.g., flytectl demo start --port 6443
  2. Dynamically retrieve k8sEndpoint from sandbox_config.go instead of using fixed ones
  3. Refactor reload.go to retrieve sandbox config (follow other file structure under flyte/flytectl/cmd/demo)

How was this patch tested?

Tested that parameters were automatically generated with make generate

Setup process

  1. Run a k8s cluster that uses port 6443 (docker desktop k8s for testing)
  2. Start the demo cluster without specifying port, which defaults to :6443 (expected to fail)
  3. Start the demo cluster with port 6444
  4. kubectl --server=https://localhost:6444 get pods
  5. export FLYTECTL_CONFIG= ~/<pathTo>/.flyte/config-sandbox.yaml
  6. Run the test with any pyflyte run --remote

Screenshots

Screenshot 2024-11-07 at 10 58 51 AM

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Copy link

welcome bot commented Nov 7, 2024

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@eapolinario
Copy link
Contributor

Can you also modify the creation of the kubeconfig file to point to this new port? Trace uses of https://github.com/flyteorg/flyte/blob/master/flytectl/pkg/docker/docker_util.go#L31

As part of initializing the sandbox we write a kubeconfig file that simplifies access to the cluster. That kubeconfig file lives under ~/.flyte/sandbox/.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 24.39024% with 31 lines in your changes missing coverage. Please review.

Project coverage is 36.85%. Comparing base (9486172) to head (3048b00).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
flytectl/pkg/sandbox/reload.go 0.00% 26 Missing ⚠️
flytectl/pkg/sandbox/start.go 25.00% 3 Missing ⚠️
...tl/cmd/config/subcommand/sandbox/sandbox_config.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5969      +/-   ##
==========================================
- Coverage   36.86%   36.85%   -0.01%     
==========================================
  Files        1310     1312       +2     
  Lines      131246   131251       +5     
==========================================
- Hits        48380    48372       -8     
- Misses      78668    78684      +16     
+ Partials     4198     4195       -3     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.05% <ø> (ø)
unittests-flytecopilot 11.73% <ø> (ø)
unittests-flytectl 62.26% <24.39%> (-0.13%) ⬇️
unittests-flyteidl 6.92% <ø> (ø)
unittests-flyteplugins 53.84% <ø> (ø)
unittests-flytepropeller 42.90% <ø> (ø)
unittests-flytestdlib 55.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flytectl Feature] flytectl demo cluster - configurable port number
2 participants