Skip to content

Commit

Permalink
Feature/carlos ci action (#12)
Browse files Browse the repository at this point in the history
* remove extracted action

* adjust to usage of published action

* use published action

* add more checkouts

* fix action version

* fix action version

* test hotfix

* use newest version

* Update automated-testing/README.md

Co-authored-by: Bastian Lampe <bastian.lampe@rwth-aachen.de>

---------

Co-authored-by: Benedikt Haas <benedikt.haas@ika.rwth-aachen.de>
Co-authored-by: Christian Geller <88664444+cgeller@users.noreply.github.com>
Co-authored-by: Bastian Lampe <bastian.lampe@rwth-aachen.de>
  • Loading branch information
4 people authored Jun 20, 2024
1 parent bccf54c commit 94f2564
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 128 deletions.
69 changes: 0 additions & 69 deletions .github/actions/evaluate-scenario/action.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/actions/evaluate-scenario/scripts/cleanup-carlos.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .github/actions/evaluate-scenario/scripts/run-scenario.sh

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/evaluate-scenario/scripts/setup-carlos.sh

This file was deleted.

36 changes: 22 additions & 14 deletions .github/workflows/automated-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: automated-testing
on: push
jobs:
generate-scenario-job-matrix:
runs-on: self-hosted
runs-on: [self-hosted]
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
name: generate scenario job matrix
Expand All @@ -17,24 +17,28 @@ jobs:

evaluate-required-scenarios:
needs: generate-scenario-job-matrix
runs-on: self-hosted
runs-on: [self-hosted]
name: Run ${{ matrix.filename }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-scenario-job-matrix.outputs.matrix) }}
name: Eval ${{ matrix.filename }}
steps:
- run: rm -rf *
- uses: actions/checkout@v4
- uses: ./.github/actions/evaluate-scenario
- shell: bash
run: |
xhost +local:
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.1
with:
composefile-path: automated-testing/carla-sim.yml
scenario-folder-path: ${{ matrix.filedir }}
scenario-file-name: ${{ matrix.filename }}
simulator-image: rwthika/carla-simulator:server
simulator-offscreen: true
- shell: bash
run: |
xhost -local:
generate-opt-scenario-job-matrix:
needs: evaluate-required-scenarios
runs-on: self-hosted
runs-on: [self-hosted]
outputs:
opt-matrix: ${{ steps.generate-opt.outputs.matrix }}
name: generate optional scenario job matrix
Expand All @@ -49,18 +53,22 @@ jobs:

evaluate-optional-scenarios:
needs: generate-opt-scenario-job-matrix
runs-on: self-hosted
runs-on: [self-hosted]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-opt-scenario-job-matrix.outputs.opt-matrix) }}
name: Eval ${{ matrix.filename }}
name: Run ${{ matrix.filename }}
steps:
- run: rm -rf *
- uses: actions/checkout@v4
- uses: ./.github/actions/evaluate-scenario
- shell: bash
run: |
xhost +local:
- uses: ika-rwth-aachen/carlos-ci-action@v0.1.1
continue-on-error: true
with:
composefile-path: automated-testing/carla-sim.yml
scenario-folder-path: ${{ matrix.filedir }}
scenario-file-name: ${{ matrix.filename }}
simulator-image: rwthika/carla-simulator:server
simulator-offscreen: true
- shell: bash
run: |
xhost -local:
6 changes: 3 additions & 3 deletions automated-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ All scenarios within the test catalog are also simulated and evaluated in an aut
#### Actions

We provide two [GitHub actions](../.github/actions/) for CARLOS:
We provide two [GitHub actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions) for CARLOS:
- [generate-job-matrix](../.github/actions/generate-job-matrix/)
- [evaluate-scenario](../.github/actions/evaluate-scenario/)
- [carlos-ci-action](https://github.com/ika-rwth-aachen/carlos-ci-action)

They can be used within a GitHub CI workflow to create a job list of simulation runs, and consecutively run all simulations. A demonstration of this is presented next.

#### Workflow

The workflow presented in [automated-testing.yml](../.github/workflows/automated-testing.yml) combines the different actions and performs simulation evaluation analog to the local `evaluation-scenarios.sh`. It leverages the modularity and customizability of the provided actions by reusing them and configuring them differently. For example, the `generate-job-matrix` allows customizing the `query-string`, which is used for matching and collecting fitting scenarios as a job matrix for following pipeline steps.
The workflow presented in [automated-testing.yml](../.github/workflows/automated-testing.yml) combines the different actions and performs simulation evaluation analog to the local `evaluation-scenarios.sh`. It leverages the modularity and customizability of the provided actions by reusing them and configuring them differently. For example, `generate-job-matrix` allows customizing the `query-string`, which is used for matching and collecting fitting scenarios as a job matrix for following pipeline steps.

#### Self-Hosted GitHub Runner

Expand Down
18 changes: 18 additions & 0 deletions automated-testing/carla-sim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: carlos-ci-action
services:

carla-simulator:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
privileged: True
environment:
DISPLAY: $DISPLAY
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
image: rwthika/carla-simulator:server
command: bash -ic './CarlaUE4.sh -nosound 2>/dev/null'
2 changes: 1 addition & 1 deletion automated-testing/evaluate-scenarios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ update-simulator() {
docker compose -f $COMPOSE_TEMPLATE_PATH pull
}

COMPOSE_TEMPLATE_PATH="../.github/actions/evaluate-scenario/files/template.yml"
COMPOSE_TEMPLATE_PATH="./template.yml"

while getopts "hopn" flag; do
case "$flag" in
Expand Down
File renamed without changes.

0 comments on commit 94f2564

Please sign in to comment.