-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1461 from dodona-edu/feature/enhanced-docker
Enhance self-hosting support with prebuilt docker images
- Loading branch information
Showing
12 changed files
with
169 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 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,58 @@ | ||
name: Validation | ||
on: | ||
push: | ||
branches: [main] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
install-cli: | ||
name: "Install and run CLI on ${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-14 | ||
- macos-13 | ||
- ubuntu-latest | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Setup Node 📚 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
|
||
- name: Install dolos | ||
shell: bash | ||
run: | | ||
npm install -g @dodona/dolos | ||
dolos --version | ||
- name: Prepare analysis | ||
run: | | ||
wget https://dolos.ugent.be/simple-dataset.zip | ||
- name: Run analysis on samples | ||
run: | | ||
dolos simple-dataset.zip | ||
self-hosting: | ||
name: "Test docker-compose for self-hosting Dolos web app" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run test script | ||
run: ./test_compose.sh | ||
|
||
packaging: | ||
name: "Test packing and installing Dolos" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run test script | ||
run: ./test_package.sh |
This file contains 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 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 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 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 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 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 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 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,46 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
|
||
# This script tests whether self-hosting the Dolos web-app works using the docker-compose.yml | ||
|
||
docker compose --progress quiet down | ||
docker compose --progress quiet pull | ||
docker pull ghcr.io/dodona-edu/dolos-cli:latest | ||
docker compose up --wait --detach | ||
|
||
echo "Upload zipfile" | ||
|
||
report_url="$( | ||
curl -s --fail \ | ||
--form "dataset[name]=Example" \ | ||
--form "dataset[zipfile]=@./samples/javascript/simple-dataset.zip" \ | ||
http://localhost:3000/reports \ | ||
| jq -r '.url' | ||
)" | ||
|
||
|
||
echo "Polling $report_url until finished or failed" | ||
|
||
while sleep 1; do | ||
report_json="$(curl -s --fail "$report_url")" | ||
report_status="$(printf "%s" "$report_json" | jq -r '.status')" | ||
echo "Status is '$report_status'" | ||
case "$report_status" in | ||
"queued" | "running") | ||
;; | ||
"finished") | ||
break | ||
;; | ||
*) | ||
echo "Something went wrong:" | ||
echo "$report_json" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
curl -s --location --fail "$report_url/data/pairs.csv" | ||
|
||
echo "Everything is working as expected" | ||
|
||
docker compose down |
This file contains 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 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