From a2b9b2eb2cc6699fa508550571026d41906bc40d Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Mon, 3 Nov 2025 16:49:20 +0100 Subject: [PATCH 01/11] add aas-test-engines job --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f45ee611..6fa0461b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -323,7 +323,7 @@ jobs: docker build -t basyx-python-server -f Dockerfile .. - name: Run container run: | - docker run -d --name basyx-python-server basyx-python-server + docker run -d -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server - name: Wait for container and server initialization run: | timeout 30s bash -c ' @@ -338,3 +338,54 @@ jobs: run: | docker stop basyx-python-server && docker rm basyx-python-server + server-aas-test-engines: + # This job checks if our server is compliant + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./server + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ env.X_PYTHON_MIN_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.X_PYTHON_MIN_VERSION }} + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install aas-test-engines + - name: Prepare test data + run: | + mkdir -p input + PKG_DIR=$(python -c "import os, aas_test_engines; print(os.path.dirname(aas_test_engines.__file__))") + cp "$PKG_DIR/bin/check_servers/test_data/TestDataWithThumbnail.aasx" input/ + - name: Build the Docker image + run: | + docker build -t basyx-python-server -f Dockerfile .. + - name: Run container + run: | + docker run -d -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server + - name: Wait for container and server initialization + run: | + timeout 30s bash -c ' + until docker logs basyx-python-server 2>&1 | grep -q "INFO success: quit_on_failure entered RUNNING state"; do + sleep 2 + done + ' + - name: Check if container is running + run: | + docker inspect --format='{{.State.Running}}' basyx-python-server | grep true + - name: Run AAS Test Engines compliance check + run: | + aas_test_engines check_server \ + http://localhost:8080/api/v3.0 \ + https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 \ + --output html > result.html + - name: Show test results + if: always() + run: | + cat result.html + - name: Stop and remove the container + if: always() + run: | + docker stop basyx-python-server && docker rm basyx-python-server \ No newline at end of file From c5b24ed2901dca237e348b5de81c7c9cca779cbc Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 09:38:51 +0100 Subject: [PATCH 02/11] fix test data preparation --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fa0461b..70bf3a75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -356,9 +356,9 @@ jobs: pip install aas-test-engines - name: Prepare test data run: | - mkdir -p input - PKG_DIR=$(python -c "import os, aas_test_engines; print(os.path.dirname(aas_test_engines.__file__))") - cp "$PKG_DIR/bin/check_servers/test_data/TestDataWithThumbnail.aasx" input/ + mkdir -p input + wget -O input/TestDataWithThumbnail.aasx \ + https://raw.githubusercontent.com/admin-shell-io/aas-test-engines/main/bin/check_servers/test_data/TestDataWithThumbnail.aasx - name: Build the Docker image run: | docker build -t basyx-python-server -f Dockerfile .. From 9b698e2a69cdffeaf6c792d52e352bbffbfddbf0 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 09:43:33 +0100 Subject: [PATCH 03/11] fix server port --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70bf3a75..c99fb107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -364,7 +364,7 @@ jobs: docker build -t basyx-python-server -f Dockerfile .. - name: Run container run: | - docker run -d -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server + docker run -d -p 8080:80 -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server - name: Wait for container and server initialization run: | timeout 30s bash -c ' From 997d3196850346e7e558b70acb10d05bead051c1 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:00:08 +0100 Subject: [PATCH 04/11] check if server is ready --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c99fb107..55e40b5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -372,6 +372,7 @@ jobs: sleep 2 done ' + sleep 5 - name: Check if container is running run: | docker inspect --format='{{.State.Running}}' basyx-python-server | grep true From bda8a33fd9bcf619d5b0f46d95cfb3f2a1dddfca Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:07:01 +0100 Subject: [PATCH 05/11] check if server is ready --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55e40b5c..e39d5409 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -372,7 +372,7 @@ jobs: sleep 2 done ' - sleep 5 + sleep 8 - name: Check if container is running run: | docker inspect --format='{{.State.Running}}' basyx-python-server | grep true From c6fa63403ce62cd9dd0ea49d2c4d5f95d36a02b4 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:11:37 +0100 Subject: [PATCH 06/11] check if server is ready --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e39d5409..ae4583ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -364,7 +364,7 @@ jobs: docker build -t basyx-python-server -f Dockerfile .. - name: Run container run: | - docker run -d -p 8080:80 -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server + docker run -d -p 8081:80 -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server - name: Wait for container and server initialization run: | timeout 30s bash -c ' @@ -372,14 +372,13 @@ jobs: sleep 2 done ' - sleep 8 - name: Check if container is running run: | docker inspect --format='{{.State.Running}}' basyx-python-server | grep true - name: Run AAS Test Engines compliance check run: | aas_test_engines check_server \ - http://localhost:8080/api/v3.0 \ + http://localhost:8081/api/v3.0 \ https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 \ --output html > result.html - name: Show test results From 7a9aa6bb5fa07e92fd9a977e377018e08894adc8 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:31:55 +0100 Subject: [PATCH 07/11] correct test data --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae4583ad..8a4a579e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -357,8 +357,8 @@ jobs: - name: Prepare test data run: | mkdir -p input - wget -O input/TestDataWithThumbnail.aasx \ - https://raw.githubusercontent.com/admin-shell-io/aas-test-engines/main/bin/check_servers/test_data/TestDataWithThumbnail.aasx + curl -L -o input/TestDataWithThumbnail.aasx \ + https://media.githubusercontent.com/media/admin-shell-io/aas-test-engines/main/bin/check_servers/test_data/TestDataWithThumbnail.aasx - name: Build the Docker image run: | docker build -t basyx-python-server -f Dockerfile .. From 391bcbe782784466a5e21b322fb44e86461a1c11 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:44:19 +0100 Subject: [PATCH 08/11] upload result artifact --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a4a579e..98d9b0da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -381,10 +381,12 @@ jobs: http://localhost:8081/api/v3.0 \ https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 \ --output html > result.html - - name: Show test results + - name: Upload test results as artifact if: always() - run: | - cat result.html + uses: actions/upload-artifact@v4 + with: + name: aas-test-results + path: result.html - name: Stop and remove the container if: always() run: | From 104580c48926deba06c91cd06bbcdd97ae58a5ba Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Tue, 4 Nov 2025 10:51:19 +0100 Subject: [PATCH 09/11] upload result artifact --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98d9b0da..7d9563e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,7 +386,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: aas-test-results - path: result.html + path: ./server/result.html - name: Stop and remove the container if: always() run: | From ac2873609e000d94fba4d2ecddc048e09779631c Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Wed, 5 Nov 2025 17:54:43 +0100 Subject: [PATCH 10/11] add caching for the docker image --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d9563e2..826f86e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -359,9 +359,18 @@ jobs: mkdir -p input curl -L -o input/TestDataWithThumbnail.aasx \ https://media.githubusercontent.com/media/admin-shell-io/aas-test-engines/main/bin/check_servers/test_data/TestDataWithThumbnail.aasx - - name: Build the Docker image - run: | - docker build -t basyx-python-server -f Dockerfile .. + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image with cache + uses: docker/build-push-action@v6 + with: + context: . + file: ./server/Dockerfile + push: false + tags: basyx-python-server + cache-from: type=gha + cache-to: type=gha,mode=max + load: true - name: Run container run: | docker run -d -p 8081:80 -v ./input:/input -v ./storage:/storage --name basyx-python-server basyx-python-server From 30f22a34421a482576e7193ae78c57dd60049a75 Mon Sep 17 00:00:00 2001 From: Sercan Sahin Date: Wed, 5 Nov 2025 18:30:07 +0100 Subject: [PATCH 11/11] add operation filtering --- .github/workflows/ci.yml | 2 ++ etc/scripts/aas_test_engines_filter.txt | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 etc/scripts/aas_test_engines_filter.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 826f86e9..c64be283 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -386,9 +386,11 @@ jobs: docker inspect --format='{{.State.Running}}' basyx-python-server | grep true - name: Run AAS Test Engines compliance check run: | + FILTER=$(tr -d '\n' < ../etc/scripts/aas_test_engines_filter.txt) aas_test_engines check_server \ http://localhost:8081/api/v3.0 \ https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002 \ + --filter "$FILTER" \ --output html > result.html - name: Upload test results as artifact if: always() diff --git a/etc/scripts/aas_test_engines_filter.txt b/etc/scripts/aas_test_engines_filter.txt new file mode 100644 index 00000000..a284ac60 --- /dev/null +++ b/etc/scripts/aas_test_engines_filter.txt @@ -0,0 +1,10 @@ +*~GetSubmodelById: +GetSubmodelById-ValueOnly: +GetSubmodelById-Path: +GetAllSubmodelElements: +GetAllSubmodelElements-ValueOnly: +GetAllSubmodelElements-Path: +GetSubmodelElementByPath: +GetSubmodelElementByPath-ValueOnly: +GetSubmodelElementByPath-Path: +GenerateSerializationByIds \ No newline at end of file