Files
2026-07-13 13:05:14 +08:00

93 lines
3.0 KiB
YAML

# TODO(#9304): make the notebook export work
name: Reusable Build and Upload Notebook
on:
workflow_call:
inputs:
CONCURRENCY:
required: true
type: string
WHEEL_ARTIFACT_NAME:
required: false
type: string
default: ""
concurrency:
group: ${{ inputs.CONCURRENCY }}-run-notebook
cancel-in-progress: true
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
permissions:
contents: "read"
id-token: "write"
packages: "read"
jobs:
run-notebook:
name: Run notebook
runs-on: ubuntu-latest-16-cores # Note that as of writing we need the additional storage page (14 gb of the ubuntu-latest runner is not enough).
container:
image: ghcr.io/rerun-io/ci_docker:0.18.0 # Required to run the wheel or we get "No matching distribution found for attrs>=23.1.0" during `pip install rerun-sdk`
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Download Wheel
uses: actions/download-artifact@v4
with:
name: ${{ inputs.WHEEL_ARTIFACT_NAME }}
path: wheel
- name: Download Notebook Wheel
uses: actions/download-artifact@v4
with:
name: rerun_notebook_wheel
path: wheel
- name: Get version
id: get-version
run: |
pixi run 'echo "wheel_version=$(python scripts/ci/crates.py get-version)"' >> "$GITHUB_OUTPUT"
- name: Install built wheel
run: |
pixi run python scripts/ci/uv_install_wheel.py --package rerun-sdk --dir wheel
pixi run python scripts/ci/uv_install_wheel.py --package rerun-notebook --dir wheel --platform-independent
- name: Install Deps
run: pixi run uv pip install -r examples/python/notebook/requirements.txt
- name: Create notebook
run: pixi run uv jupyter nbconvert --to=html --ExecutePreprocessor.enabled=True examples/python/notebook/cube.ipynb --output /tmp/cube.html
- id: "auth"
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
- name: Get sha
id: get-sha
run: |
full_commit="${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha }}"
echo "sha=$(echo $full_commit | cut -c1-7)" >> "$GITHUB_OUTPUT"
- name: "Upload Notebook"
uses: google-github-actions/upload-cloud-storage@v3
with:
path: "/tmp/cube.html"
destination: "rerun-builds/commit/${{ steps.get-sha.outputs.sha }}/notebooks"
parent: false
process_gcloudignore: false