feat: network isolation support for Go and per-language resource limits#29
Merged
feat: network isolation support for Go and per-language resource limits#29
Conversation
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GOPROXY=offandGOSUMDB=offProblem
Go network isolation: When
networkPolicy.denyEgress: trueis set, Go execution fails becausego runtries to reachproxy.golang.orgfor module verification. This causes a 30-second timeout.Resource constraints: Go compilation is CPU-intensive. Previously, all languages shared the same sidecar resource limits, making it impossible to give Go more resources without affecting Python/JavaScript.
Solution
Network Isolation
NETWORK_ISOLATEDenvironment variable to sidecar containerGOPROXY=offandGOSUMDB=offto work offlinePer-Language Resources
execution.sidecar.resourcesdefaults when not specifiedFiles Changed
docker/sidecar/main.py- Network isolation override logic and debug loggingdocker/go.Dockerfile- Added comment about GOPROXY overridesrc/services/kubernetes/models.py- Addednetwork_isolatedto PoolConfig/PodSpecsrc/services/kubernetes/client.py- PassNETWORK_ISOLATEDenv var to sidecarsrc/services/kubernetes/pool.py- Pass network_isolated through to pod creationsrc/services/kubernetes/job_executor.py- Pass network_isolated to job creationsrc/services/kubernetes/manager.py- Added network_isolated parametersrc/config/__init__.py- Read per-language resources from env varshelm-deployments/kubecoderun/templates/configmap.yaml- Generate per-language resource env varshelm-deployments/kubecoderun/values.yaml- Document per-language resources schematests/unit/test_sidecar_network_isolation.py- New tests for network isolationtests/unit/test_pool.py- Tests for per-language resourcestests/unit/test_kubernetes_client.py- Tests for network_isolated parameterType of change
How Has This Been Tested?
GOPROXY=offis appliedChecklist