Skip to content

Commit

Permalink
ci: Combine cleanup and main job
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Koenig <[email protected]>
  • Loading branch information
ko3n1g committed Aug 12, 2024
1 parent 2e57cd7 commit d5a4cac
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/_test_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,18 @@ on:
description: Last 2000 characters of the test step's log
value: ${{ jobs.main.outputs.log }}
jobs:
runner-auto-clean:
runs-on: ${{ inputs.RUNNER }}
steps:
- name: Docker system cleanup
run: |
docker system prune -a --filter "until=48h" --force
main:
runs-on: ${{ inputs.RUNNER }}
outputs:
conclusion: ${{ steps.main.conclusion }}
log: ${{ steps.main.outputs.log }}
container:
image: nemoci.azurecr.io/nemo_container_${{ github.run_id }}
options:
--device=/dev/nvidia0
--gpus all
--shm-size=8g
--env TRANSFORMERS_OFFLINE=0
--env HYDRA_FULL_ERROR=1
--volume /mnt/datadrive/TestData:/home/TestData
permissions:
actions: write # Required for cancelling workflows
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker system cleanup
run: |
docker system prune -a --filter "until=48h" --force
- id: main
name: Run main script
timeout-minutes: ${{ inputs.TIMEOUT }}
Expand All @@ -68,7 +54,7 @@ jobs:
(
set -e
${{ inputs.SCRIPT }}
docker run --rm --device=/dev/nvidia0 --gpus all --shm-size=8g --env TRANSFORMERS_OFFLINE=0 --env HYDRA_FULL_ERROR=1 --volume /mnt/datadrive/TestData:/home/TestData nemoci.azurecr.io/nemo_container_${{ github.run_id }} bash -c '${{ inputs.SCRIPT }}'
) 2> >(tee err.log)
EXIT_CODE=$?
Expand All @@ -79,6 +65,7 @@ jobs:
- uses: "NVIDIA/NeMo/.github/actions/cancel-workflow@main"
if: failure() && inputs.IS_OPTIONAL == false

- name: after_script
if: always() && inputs.AFTER_SCRIPT != ':'
run: ${{ inputs.AFTER_SCRIPT }}

0 comments on commit d5a4cac

Please sign in to comment.