-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smoke test to detect issues with Docker images (#515)
* Add docker smoke test + workflow * Update docker-image.yml * Update docker-image.yml
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true | ||
MAVEN_CLI_OPTS: --batch-mode --errors --fail-at-end --show-version | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Run the Maven verify phase | ||
run: mvn $MAVEN_CLI_OPTS verify | ||
- name: Build Docker image for Knowledge Directory | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./knowledge-directory | ||
platforms: linux/amd64 | ||
tags: knowledge-directory | ||
load: true | ||
- name: Build Docker image for Smart Connector | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./smart-connector-rest-dist | ||
platforms: linux/amd64 | ||
tags: smart-connector | ||
load: true | ||
- name: Build and start smoke test | ||
run: docker compose -f ".github/workflows/docker-smoke-test" up -d --build | ||
- name: Check smoke test status | ||
run: sleep 60s && test $(docker info --format '{{json .ContainersRunning}}') == 5 | ||
shell: bash |
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 @@ | ||
services: | ||
knowledge-directory: | ||
image: knowledge-directory | ||
|
||
runtime-1: | ||
image: smart-connector | ||
environment: | ||
KE_RUNTIME_PORT: 8081 | ||
KE_RUNTIME_EXPOSED_URL: http://runtime-1:8081 | ||
KD_URL: http://knowledge-directory:8282 | ||
runtime-2: | ||
image: smart-connector | ||
environment: | ||
KE_RUNTIME_PORT: 8081 | ||
KE_RUNTIME_EXPOSED_URL: http://runtime-2:8081 | ||
KD_URL: http://knowledge-directory:8282 | ||
|
||
kb1: | ||
build: ../../examples/common/asking_kb | ||
environment: | ||
KE_URL: http://runtime-1:8280/rest | ||
KB_ID: http://example.org/kb1 | ||
PREFIXES: | | ||
{ | ||
"ex": "http://example.org/" | ||
} | ||
GRAPH_PATTERN: | | ||
?a ex:relatedTo ?b . | ||
kb2: | ||
build: ../../examples/common/answering_kb | ||
environment: | ||
KE_URL: http://runtime-2:8280/rest | ||
KB_ID: http://example.org/kb2 | ||
PREFIXES: | | ||
{ | ||
"ex": "http://example.org/" | ||
} | ||
GRAPH_PATTERN: | | ||
?a ex:relatedTo ?b . | ||
KB_DATA: | | ||
[ | ||
{ | ||
"a": "<http://example.org/Math>", | ||
"b": "<http://example.org/Science>" | ||
} | ||
] |