-
Couldn't load subscription status.
- Fork 659
feat: add network isolation modes to container/run.sh script #3237
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
feat: add network isolation modes to container/run.sh script #3237
Conversation
- Add --network flag to run.sh supporting host, bridge, none, and container sharing - Update README with comprehensive network configuration documentation - Add CI/CD workflow examples with bridge networking for isolation - Document limitations and use cases for each network mode Signed-off-by: Keiven Chang <[email protected]>
WalkthroughAdds a configurable --network option to container/run.sh (default: host) and updates container/README.md with expanded network configuration documentation, examples, and CI/CD workflow guidance. Docker run now uses the selected network value instead of a hardcoded host network. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant run.sh as run.sh
participant Docker as docker run
User->>run.sh: Invoke with args (e.g., --network bridge)
run.sh->>run.sh: Parse options (get_options)
run.sh-->>run.sh: Set NETWORK (default host or provided value)
run.sh->>Docker: docker run --network "$NETWORK" ...
Docker-->>run.sh: Container started with selected network
run.sh-->>User: Exit with status
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add warning about host networking port sharing (only one NATS/etcd instance) - Update network mode comparison table with Port Sharing column - Fix production workflow to use non-local-dev image (runs as root) - Improve CI/CD examples to use appropriate image types - Clarify bridge networking setup instructions for full stack testing Signed-off-by: Keiven Chang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! We have network isolation to the container.
One thing people might ask in the future is adding port publish
-p HOST_PORT:CONTAINER_PORT
because the host or other containers no longer have access to network services at the container if bridge mode is used, so network service ports will need to be explicitly published, but I think this can be done in a separate PR given the default option is still "host".
…D workflow - Add detailed port sharing limitations and warnings for host networking - Restructure CI/CD workflow into clear numbered steps - Add comprehensive framework-specific GPU memory configuration - Include inline argument explanations for vLLM, SGLang, and TensorRT-LLM - Improve code block formatting with proper bash syntax highlighting - Remove redundant sections and streamline documentation flow - Add bridge networking isolation benefits and setup instructions Signed-off-by: Keiven Chang <[email protected]>
- Unify CI/CD workflow format to match Development/Production workflows - Use single code block with numbered comments for consistency - Remove framework bias by treating vLLM, SGLang, TensorRT-LLM equally - Uncomment all framework alternatives for user choice - Consolidate framework-specific arguments into compact summary - Improve documentation consistency across all workflow sections Signed-off-by: Keiven Chang <[email protected]>
- Add --port|-p option to run.sh for Docker port mapping - Integrate PORT_MAPPINGS variable into docker run command - Update help text with port mapping documentation - Add cache volume mount (-v /home/ubuntu/.cache:/home/ubuntu/.cache) to all examples - Simplify bridge networking examples and remove redundant port examples - Add port sharing note with host_port:container_port format clarification - Enhance network mode comparison table with port publishing column - Standardize container examples across all networking modes Signed-off-by: Keiven Chang <[email protected]>
Ok, I just added the --port|-p option and mentioned in the README.md about it. |
Signed-off-by: Keiven Chang <[email protected]> Signed-off-by: Harrison King Saturley-Hall <[email protected]>
…3402) Signed-off-by: Keiven Chang <[email protected]> Signed-off-by: Harrison King Saturley-Hall <[email protected]> Co-authored-by: Keiven C <[email protected]>
Overview:
Add network isolation modes to container run script with comprehensive configuration options. This enables secure CI/CD pipelines and flexible networking for different deployment scenarios.
Details:
--networkflag torun.shsupporting host, bridge, none, and container sharing modesWhere should the reviewer start?
container/run.sh- New network flag implementation and argument parsingcontainer/README.md- Comprehensive network configuration documentation and examples/coderabbit profile chill
Summary by CodeRabbit
New Features
Documentation