Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions .github/workflows/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Shared image config for CI workflows. Loaded by the `config` job in each
# workflow via yq and exposed as job outputs (see e.g. .github/workflows/build.yaml).
isaacsim_image_name: nvcr.io/nvidian/isaac-sim
Comment thread
nvsekkin marked this conversation as resolved.
Resolved
isaacsim_image_tag: latest-develop
Comment thread
nvsekkin marked this conversation as resolved.
Resolved
isaaclab_image_name: nvcr.io/nvidian/isaac-lab
17 changes: 13 additions & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
# we're skipping the branches and paths filter to allow docs to be built on any PR because heredoc is used
# additionally, we have a check that determines what version of docs will be built
types: [opened, synchronize, reopened]
# Nightly multi-version rebuild + deploy from develop tip. Picks up every
# develop commit accumulated since the previous nightly in a single run.
schedule:
- cron: '0 3 * * *' # 7pm PST / 8pm PDT
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -29,13 +34,13 @@ jobs:
trigger-deploy: ${{ steps.trigger-deploy.outputs.defined }}
steps:
- id: info
run: echo "repo=github.repository=${{ github.repository }}, ref=github.ref=${{ github.ref }}"
run: echo "repo=github.repository=${{ github.repository }}, ref=github.ref=${{ github.ref }}, event=github.event_name=${{ github.event_name }}"
- id: trigger-deploy
env:
REPO_NAME: ${{ secrets.REPO_NAME }}
# develop, main, release/ trigger multi-version build, then deployment to gh-pages
# all others - just the current docs without deployment
if: "${{ github.repository == env.REPO_NAME && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/release/')) }}"
# Nightly schedule and workflow_dispatch trigger multi-version deploy.
# All branch pushes (including main) build current-docs only; deploy waits for the cron above.
if: "${{ github.repository == env.REPO_NAME && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}"
run: echo "defined=true" >> "$GITHUB_OUTPUT"; echo "Docs will be built multi-version and deployed"
Comment thread
nvsekkin marked this conversation as resolved.
Resolved

build-latest-docs:
Expand Down Expand Up @@ -79,6 +84,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# On schedule, always rebuild from the develop tip regardless of
# which ref the cron run defaults to. Other events use github.ref.
ref: ${{ github.event_name == 'schedule' && 'develop' || '' }}

- name: Setup python
uses: actions/setup-python@v5
Expand Down
248 changes: 248 additions & 0 deletions .github/workflows/publish-images.yaml
Comment thread
nvsekkin marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

name: Publish Docker Images

on:
# Nightly build + publish from develop, main, and the active release branches
# listed in CRON_RELEASE_BRANCHES below. No push triggers — workflow_dispatch
# also accepts any publishable branch.
schedule:
- cron: '0 3 * * *' # 7pm PST / 8pm PDT
workflow_dispatch:
inputs:
branch:
description: 'Branch to build and publish (e.g. develop, release/3.0.0-beta2, main)'
required: true
type: string

permissions:
contents: read

# Active release branches the nightly cron publishes, alongside develop and main.
# Single source of truth — append a ref here when a new release/* is cut and drop
# it once that release is retired, so stale release branches aren't rebuilt nightly.
# Mirrors CRON_BRANCHES in nightly-changelog.yml. Whitespace per entry is stripped.
env:
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
CRON_RELEASE_BRANCHES: release/3.0.0-beta2
Comment thread
nvsekkin marked this conversation as resolved.
Resolved

jobs:
resolve-branches:
name: Resolve publish branches
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
branches: ${{ steps.b.outputs.branches }}
steps:
- id: b
env:
EVENT_NAME: ${{ github.event_name }}
MANUAL_BRANCH: ${{ inputs.branch }}
RELEASE_BRANCHES: ${{ env.CRON_RELEASE_BRANCHES }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
# Manual trigger: build exactly the one branch the maintainer entered.
arr=$(echo "$MANUAL_BRANCH" | jq -R . | jq -s -c .)
else
# Schedule: develop + main + the configured active release branches.
# CSV → newline, trimming surrounding whitespace per entry.
releases=$(echo "$RELEASE_BRANCHES" | tr ',' '\n' | xargs -n1 || true)
branches=$( { echo develop; echo main; echo "$releases"; } | sed '/^$/d' | sort -u )
arr=$(echo "$branches" | jq -R . | jq -s -c .)
fi
if [ "$(echo "$arr" | jq 'length')" -eq 0 ]; then
echo "::error::No branches resolved for publishing"
exit 1
fi
echo "branches=$arr" >> "$GITHUB_OUTPUT"
echo "Resolved branches: $arr"

config:
name: Load Config
runs-on: ubuntu-latest
outputs:
isaacsim_image_name: ${{ steps.load.outputs.isaacsim_image_name }}
isaacsim_image_tag: ${{ steps.load.outputs.isaacsim_image_tag }}
isaaclab_image_name: ${{ steps.load.outputs.isaaclab_image_name }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
sparse-checkout: .github/workflows/config.yaml
sparse-checkout-cone-mode: false
- id: load
run: |
set -euo pipefail
f=.github/workflows/config.yaml
echo "isaacsim_image_name=$(yq -r .isaacsim_image_name "$f")" >> "$GITHUB_OUTPUT"
echo "isaacsim_image_tag=$(yq -r .isaacsim_image_tag "$f")" >> "$GITHUB_OUTPUT"
echo "isaaclab_image_name=$(yq -r .isaaclab_image_name "$f")" >> "$GITHUB_OUTPUT"

build-and-push-images:
name: Build and Push (${{ matrix.branch }})
needs: [config, resolve-branches]
runs-on: [self-hosted, gpu]
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.resolve-branches.outputs.branches) }}
concurrency:
Comment thread
nvsekkin marked this conversation as resolved.
Resolved
group: publish-images-${{ matrix.branch }}
cancel-in-progress: true
environment:
name: postmerge-production
url: https://github.com/${{ github.repository }}
env:
DOCKER_HOST: unix:///var/run/docker.sock
DOCKER_TLS_CERTDIR: ""
Comment thread
nvsekkin marked this conversation as resolved.
Resolved

steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 1
lfs: true
ref: ${{ matrix.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
driver-opts: |
image=moby/buildkit:buildx-stable-1

- name: Login to NGC
run: |
# Only attempt NGC login if API key is available
if [ -n "${{ env.NGC_API_KEY }}" ]; then
echo "🔵 Logging into NGC registry..."
if ! docker login -u \$oauthtoken -p ${{ env.NGC_API_KEY }} nvcr.io; then
echo "🔴 Failed to log into NGC registry"
exit 1
fi
echo "🟢 Successfully logged into NGC registry"
else
echo "🟠 NGC_API_KEY not set - skipping NGC login (normal when secrets are not configured)"
fi

- name: Build and Push Docker Images
run: |
BRANCH_NAME="${{ matrix.branch }}"
IMAGE_BASE_VERSION="${{ needs.config.outputs.isaacsim_image_tag }}"
SHA="${{ github.sha }}"
IMAGE="${{ needs.config.outputs.isaaclab_image_name }}"

echo "Branch: $BRANCH_NAME"
echo "Commit: $SHA"
echo "IsaacSim base image: ${{ needs.config.outputs.isaacsim_image_name }}:$IMAGE_BASE_VERSION"
echo "Target Isaac Lab image: $IMAGE"

# Build the list of tags based on the branch.
#
# Tagging scheme:
# - develop: $IMAGE:latest-develop (moves to newest develop build)
# $IMAGE:latest-develop-<run#>-<sha-stub> (immutable per-build)
# - release/X: $IMAGE:latest-release-X (moves to newest build on that release branch)
# $IMAGE:latest-release-X-<run#>-<sha-stub> (immutable per-build)
# - main: $IMAGE:latest (moves to newest main build)
# $IMAGE:v<VERSION> (from the VERSION file, e.g. v3.0.0)
TAGS=()

case "$BRANCH_NAME" in
develop)
TAGS+=("$IMAGE:latest-develop")
TAGS+=("$IMAGE:latest-develop-${{ github.run_number }}-${SHA:0:8}")
;;
main)
TAGS+=("$IMAGE:latest")
VERSION="$(tr -d '[:space:]' < VERSION)"
if [ -n "$VERSION" ]; then
TAGS+=("$IMAGE:v$VERSION")
else
echo "🛑 ERROR: VERSION file is empty or missing. Cannot tag build with version tag."
exit 1
fi
;;
release/*)
# Sanitize the part after release/ for use as a Docker tag suffix.
RELEASE_SUFFIX=$(echo "${BRANCH_NAME#release/}" | sed 's/[^a-zA-Z0-9._-]/-/g')
TAGS+=("$IMAGE:latest-release-$RELEASE_SUFFIX")
TAGS+=("$IMAGE:latest-release-$RELEASE_SUFFIX-${{ github.run_number }}-${SHA:0:8}")
;;
*)
echo "Branch '$BRANCH_NAME' is not configured for publishing; skipping."
exit 0
;;
esac

# Determine if multiarch is supported by inspecting the base image manifest
echo "🔵 Checking if base image supports multiarch..."
BASE_IMAGE_FULL="${{ needs.config.outputs.isaacsim_image_name }}:${IMAGE_BASE_VERSION}"
ARCHITECTURES=$(docker manifest inspect "$BASE_IMAGE_FULL" 2>/dev/null | grep -o '"architecture": "[^"]*"' | cut -d'"' -f4 | sort -u)

if [ -z "$ARCHITECTURES" ]; then
echo "🟠 Could not inspect base image manifest: $BASE_IMAGE_FULL - defaulting to linux/amd64 only"
BUILD_PLATFORMS="linux/amd64"
else
echo "Base image architectures found:"
echo "$ARCHITECTURES" | sed 's/^/ - /'

HAS_AMD64=$(echo "$ARCHITECTURES" | grep -c "amd64" || true)
HAS_ARM64=$(echo "$ARCHITECTURES" | grep -c "arm64" || true)

if [ "$HAS_AMD64" -gt 0 ] && [ "$HAS_ARM64" -gt 0 ]; then
echo "🟢 Base image supports multiarch (amd64 + arm64)"
BUILD_PLATFORMS="linux/amd64,linux/arm64"
elif [ "$HAS_AMD64" -gt 0 ]; then
echo "Base image only supports amd64"
BUILD_PLATFORMS="linux/amd64"
elif [ "$HAS_ARM64" -gt 0 ]; then
echo "Base image only supports arm64"
BUILD_PLATFORMS="linux/arm64"
else
echo "🟠 Unknown architecture support for $BASE_IMAGE_FULL - defaulting to linux/amd64"
BUILD_PLATFORMS="linux/amd64"
fi
fi

echo "Target platforms: $BUILD_PLATFORMS"
echo "Tags to publish:"
printf ' - %s\n' "${TAGS[@]}"

# Compose -t flags for buildx
TAG_ARGS=()
for t in "${TAGS[@]}"; do
TAG_ARGS+=("-t" "$t")
done

echo "🔵 Building and pushing image with tags listed above..."
if ! docker buildx build \
--platform "$BUILD_PLATFORMS" \
--progress=plain \
"${TAG_ARGS[@]}" \
--build-arg ISAACSIM_BASE_IMAGE_ARG=${{ needs.config.outputs.isaacsim_image_name }} \
--build-arg ISAACSIM_VERSION_ARG="$IMAGE_BASE_VERSION" \
--build-arg ISAACSIM_ROOT_PATH_ARG=/isaac-sim \
--build-arg ISAACLAB_PATH_ARG=/workspace/isaaclab \
--build-arg DOCKER_USER_HOME_ARG=/root \
--cache-from type=gha \
--cache-to type=gha,mode=max \
-f docker/Dockerfile.base \
--push .; then
echo "🔴 docker buildx build/push failed for tags:"
printf ' - %s\n' "${TAGS[@]}"
exit 1
fi

for t in "${TAGS[@]}"; do
echo "🟢 Successfully built and pushed: $t (platforms: $BUILD_PLATFORMS)"
done
Loading