Skip to content

Commit

Permalink
sdk tests with papermill
Browse files Browse the repository at this point in the history
Signed-off-by: Yehudit Kerido <[email protected]>
  • Loading branch information
Yehudit Kerido committed Feb 17, 2025
1 parent 683608f commit c3c4faa
Show file tree
Hide file tree
Showing 9 changed files with 2,033 additions and 147 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/sdk-e2e-tests-with-papermill.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
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"]
kubernetes-version: [ "v1.29.2", "v1.30.7", "v1.31.3" ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test Notebook
uses: ./.github/workflows/template-e2e-notebook-test
- name: Setup Test Env
uses: ./.github/workflows/template-setup-e2e-test
with:
kubernetes-version: ${{ matrix.kubernetes-version }}

- name: Run e2e test for notebooks with papermill
uses: ./.github/workflows/template-e2e-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"
notebook-input: "examples/v1beta1/sdk/cmaes-and-resume-policies.ipynb,examples/v1beta1/sdk/tune-train-from-func.ipynb"
tune-api: true
katib-ui: true
training-operator: true
algorithms: cmaes
trial-images: '""'
experiments: '""'
database-type: postgres
54 changes: 0 additions & 54 deletions .github/workflows/template-e2e-notebook-test/action.yaml

This file was deleted.

27 changes: 24 additions & 3 deletions .github/workflows/template-e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,44 @@ inputs:
required: true
description: whether to execute tune-api test or not
default: false
notebook-input:
description: List of paths to the input notebooks, separated by commas
required: false
default: ""
algorithms:
description: algorythm for image suggestion
required: false
default: ""

runs:
using: composite
steps:
- name: Setup Minikube Cluster
shell: bash
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh ${{ inputs.katib-ui }} ${{ inputs.tune-api }} ${{ inputs.trial-images }} ${{ inputs.experiments }}
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh ${{ inputs.katib-ui }} ${{ inputs.tune-api }} ${{ inputs.trial-images }} ${{ inputs.experiments }} ${{ inputs.algorithms }}

- name: Setup Katib
shell: bash
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-katib.sh ${{ inputs.katib-ui }} ${{ inputs.training-operator }} ${{ inputs.database-type }}

- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install papermill jupyter ipykernel
python -m ipykernel install --user --name python3 --display-name "Python 3"
- name: Run E2E Experiment
shell: bash
run: |
if "${{ inputs.tune-api }}"; then
if [[ -n "${{ inputs.notebook-input }}" ]]; then
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
elif "${{ inputs.tune-api }}"; then
./test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.sh
else
./test/e2e/v1beta1/scripts/gh-actions/run-e2e-experiment.sh ${{ inputs.experiments }}
fi
fi
Loading

0 comments on commit c3c4faa

Please sign in to comment.