Repository navigation
Add CI #22
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
Merged
Add CI #22
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
338ed77
Add automatic test for dataset upload and processing
PGijsbers 40a6502
Add scripts to test creating tasks and task splits
PGijsbers deb46c0
Add CI tests for dataset and task processing
PGijsbers 0f78f0a
Move checkout outside of action, otherwise it can't be found
PGijsbers 281fdb4
Remove timeout directive as it's not allowed in comp actions
PGijsbers cdb2292
Set permissions to allow containers to use the mounted volumes
PGijsbers 3eb2a21
Print body on error
PGijsbers 489cc1c
Start working on run evaluation check
PGijsbers f593240
Merge branch 'main' into CI
PGijsbers 047c24c
Use correct identifier to extract run ID
PGijsbers 3e92332
remove unused file
PGijsbers c88cd03
show errors for curl
PGijsbers 3a55ba1
Mention the new test scripts in the README
PGijsbers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Start Services | ||
| description: Start Docker Compose services | ||
|
|
||
| inputs: | ||
| profiles: | ||
| description: "Comma-separated list of profiles to start (e.g. 'all' or 'rest-api,minio')" | ||
| required: false | ||
| default: "all" | ||
| services: | ||
| description: "Comma-separated list of specific services to start (e.g. 'database,elasticsearch')" | ||
| required: false | ||
| default: "" | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set permission for mount paths | ||
| shell: bash | ||
| run: | | ||
| chmod -R 777 ./data/php | ||
| chmod -R 777 ./logs | ||
| - name: Start services | ||
| shell: bash | ||
| run: | | ||
| PROFILE_FLAGS="" | ||
| for profile in $(echo "${{ inputs.profiles }}" | tr ',' ' '); do | ||
| PROFILE_FLAGS="$PROFILE_FLAGS --profile $profile" | ||
| done | ||
| SERVICES=$(echo "${{ inputs.services }}" | tr ',' ' ') | ||
| docker compose $PROFILE_FLAGS up -d --build --wait $SERVICES | ||
|
|
||
| - name: Show service status | ||
| if: always() | ||
| shell: bash | ||
| run: docker compose ps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Integration Test | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "docker-compose.yaml" | ||
| - "scripts/**" | ||
| - "config/**" | ||
|
|
||
| jobs: | ||
| dataset-processing: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Start services | ||
| uses: ./.github/actions/start-services | ||
| with: | ||
| profiles: "rest-api,evaluation-engine" | ||
|
|
||
| - name: Create dataset | ||
| id: dataset | ||
| run: | | ||
| DATASET_ID=$(bash scripts/upload_dataset.sh) | ||
| echo "Dataset ID: $DATASET_ID" | ||
| echo "id=$DATASET_ID" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Dataset Processing | ||
| run: bash scripts/wait_for_dataset.sh "${{ steps.dataset.outputs.id }}" 180 | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: docker compose logs --tail=50 | ||
|
|
||
| task-processing: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Start services | ||
| uses: ./.github/actions/start-services | ||
| with: | ||
| profiles: "rest-api,evaluation-engine" | ||
|
|
||
| - name: Create task | ||
| id: task | ||
| run: | | ||
| TASK_ID=$(bash scripts/create_task.sh 129 1) | ||
| echo "Task ID: $TASK_ID" | ||
| echo "id=$TASK_ID" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Task Processing | ||
| run: bash scripts/wait_for_task.sh "${{ steps.task.outputs.id }}" 180 | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: docker compose logs --tail=50 | ||
|
|
||
| run-processing: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Start services | ||
| uses: ./.github/actions/start-services | ||
| with: | ||
| profiles: "rest-api,evaluation-engine" | ||
|
|
||
| - name: Upload run | ||
| id: run | ||
| run: | | ||
| RUN_ID=$(bash scripts/upload_run.sh) | ||
| echo "Run ID: $RUN_ID" | ||
| echo "id=$RUN_ID" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Run Processing | ||
|
josvandervelde marked this conversation as resolved.
|
||
| run: bash scripts/wait_for_run.sh "${{ steps.run.outputs.id }}" 180 | ||
|
|
||
| - name: Show logs on failure | ||
| if: failure() | ||
| run: docker compose logs --tail=50 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/bin/bash | ||
| # Creates a task for a given dataset and estimation procedure, prints the task ID to stdout. | ||
| # Usage: create_task.sh DATASET_ID ESTIMATION_PROCEDURE_ID [TARGET_FEATURE] | ||
| set -euo pipefail | ||
|
|
||
| DATASET_ID="${1:?Usage: create_task.sh DATASET_ID ESTIMATION_PROCEDURE_ID [TARGET_FEATURE]}" | ||
| ESTIMATION_PROCEDURE_ID="${2:?Usage: create_task.sh DATASET_ID ESTIMATION_PROCEDURE_ID [TARGET_FEATURE]}" | ||
| TARGET_FEATURE="${3:-class}" | ||
|
|
||
| TMPFILE=$(mktemp /tmp/task_desc.XXXXXX.xml) | ||
| trap 'rm -f "$TMPFILE"' EXIT | ||
|
|
||
| cat > "$TMPFILE" << EOF | ||
| <oml:task_inputs xmlns:oml="http://openml.org/openml"> | ||
| <oml:task_type_id>1</oml:task_type_id> | ||
| <oml:input name="source_data">${DATASET_ID}</oml:input> | ||
| <oml:input name="estimation_procedure">${ESTIMATION_PROCEDURE_ID}</oml:input> | ||
| <oml:input name="target_feature">${TARGET_FEATURE}</oml:input> | ||
| </oml:task_inputs> | ||
| EOF | ||
|
|
||
| RESPONSE=$(curl -sS -X POST "http://localhost:8000/api/v1/xml/task?api_key=normaluser" \ | ||
| -F "description=@${TMPFILE};type=text/xml") | ||
|
|
||
| TASK_ID=$(echo "$RESPONSE" | sed -n 's/.*<oml:id>\([0-9]*\)<\/oml:id>.*/\1/p') | ||
|
|
||
| if [ -z "$TASK_ID" ]; then | ||
| echo "Server response:" >&2 | ||
| echo "$RESPONSE" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "$TASK_ID" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.