-
Notifications
You must be signed in to change notification settings - Fork 456
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
base: master
Are you sure you want to change the base?
Sdk tests with papermill #2448
Changes from 20 commits
79a27bd
0b44b8f
6237428
113d8dd
cc17690
e074c65
4fb0f37
ffa1c59
fedcf05
b7fa3ca
9560840
d69a29f
abadb73
885ba39
6633aa5
dc0221e
d32d4a1
a548c67
45ffbad
6360029
4d332cc
5076f8b
71ed401
ea44cdf
dd45944
7d4bff3
2c0ce60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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-latest | ||
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" |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||||||||||||||||||
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" | ||||||||||||||||||||||
papermill-args-yaml: | ||||||||||||||||||||||
description: 'Additional arguments to pass to Papermill in yaml format' | ||||||||||||||||||||||
required: false | ||||||||||||||||||||||
default: "" | ||||||||||||||||||||||
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 | ||||||||||||||||||||||
shell: bash | ||||||||||||||||||||||
run: ./test/e2e/v1beta1/scripts/gh-actions/setup-minikube.sh true true "" "" "cmaes" | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need to create minikube cluster between these two steps? katib/.github/workflows/template-setup-e2e-test/action.yaml Lines 39 to 48 in 2b41ae6
|
||||||||||||||||||||||
|
||||||||||||||||||||||
- 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 }}" | ||||||||||||||||||||||
# Loop through each notebook path | ||||||||||||||||||||||
for NOTEBOOK in "${NOTEBOOK_ARRAY[@]}"; do | ||||||||||||||||||||||
OUTPUT_FILE="${NOTEBOOK%.ipynb}_output.ipynb" | ||||||||||||||||||||||
echo "Running notebook: $NOTEBOOK" | ||||||||||||||||||||||
papermill "$NOTEBOOK" "$OUTPUT_FILE" --log-output --kernel python3 --parameters_yaml "${{ inputs.papermill-args-yaml }}" || { | ||||||||||||||||||||||
echo "Papermill failed for notebook: $NOTEBOOK" | ||||||||||||||||||||||
exit 1 | ||||||||||||||||||||||
} | ||||||||||||||||||||||
done |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -671,4 +671,4 @@ | |||||||
}, | ||||||||
"nbformat": 4, | ||||||||
"nbformat_minor": 4 | ||||||||
} | ||||||||
} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we didn't pass parameters to these two notebook examples. Not sure if it meets our requirements
cc👀 @andreyvelich @tenzen-y @yehudit1987