Repository navigation
Add helmfile generation for deployment in Kubernetes and OpenADScale testing #13
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
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
712c353
initial version of dynamic helmfile
cgeller a0e7594
make carla host configurable
cgeller 468ac31
cleanup
cgeller f66427a
update monitoring and set service names
cgeller 7eb303b
update names
cgeller 2e318d5
update params
cgeller 954c74b
temporary fix image volumes
cgeller 36d3a60
clean default "/dev/null" |
cgeller d3b279d
update depends on
cgeller 9ca627c
update values
cgeller 536c03c
do not embedd variable defaults from .env
cgeller e83e02c
cleanup
cgeller a95373f
remove base.yaml.gotmpl
cgeller 172335b
updates values
cgeller b8c2424
update values
cgeller 60b1e6a
update for temporary local base chart usage
cgeller e46c034
update after rebase
cgeller eb48cc3
update
cgeller 86d535c
update volume mounting
cgeller b932a8b
fix commands
cgeller 7239589
fix carla host
cgeller 137c0e9
fix environment
cgeller ec3f98c
add new usecase and option to disable services
cgeller d3a5772
fix scenario runner ros
cgeller fdb9ac8
update values
cgeller d2c0686
restructuring
cgeller 907c967
update doc
cgeller ae847a0
update testing
cgeller bb0cc87
update after cleanup
cgeller e5cd7b8
update command
cgeller 7beea82
add helmfile generation CI
cgeller fbfa77c
trigger helmfile action on k8s branch
cgeller 02ddec9
reduce job name
cgeller 35887f7
make prefix optional in network policy
cgeller 4d61ff5
remove generated folder
cgeller 31a62ac
update deployment description
cgeller 2b01159
rename deployment folder
cgeller 9c779e6
use image mounts
cgeller d1b8129
include env file in bundle
cgeller f5a83b4
update charts for carla scenario runner and server
cgeller 72ac725
add gitlab pipeline
cgeller 32ca72d
update openadscale integration
cgeller b864fee
update image versions
cgeller 392e92e
simplify chart map
cgeller b36bfce
make CARLA_PORT configurable
cgeller 80a4713
rename OPENADSIM_PATH to PROJECT_PATH and drop runtime_env from chart…
cgeller fe28daf
cleanup k8s setup
cgeller b4a069e
fix readme
cgeller 6da62f1
simplify chart map
cgeller 4300f6d
cleanup helmfile generation
cgeller 053419d
temporary modify pcod service
cgeller bbf21bc
fix gitlab ci
cgeller b669d9e
update ci helmfiles
cgeller cdece29
fix gitlab pipeline
cgeller da8b8db
cleanup
cgeller 275d4e6
cleanup
cgeller 6ba45b6
move volume policies to services
cgeller 6b3b21e
Update .github/workflows/helmfile.yml
cgeller d873269
Update .github/workflows/helmfile.yml
cgeller 17a6e8c
Update deployment/addons/helmfile.yaml
cgeller 37ecb7a
Update deployment/addons/charts/middleware-bridge-network-policy/Char…
cgeller 3453e94
cleanup helfile
cgeller ac5c380
rename middleware bridge network policy
cgeller a8432a4
move stage definition to top
cgeller 97d9f5d
cleanup scenario runner command
cgeller 24abfcd
Update deployment/helmfile.yaml
cgeller 99fab44
Update deployment/README.md
cgeller 90c6606
cleanup deployment folder
cgeller 0a842f3
readded values file
cgeller 6a28d03
update chart map
cgeller 4daaa41
add node documentation
cgeller 2041e04
do not expose CARLA_SERVER and TRITON_HOST anymore
cgeller edc43d8
drop temporary k8s trigger and add ghcr cleanup
cgeller c323d99
temporarily use openads-helm feature branch for helmfile oci
cgeller c153199
drop sha tags of gui image
cgeller 1b5a402
Revert "temporarily use openads-helm feature branch for helmfile oci"
cgeller 199f36e
do not expose CARLA_HOST in compose overrides
cgeller 70e5f32
update to openadscale
cgeller 7433b65
cleanup chart map
cgeller b4daee3
cleanup carla environment variables
cgeller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: ghcr-cleanup | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 0 * * *" # every day at 00:00 | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| packages: write | ||
|
|
||
| jobs: | ||
| helmfile: | ||
| uses: openads-project/openads-helm/.github/workflows/reusable-helmfile-cleanup.yml@main | ||
|
|
||
| gui: | ||
| name: Cleanup gui | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Cleanup ${{ github.event.repository.name }}/gui | ||
| uses: dataaxiom/ghcr-cleanup-action@v1.2.2 | ||
| with: | ||
| packages: ${{ github.event.repository.name }}/gui | ||
| dry-run: false | ||
| use-regex: true | ||
| skip-regex-checks: true | ||
| older-than: 1 month | ||
| exclude-tags: '^(v[0-9]+\.[0-9]+\.[0-9]+|latest)$' # v1.2.3, latest | ||
| delete-tags: ".*" | ||
| delete-untagged: true | ||
| delete-ghost-images: true | ||
| delete-partial-images: true | ||
| delete-orphaned-images: true | ||
| validate: true |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: helmfile-oci | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - 'v[0-9]+.[0-9]+.[0-9]+' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| jobs: | ||
| helmfile-oci: | ||
| uses: openads-project/openads-helm/.github/workflows/reusable-helmfile-oci.yml@main | ||
| with: | ||
| compose-file: docker-compose.yml | ||
| include-env-file-in-bundle: true | ||
| chart-map: deployment/chart-map.yaml | ||
| profiles: carla,traffic,automated-testing,no-perception,planning | ||
| output-dir: deployment/generated | ||
| helmfile-entrypoint: deployment/helmfile.yaml | ||
| bundle-dir: deployment |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| stages: | ||
| - build | ||
| - testing | ||
|
|
||
| include: | ||
| - remote: https://raw.githubusercontent.com/openads-project/openads-helm/main/.gitlab-ci/reusable-helmfile-oci.yml | ||
| inputs: | ||
| compose-file: docker-compose.yml | ||
| include-env-file-in-bundle: true | ||
| chart-map: deployment/chart-map.yaml | ||
| profiles: carla,traffic,automated-testing,no-perception,planning | ||
| output-dir: deployment/generated | ||
| helmfile-entrypoint: deployment/helmfile.yaml | ||
| bundle-dir: deployment | ||
| - component: gitlab.ika.rwth-aachen.de/fb-fi/ops/openadscale/openadscale@main | ||
| inputs: | ||
| scenario-search-pattern: scenario.generator/**/*.xosc |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Helmfile deployment | ||
|
|
||
| This directory contains the OpenADSim-specific inputs and manual additions for the [openads-helm generator](https://github.com/openads-project/openads-helm/tree/main/utils/generate_helmfile_from_compose), which converts `docker-compose.yml` into a Helmfile setup. | ||
|
|
||
| ## Layout | ||
|
|
||
| - `helmfile.yaml` is the entrypoint. It loads the add-ons and the generated services. | ||
| - `chart-map.yaml` contains chart references and conversion rules that cannot be derived from Compose. | ||
| - `addons/` contains manually maintained releases: a NetworkPolicy that isolates the middleware bridge per stack, deployed with the `carla` profile. | ||
| - `generated/` is the generator output. It is ignored by Git and must not be committed. | ||
|
|
||
| ## CI | ||
|
|
||
| The [GitHub workflow](../.github/workflows/helmfile-oci.yml) and the [GitLab pipeline](../.gitlab-ci.yml) use the reusable templates from `openads-helm`. They generate `deployment/generated`, validate it with `helmfile`, and publish the `deployment` directory together with the root `.env` as OCI bundle `<registry>/<repository>/helmfile`, tagged with the branch or tag name. Pull requests publish under their source branch name. | ||
|
|
||
| The scheduled [cleanup workflow](../.github/workflows/ghcr-cleanup.yml) deletes bundles older than one month except `main` and `vX.Y.Z`. On GitLab, the container registry cleanup policy of the project applies the same rule. | ||
|
|
||
| ## Local usage | ||
|
|
||
| Generate the Helmfile with a sibling checkout of `openads-helm`: | ||
|
|
||
| ```sh | ||
| # openadsim$ | ||
| git clone https://github.com/openads-project/openads-helm ../openads-helm | ||
| python3 ../openads-helm/utils/generate_helmfile_from_compose/scripts/generate_helmfile_from_compose.py \ | ||
|
cgeller marked this conversation as resolved.
Resolved
|
||
| docker-compose.yml \ | ||
| --env-file .env \ | ||
| --chart-map deployment/chart-map.yaml \ | ||
| --output-dir deployment/generated | ||
| ``` | ||
|
|
||
| Load the runtime environment, then validate and deploy. `COMPOSE_PROFILES` selects the services as in Compose. `PROJECT_PATH` must be the absolute checkout path on the Kubernetes node, as it is used for `hostPath` volumes. | ||
|
|
||
| ```sh | ||
| set -a; . ./.env; set +a | ||
| export PROJECT_PATH="$(pwd)" | ||
|
lreiher marked this conversation as resolved.
Resolved
|
||
|
|
||
| helmfile --file deployment/helmfile.yaml template --concurrency 1 | ||
| helmfile --file deployment/helmfile.yaml apply | ||
| ``` | ||
|
|
||
| ## Optional settings | ||
|
|
||
| To run all services on one node of a multi-node cluster, e.g. the node with the checkout at `PROJECT_PATH`, export its hostname as `NODE`: | ||
|
|
||
| ```sh | ||
| kubectl get nodes -L kubernetes.io/hostname | ||
| export NODE=worker-1 | ||
| ``` | ||
|
|
||
| `DEPLOYMENT_PREFIX` separates several stacks in one namespace. References to other services of the stack are prefixed automatically, e.g. `CARLA_HOST: carla-server` becomes `sim1-carla-server`: | ||
|
|
||
| ```sh | ||
| export DEPLOYMENT_PREFIX=sim1 | ||
| ``` | ||
5 changes: 5 additions & 0 deletions
5
deployment/addons/charts/ros-middleware-bridge-network-policy/Chart.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: v2 | ||
| name: ros-middleware-bridge-network-policy | ||
| description: NetworkPolicy to isolate ros-middleware-bridges in concurrent deployments | ||
| type: application | ||
| version: 0.1.0 |
43 changes: 43 additions & 0 deletions
43
deployment/addons/charts/ros-middleware-bridge-network-policy/templates/networkpolicy.yaml
|
lreiher marked this conversation as resolved.
Resolved
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| {{- $prefix := .Values.namePrefix | default "" -}} | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: {{ .Release.Name }} | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ printf "%s-%s" $prefix .Values.middlewareBridgeName | trimPrefix "-" | quote }} | ||
| policyTypes: | ||
| - Ingress | ||
| - Egress | ||
| ingress: | ||
| - from: | ||
| - podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ printf "%s-%s" $prefix .Values.carlaServerName | trimPrefix "-" | quote }} | ||
| egress: | ||
| - to: | ||
| - podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ printf "%s-%s" $prefix .Values.carlaServerName | trimPrefix "-" | quote }} | ||
| - to: | ||
| - podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ printf "%s-%s" $prefix .Values.zenohRouterName | trimPrefix "-" | quote }} | ||
| ports: | ||
| - protocol: TCP | ||
| port: {{ .Values.zenohPort }} | ||
| - protocol: UDP | ||
| port: {{ .Values.zenohPort }} | ||
| - to: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| kubernetes.io/metadata.name: kube-system | ||
| podSelector: | ||
| matchLabels: | ||
| k8s-app: kube-dns | ||
| ports: | ||
| - protocol: UDP | ||
| port: 53 | ||
| - protocol: TCP | ||
| port: 53 |
5 changes: 5 additions & 0 deletions
5
deployment/addons/charts/ros-middleware-bridge-network-policy/values.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| namePrefix: "" | ||
| middlewareBridgeName: ros-middleware-bridge | ||
| carlaServerName: carla-server | ||
| zenohRouterName: zenoh-router | ||
| zenohPort: 7447 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| environments: | ||
| default: | ||
| values: | ||
| - ../generated/environments/services.yaml.gotmpl | ||
| --- | ||
| releases: | ||
| # NetworkPolicy to isolate ros-middleware-bridges in concurrent deployments | ||
| - name: '{{ printf "%s-middleware-bridge-policy" (env "DEPLOYMENT_PREFIX") | trimPrefix "-" }}' | ||
| chart: charts/ros-middleware-bridge-network-policy | ||
| condition: serviceEnabled.ros-middleware-bridge.enabled | ||
| values: | ||
| - values.yaml.gotmpl |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| namePrefix: {{ env "DEPLOYMENT_PREFIX" | quote }} |
|
cgeller marked this conversation as resolved.
Resolved
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| excluded_profiles: | ||
| - donotuse | ||
| - gui | ||
| - sumo | ||
| services: | ||
| # charts centrally maintained in https://github.com/openads-project/openads-helm/tree/main/charts | ||
| zenoh-router: | ||
| chart: oci://ghcr.io/openads-project/openads-helm/zenoh-router | ||
| version: 0.2.10 | ||
| triton-server: | ||
| chart: oci://ghcr.io/openads-project/openads-helm/triton-server | ||
| version: "26.05" | ||
| # nested charts in https://github.com/openads-project/carla-simulator/tree/main/deployment/helm | ||
| carla-server: | ||
| chart: oci://ghcr.io/openads-project/carla-simulator/helm/carla-server | ||
| version: 0.10.0-1.1.1 | ||
| carla-client: | ||
| chart: oci://ghcr.io/openads-project/carla-simulator/helm/carla-client | ||
| version: 0.10.0-1.1.1 | ||
| # nested charts in https://github.com/openads-project/carla-ros-bridge/tree/main/deployment/helm | ||
| carla-ackermann-control: | ||
| chart: oci://ghcr.io/openads-project/carla-ros-bridge/helm/carla-ackermann-control | ||
| version: 0.10.0-1.2.0-carla-ackermann-control | ||
| carla-manual-control: | ||
| chart: oci://ghcr.io/openads-project/carla-ros-bridge/helm/carla-manual-control | ||
| version: 0.10.0-1.2.0-carla-manual-control | ||
| carla-ros-bridge: | ||
| chart: oci://ghcr.io/openads-project/carla-ros-bridge/helm/carla-ros-bridge | ||
| version: 0.10.0-1.2.0-carla-ros-bridge | ||
| carla-spawn-objects: | ||
| chart: oci://ghcr.io/openads-project/carla-ros-bridge/helm/carla-spawn-objects | ||
| version: 0.10.0-1.2.0-carla-spawn-objects | ||
| # nested chart in https://github.com/openads-project/carla-scenario-runner/tree/main/deployment/helm | ||
| carla-scenario-runner-ros-automated-testing: &scenario-runner | ||
| chart: oci://ghcr.io/openads-project/carla-scenario-runner/helm/carla-scenario-runner-ros | ||
| version: 0.10.0-1.1.2 | ||
| volume_policies: | ||
| /scenarios: bind | ||
| carla-scenario-runner-ros-manual-testing: *scenario-runner | ||
| # chart derived from image, writable volume mounted from host | ||
| monitoring.rviz-carla: | ||
| volume_policies: | ||
| /docker-ros/ws/monitoring-volume: bind |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * | ||
| !.gitignore |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| helmfiles: | ||
| - path: addons/helmfile.yaml | ||
| - path: generated/helmfile.yaml # auto-generated by openads-helm |
|
cgeller marked this conversation as resolved.
Resolved
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.