Skip to content
Merged
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
12 changes: 12 additions & 0 deletions .agents/skills/openshell-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@ output. Use `provider refresh rotate`, reconfigure refresh, or delete refresh
before returning those keys to manual management. Unrelated provider fields
remain updateable.

When OAuth refresh fails, inspect the `RECOVERY` and `FAILURE_CODE` columns from
`provider refresh status`; do not infer the remedy from HTTP status or parse
`LAST_ERROR`. `retry` means the worker will try again, `reauthorize` means the
user must obtain a new OAuth grant and run `provider refresh configure`,
`fix_configuration` means an operator must repair the OAuth client, scopes, or
administrator policy, and `investigate` means the issuer returned an
unrecognized response. The gateway parks `reauthorize` records until a manual
rotate or reconfiguration. It retries
`fix_configuration` records hourly so externally repaired configuration can
recover without rapid token-endpoint traffic. The existing access credential
remains usable only until its recorded expiry.

---

## Workflow 3: Sandbox Lifecycle
Expand Down
24 changes: 23 additions & 1 deletion .agents/skills/sbom/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,37 @@ Generate CycloneDX SBOMs, resolve missing licenses, and export to CSV for compli

## Overview

The OpenShell SBOM tooling produces CycloneDX JSON SBOMs using Syft, resolves missing or hash-based licenses by querying public registries (crates.io, npm, PyPI), and exports the results to CSV for stakeholder review.
The OpenShell SBOM tooling produces source-tree CycloneDX JSON SBOMs using Syft, resolves missing or hash-based licenses by querying public registries (crates.io, npm, PyPI), and exports the results to CSV for stakeholder review.

SBOMs are **release artifacts only** -- they are generated on demand and not committed to the repository. Output lands in `deploy/sbom/output/` (gitignored).

Release Dev and Release Tag image builds separately embed cargo-auditable metadata in the staged gateway and supervisor binaries. This metadata describes the binary's Rust dependency graph and lets Syft discover Cargo packages from the binary itself. It is not a complete image SBOM and is not an OCI SBOM attestation; publishing such an attestation remains separate work.

## Prerequisites

- `mise install` has been run (installs Syft and other tools)
- The repository is checked out at the root

## Inspecting an Auditable Image Binary

Opt into auditable metadata when staging a local image binary:

```bash
OPENSHELL_AUDITABLE=1 PREBUILT_ARCH=amd64 \
tasks/scripts/stage-prebuilt-binaries.sh gateway
```

Scan the staged binary rather than the source tree:

```bash
mise x -- syft \
"file:deploy/docker/.build/prebuilt-binaries/amd64/openshell-gateway" \
-o cyclonedx-json
```

This output is limited to packages Syft discovers from that binary. Use
`mise run sbom` for the broader source-tree license-compliance inventory.

## Workflow 1: Full SBOM Generation (One Command)

```bash
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ on:
required: false
type: string
default: ""
auditable:
description: "Embed cargo-auditable dependency metadata in image binaries"
required: false
type: boolean
default: false
image-tag:
description: "Image tag base to build/push (defaults to the GitHub SHA)"
required: false
Expand Down Expand Up @@ -177,6 +182,7 @@ jobs:
image-tag: ${{ needs.resolve.outputs.image_tag_base }}
checkout-ref: ${{ inputs['checkout-ref'] }}
features: ${{ needs.resolve.outputs.features }}
auditable: ${{ inputs.auditable }}
artifact-name: ${{ needs.resolve.outputs.artifact_prefix }}-linux-${{ matrix.arch }}
secrets: inherit

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ jobs:
podman_package_version: "5.7.0+ds2-3build1"
conmon_package_version: "2.1.13+ds1-2"
cmd: "env -u OPENSHELL_GATEWAY_BIN mise run --no-deps --skip-deps e2e:podman:external-driver"
- suite: provider-refresh-keycloak
runner: ubuntu-26.04
podman_major: "5"
podman_package_version: "5.7.0+ds2-3build1"
conmon_package_version: "2.1.13+ds1-2"
cmd: "mise run --no-deps --skip-deps e2e:provider-refresh-keycloak"
env:
IMAGE_TAG: ${{ inputs.image-tag }}
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -197,6 +203,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
apparmor \
build-essential \
clang \
fuse-overlayfs \
Expand All @@ -219,6 +226,20 @@ jobs:
echo "/usr/bin" >> "${GITHUB_PATH}"
echo "CONTAINERS_CONF_OVERRIDE=${podman_config}" >> "${GITHUB_ENV}"

- name: Allow pasta to receive Podman stop signals
# Ubuntu's packaged pasta profile currently blocks this signal, forcing
# Podman to wait for its SIGKILL fallback. Keep this narrow allowance
# until the distribution package includes the upstream profile fix.
run: |
set -euo pipefail
profile=/etc/apparmor.d/usr.bin.pasta
rule=' signal (receive) peer=podman,'
if ! sudo grep -Fqx "${rule}" "${profile}"; then
sudo sed -i '\|^ include <abstractions/pasta>$|a\ signal (receive) peer=podman,' "${profile}"
fi
sudo grep -Fqx "${rule}" "${profile}"
sudo apparmor_parser --replace "${profile}"

- name: Configure rootless Podman
run: |
set -euo pipefail
Expand Down Expand Up @@ -279,6 +300,17 @@ jobs:
if: always()
run: sudo dmesg | grep -E 'apparmor=.*DENIED|profile="unprivileged_userns"' | tail -100 || true

- name: Fail on pasta SIGTERM AppArmor denial
if: always()
run: |
set -euo pipefail
denials="$(sudo dmesg | grep -E 'profile="pasta".*requested_mask="receive".*signal=term.*peer="podman"' || true)"
if [ -n "${denials}" ]; then
echo "::error::pasta denied Podman's SIGTERM; Podman will use its SIGKILL fallback"
printf '%s\n' "${denials}"
exit 1
fi

e2e-vm:
name: E2E (rust-vm-${{ matrix.suite }})
# libkrun needs KVM, so this job must run directly on a GitHub-hosted
Expand Down
121 changes: 27 additions & 94 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ jobs:
with:
component: gateway
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
auditable: true

build-supervisor:
needs: [compute-versions]
uses: ./.github/workflows/docker-build.yml
with:
component: supervisor
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
auditable: true

e2e:
needs: [build-gateway, build-supervisor]
Expand Down Expand Up @@ -99,91 +101,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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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 @@ -193,13 +128,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 @@ -683,7 +618,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 @@ -713,18 +648,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 @@ -763,27 +690,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 @@ -824,12 +753,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 @@ -881,9 +809,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