Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,9 @@ jobs:
container_build:
name: Build Gym container
needs: [pre-flight, classify_changes, unit_tests]
# Nightly only: this job runs on the internal nemo-ci-aws-gpu-x2 runner
# pool, which is shared with NeMo-RL's H100 CI traffic and was queuing
# indefinitely on every PR push. Run it on the nightly schedule, or
# on-demand via workflow_dispatch, instead.
# Publish on the nightly schedule or on-demand via workflow_dispatch.
# The default AWS image build uses CPU capacity; its Dockerfile does not
# need a GPU. Other preflight routes retain their existing runner identity.
#
# GitHub applies an implicit success() check before a job's `if:` unless
# the condition contains a status function. Evaluate this condition even
Expand All @@ -130,7 +129,11 @@ jobs:
needs.classify_changes.result == 'success' &&
(needs.unit_tests.result == 'success' || needs.unit_tests.result == 'skipped')
}}
runs-on: ${{ startsWith(needs.pre-flight.outputs.runner_prefix, 'ephe-v2-') && format('{0}-a{1}', needs.pre-flight.outputs.runner_prefix, github.run_attempt) || needs.pre-flight.outputs.runner_prefix }}
runs-on: >-
${{ needs.pre-flight.outputs.runner_prefix == 'nemo-ci-aws-gpu-x2' && 'nemo-ci-aws-cpu-4-16'
|| (startsWith(needs.pre-flight.outputs.runner_prefix, 'ephe-v2-')
&& format('{0}-a{1}', needs.pre-flight.outputs.runner_prefix, github.run_attempt)
|| needs.pre-flight.outputs.runner_prefix) }}
environment: ${{ contains(needs.pre-flight.outputs.registry, 'azure') && 'nemo-ci' || '' }}
outputs:
image: ${{ steps.image.outputs.image }}
Expand Down
8 changes: 5 additions & 3 deletions tests/unit_tests/test_ci_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,17 @@ def test_cicd_main_wires_preflight_cpu_and_gpu_workflows() -> None:


def test_cicd_container_build_pushes_sha_image_after_unit_tests() -> None:
"""Publish the image on CPU capacity after the normal upstream checks."""
workflow = CICD_MAIN_WORKFLOW.read_text()

assert "name: Build Gym container" in workflow
runner_label = (
"runs-on: ${{ startsWith(needs.pre-flight.outputs.runner_prefix, 'ephe-v2-') "
"${{ needs.pre-flight.outputs.runner_prefix == 'nemo-ci-aws-gpu-x2' "
"&& 'nemo-ci-aws-cpu-4-16' || (startsWith(needs.pre-flight.outputs.runner_prefix, 'ephe-v2-') "
"&& format('{0}-a{1}', needs.pre-flight.outputs.runner_prefix, github.run_attempt) "
"|| needs.pre-flight.outputs.runner_prefix }}"
"|| needs.pre-flight.outputs.runner_prefix) }}"
)
assert runner_label in workflow
assert _cicd_main_jobs()["container_build"]["runs-on"] == runner_label
assert "uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f" in workflow
assert "uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25" in workflow
assert "build-contexts: nemo-gym=." in workflow
Expand Down
Loading