Skip to content
Draft
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
119 changes: 25 additions & 94 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,91 +95,24 @@ jobs:
"${REGISTRY}/${component}:${{ github.sha }}"
done

build-python-wheels-linux:
name: Build Python Wheels (Linux ${{ matrix.arch }})
needs: [compute-versions]
strategy:
matrix:
include:
- arch: amd64
runner: linux-amd64-cpu8
artifact: linux-amd64
task: python:build:linux:amd64
output_path: target/wheels/linux-amd64/*.whl
- arch: arm64
runner: linux-arm64-cpu8
artifact: linux-arm64
task: python:build:linux:arm64
output_path: target/wheels/linux-arm64/*.whl
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_IMAGE_TAG: dev
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Sync Python dependencies
run: uv sync

- name: Cache Rust target and registry
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: python-wheel-linux-${{ matrix.arch }}
cache-directories: .cache/sccache
cache-targets: "true"

- name: Build Python wheels
run: |
set -euo pipefail
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run ${{ matrix.task }}
ls -la ${{ matrix.output_path }}

- name: Upload wheel artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: python-wheels-${{ matrix.artifact }}
path: ${{ matrix.output_path }}
retention-days: 5

build-python-wheel-macos:
name: Build Python Wheel (macOS)
build-python-wheel:
name: Build Python Wheel
needs: [compute-versions]
runs-on: linux-amd64-cpu8
timeout-minutes: 120
timeout-minutes: 20
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENSHELL_IMAGE_TAG: dev
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL: ${{ needs.compute-versions.outputs.python_version }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0

- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Set up Docker Buildx
uses: ./.github/actions/setup-buildx

- name: Mark workspace safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

Expand All @@ -189,13 +122,13 @@ jobs:
- name: Build Python wheel
run: |
set -euo pipefail
OPENSHELL_CARGO_VERSION="${{ needs.compute-versions.outputs.cargo_version }}" mise run python:build:macos
mise run python:build
ls -la target/wheels/*.whl

- name: Upload wheel artifacts
- name: Upload wheel artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: python-wheels-macos
name: python-wheel
path: target/wheels/*.whl
retention-days: 5

Expand Down Expand Up @@ -679,7 +612,7 @@ jobs:

smoke-linux-dev-artifacts:
name: Smoke Linux Dev Artifacts (${{ matrix.name }})
needs: [build-gateway-binary-linux, build-driver-vm-linux, build-deb, build-rpm, build-python-wheels-linux]
needs: [build-gateway-binary-linux, build-driver-vm-linux, build-deb, build-rpm, build-python-wheel]
timeout-minutes: 20
strategy:
fail-fast: false
Expand Down Expand Up @@ -709,18 +642,10 @@ jobs:
kind: rpm
artifact_arch: arm64
rpm_arch: aarch64
- name: python-wheel-amd64
- name: python-wheel
runner: linux-amd64-cpu8
image: python:3.12-slim
kind: wheel
artifact_arch: amd64
rpm_arch: x86_64
- name: python-wheel-arm64
runner: linux-arm64-cpu8
image: python:3.12-slim
kind: wheel
artifact_arch: arm64
rpm_arch: aarch64
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image }}
Expand Down Expand Up @@ -759,27 +684,29 @@ jobs:
if: matrix.kind == 'wheel'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python-wheels-linux-${{ matrix.artifact_arch }}
name: python-wheel
path: wheel-input/

- name: Smoke Python wheel
if: matrix.kind == 'wheel'
run: |
set -euo pipefail
pip install --no-cache-dir wheel-input/*.whl
python - <<'PY'
python -m venv /tmp/openshell-wheel-smoke
/tmp/openshell-wheel-smoke/bin/pip install --no-cache-dir wheel-input/*.whl
/tmp/openshell-wheel-smoke/bin/python - <<'PY'
import importlib
for name in ("openshell", "openshell._proto", "openshell.sandbox"):
importlib.import_module(name)
print(name, "OK")
PY
test ! -e /tmp/openshell-wheel-smoke/bin/openshell

# ---------------------------------------------------------------------------
# Create / update the dev GitHub Release with CLI, gateway, driver, and wheels
# ---------------------------------------------------------------------------
release-dev:
name: Release Dev
needs: [compute-versions, build-cli-linux, build-cli-macos, build-gateway-binary-linux, build-gateway-binary-macos, build-supervisor-binary-linux, build-python-wheels-linux, build-python-wheel-macos, e2e, build-driver-vm-linux, build-driver-vm-macos, build-deb, build-rpm, build-snap, smoke-linux-dev-artifacts]
needs: [compute-versions, build-cli-linux, build-cli-macos, build-gateway-binary-linux, build-gateway-binary-macos, build-supervisor-binary-linux, build-python-wheel, e2e, build-driver-vm-linux, build-driver-vm-macos, build-deb, build-rpm, build-snap, smoke-linux-dev-artifacts]
runs-on: linux-amd64-cpu8
timeout-minutes: 10
permissions:
Expand Down Expand Up @@ -820,12 +747,11 @@ jobs:
path: release/
merge-multiple: true

- name: Download wheel artifacts
- name: Download wheel artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: python-wheels-*
name: python-wheel
path: release/
merge-multiple: true

- name: Download Debian package artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
Expand Down Expand Up @@ -877,9 +803,14 @@ jobs:
id: wheel_filenames
run: |
set -euo pipefail
ls -la release/*.whl
WHEEL_FILENAMES=$(ls release/*.whl | xargs -n1 basename | sort | paste -sd, -)
echo "wheel_filenames=${WHEEL_FILENAMES}" >> "$GITHUB_OUTPUT"
shopt -s nullglob
wheels=(release/*.whl)
if [ "${#wheels[@]}" -ne 1 ]; then
echo "expected exactly one Python wheel, found ${#wheels[@]}" >&2
exit 1
fi
wheel_filename=$(basename "${wheels[0]}")
echo "wheel_filenames=${wheel_filename}" >> "$GITHUB_OUTPUT"

- name: Generate checksums
run: |
Expand Down
Loading
Loading