Skip to content

test: byoidc compatibility #1133

test: byoidc compatibility

test: byoidc compatibility #1133

name: UI notebooks tests
on:
pull_request:
branches: [ main ]
types: [ labeled, synchronize ]
concurrency:
group: ${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
KUEUE_VERSION: v0.13.4
KUBERAY_VERSION: v1.4.2
jobs:
verify-3_widget_example:
if: ${{ contains(github.event.pull_request.labels.*.name, 'test-guided-notebooks') || contains(github.event.pull_request.labels.*.name, 'test-ui-notebooks') }}
runs-on: ubuntu-latest-4core
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout common repo code
uses: actions/checkout@v4
with:
repository: "project-codeflare/codeflare-common"
ref: "main"
path: "common"
- name: Set up specific Python version
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip" # caching pip dependencies
- name: Setup and start KinD cluster
uses: ./common/github-actions/kind
- name: Deploy Kueue and KubeRay
id: deploy
run: |
# Install Kueue
echo "Installing Kueue ${KUEUE_VERSION}..."
kubectl apply --server-side -f https://github.com/kubernetes-sigs/kueue/releases/download/${KUEUE_VERSION}/manifests.yaml
kubectl wait --timeout=120s --for=condition=Available=true deployment -n kueue-system kueue-controller-manager
# Install KubeRay from opendatahub-io fork (has RHOAI features)
echo "Installing KubeRay ${KUBERAY_VERSION} from opendatahub-io..."
kubectl create -k "github.com/opendatahub-io/kuberay/ray-operator/config/default?ref=${KUBERAY_VERSION}"
kubectl wait --timeout=120s --for=condition=Available=true deployment kuberay-operator
# Create default Kueue resources for the tests
echo "Creating Kueue resources..."
kubectl apply -f - <<EOF
apiVersion: kueue.x-k8s.io/v1beta1
kind: ResourceFlavor
metadata:
name: default-flavor
---
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: cluster-queue
spec:
namespaceSelector: {}
resourceGroups:
- coveredResources: ["cpu", "memory", "nvidia.com/gpu"]
flavors:
- name: default-flavor
resources:
- name: cpu
nominalQuota: 100
- name: memory
nominalQuota: 100Gi
- name: nvidia.com/gpu
nominalQuota: 10
---
apiVersion: kueue.x-k8s.io/v1beta1
kind: LocalQueue
metadata:
name: local-queue
namespace: default
annotations:
kueue.x-k8s.io/default-queue: "true"
spec:
clusterQueue: cluster-queue
EOF
- name: Setup Guided notebooks execution
run: |
echo "Installing papermill and dependencies..."
pip install poetry ipython ipykernel
poetry config virtualenvs.create false
echo "Installing SDK..."
poetry install --with test,docs
- name: Install Yarn dependencies
run: |
poetry run yarn install
poetry run yarn playwright install chromium
working-directory: ui-tests
- name: Fix 3_widget_example.ipynb notebook for test
run: |
# Remove login/logout cells, as KinD doesn't support authentication using token
jq -r 'del(.cells[] | select(.source[] | contains("Create authentication object for user permissions")))' 3_widget_example.ipynb > 3_widget_example.ipynb.tmp && mv 3_widget_example.ipynb.tmp 3_widget_example.ipynb
jq -r 'del(.cells[] | select(.source[] | contains("auth.logout()")))' 3_widget_example.ipynb > 3_widget_example.ipynb.tmp && mv 3_widget_example.ipynb.tmp 3_widget_example.ipynb
# Set explicit namespace as SDK need it (currently) to resolve local queues
sed -i "s|head_memory_limits=8,|head_memory_limits=8, namespace='default',|" 3_widget_example.ipynb
sed -i "s|view_clusters()|view_clusters('default')|" 3_widget_example.ipynb
working-directory: demo-notebooks/guided-demos
- name: Run UI notebook tests
run: |
set -euo pipefail
poetry run yarn test
working-directory: ui-tests
- name: Upload Playwright Test assets
if: always()
uses: actions/upload-artifact@v4
with:
name: ipywidgets-test-assets
path: |
ui-tests/test-results
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v4
with:
name: ipywidgets-test-report
path: |
ui-tests/playwright-report