flyte icon indicating copy to clipboard operation
flyte copied to clipboard

feat: add custom port support for sandbox

Open muskan-creates352 opened this issue 6 months ago • 0 comments

Tracking issue

Closes #7346

Why are the changes needed?

The sandbox currently uses fixed port mappings by default. This becomes an issue when those ports are already occupied on the local machine, making it difficult to start the sandbox in some development environments.

What changes were proposed in this pull request?

This PR adds support for custom sandbox port mappings through a new --ports flag.

Changes made:

  • Added a Ports field to the sandbox configuration.
  • Updated sandbox startup logic to use custom ports when provided.
  • Updated Docker port parsing to accept user-defined mappings.
  • Preserved the existing default behavior when custom ports are not specified.

Example usage:

flytectl sandbox start --ports 8080:30081

How was this patch tested?

  • Ran go build ./...
  • Verified that the sandbox commands compile successfully.
  • Checked that flytectl sandbox start --help shows the new --ports flag correctly.

Checklist

  • [x] All commits are signed-off.
  • [x] Verified changes locally.

muskan-creates352 avatar May 10 '26 06:05 muskan-creates352