Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk tests with papermill #2448

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 28 additions & 0 deletions .github/workflows/sdk-e2e-tests-with-papermill.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: E2E Tests with Notebooks

on:
push: {}
pull_request: {}
workflow_dispatch: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test Notebook
uses: ./.github/workflows/template-e2e-notebook-test
with:
python-version: ${{ matrix.python-version }}
notebook-input: "examples/v1beta1/sdk/cmaes-and-resume-policies.ipynb,examples/v1beta1/sdk/tune-train-from-func.ipynb"
54 changes: 54 additions & 0 deletions .github/workflows/template-e2e-notebook-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Notebook test template
description: A composite action to setup and run example notebooks using Papermill

inputs:
python-version:
required: false
description: Python version
default: "3.9"
notebook-input:
description: 'List of paths to the input notebooks, separated by commas'
required: true

runs:
using: composite
steps:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install papermill kubeflow-katib jupyter ipykernel
python -m ipykernel install --user --name python3 --display-name "Python 3"

- name: Setup Minikube Cluster
uses: medyagh/[email protected]
with:
network-plugin: cni
cni: flannel
driver: none
kubernetes-version: v1.29.2
minikube-version: 1.34.0
start-args: --wait-timeout=120s

- name: Setup Minikube
shell: bash
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh true true "" "" "cmaes"

- name: Setup Katib
shell: bash
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh true true postgres

- name: Run Jupyter Notebook with Papermill
shell: bash
run: |
IFS=',' read -r -a NOTEBOOK_ARRAY <<< "${{ inputs.notebook-input }}"
for NOTEBOOK in "${NOTEBOOK_ARRAY[@]}"; do
echo "Running notebook: $NOTEBOOK"
./test/e2e/v1beta1/scripts/gh-actions/run-notebook.sh -i "$NOTEBOOK" -n kubeflow
done
Loading