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

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

vincent0426
Copy link
Contributor

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 37.04%. Comparing base (9486172) to head (ee03d04).
Report is 45 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%   37.04%   +0.18%     
==========================================
  Files        1310     1318       +8     
  Lines      131246   132252    +1006     
==========================================
+ Hits        48380    48989     +609     
- Misses      78668    79004     +336     
- Partials     4198     4259      +61     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.10% <ø> (+0.04%) ⬆️
unittests-flytecopilot 22.23% <ø> (+10.50%) ⬆️
unittests-flytectl 62.33% <24.39%> (-0.06%) ⬇️
unittests-flyteidl 7.24% <ø> (+0.31%) ⬆️
unittests-flyteplugins 53.73% <ø> (-0.11%) ⬇️
unittests-flytepropeller 42.63% <ø> (-0.28%) ⬇️
unittests-flytestdlib 57.57% <ø> (+2.14%) ⬆️

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.

@vincent0426 vincent0426 requested a review from pingsutw November 23, 2024 00:40
@davidmirror-ops davidmirror-ops added the added Merged changes that add new functionality label Nov 26, 2024
@davidmirror-ops davidmirror-ops merged commit 121665d into flyteorg:master Nov 26, 2024
54 of 55 checks passed
Copy link

welcome bot commented Nov 26, 2024

Congrats on merging your first pull request! 🎉

@vincent0426 vincent0426 deleted the demo-cluster-custom-port branch December 5, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added Merged changes that add new functionality
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

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