Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.git
**/.idea
**/*.iml

# Source trees: only their compiled classes are copied (see jacoco.dockerfile)
jdk_*/**
!jdk_*/**/target/classes/**
!jdk_*/**/build/classes/**

# Never copied by any Dockerfile
scripts
experiments
process_data
statistics
runner
js_npm
dotnet_3
4 changes: 2 additions & 2 deletions dockerfiles/arimaa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
mongodb:
image: mongo:7
volumes:
- ../scripts/dockerize/data/additional_files/arimaa/arimaa-mongo-seed.js:/docker-entrypoint-initdb.d/arimaa-mongo-seed.js
- ./additional_files/arimaa/arimaa-mongo-seed.js:/docker-entrypoint-initdb.d/arimaa-mongo-seed.js
healthcheck:
test: mongosh --quiet --eval "db.adminCommand('ping')"
interval: 30s
Expand All @@ -61,7 +61,7 @@ services:
environment:
NEO4J_AUTH: neo4j/wfdNeo4jPass123
volumes:
- ../scripts/dockerize/data/additional_files/arimaa/arimaa-neo4j-seed.cypher:/seed.cypher
- ./additional_files/arimaa/arimaa-neo4j-seed.cypher:/seed.cypher
healthcheck:
test: cypher-shell -u neo4j -p wfdNeo4jPass123 "MATCH (:WfdSeedComplete) RETURN 1"
interval: 30s
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/blogapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: blogapi
volumes:
- ../scripts/dockerize/data/additional_files/blogapi/blogapi.sql:/docker-entrypoint-initdb.d/blogapi.sql
- ../scripts/dockerize/data/additional_files/blogapi/data.sql:/docker-entrypoint-initdb.d/data.sql
- ./additional_files/blogapi/blogapi.sql:/docker-entrypoint-initdb.d/blogapi.sql
- ./additional_files/blogapi/data.sql:/docker-entrypoint-initdb.d/data.sql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 30s
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/familie-ba-sak.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ services:
SERVER_PORT: ${AUTH_PORT:-8081}
JSON_CONFIG_PATH: /app/mockoauth2.json
volumes:
- ../scripts/dockerize/data/additional_files/familie-ba-sak/mockoauth2.json:/app/mockoauth2.json
- ./additional_files/familie-ba-sak/mockoauth2.json:/app/mockoauth2.json
ports:
- '${AUTH_PORT:-8081}:${AUTH_PORT:-8081}'
4 changes: 2 additions & 2 deletions dockerfiles/joinus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
db:
image: mongo:7
volumes:
- ../scripts/dockerize/data/additional_files/joinus/joinus-mongo-seed.js:/docker-entrypoint-initdb.d/joinus-mongo-seed.js
- ./additional_files/joinus/joinus-mongo-seed.js:/docker-entrypoint-initdb.d/joinus-mongo-seed.js
healthcheck:
test: mongosh --quiet --eval "db.adminCommand('ping')"
interval: 30s
Expand All @@ -47,7 +47,7 @@ services:
environment:
NEO4J_AUTH: neo4j/wfdNeo4jPass123
volumes:
- ../scripts/dockerize/data/additional_files/joinus/joinus-neo4j-seed.cypher:/seed.cypher
- ./additional_files/joinus/joinus-neo4j-seed.cypher:/seed.cypher
healthcheck:
test: cypher-shell -u neo4j -p wfdNeo4jPass123 "MATCH (:WfdSeedComplete) RETURN 1"
interval: 30s
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/microcks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
KC_HEALTH_ENABLED: 'true'
KC_METRICS_ENABLED: 'true'
volumes:
- ../scripts/dockerize/data/additional_files/microcks/microcks-realm-sample.json:/opt/keycloak/data/import/microcks-realm.json
- ./additional_files/microcks/microcks-realm-sample.json:/opt/keycloak/data/import/microcks-realm.json
healthcheck:
test: ['CMD', 'sh', '-c', "echo -e 'GET /health/live HTTP/1.1\r\nHost: localhost\r\n\r\n' > /dev/tcp/localhost/9000"]
interval: 30s
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/ocvn.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/ocvn/init_db.sql .
COPY ./dockerfiles/additional_files/ocvn/init_db.sql .



Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/ohsome-api.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/ohsome-api/heidelberg.mv.db .
COPY ./dockerfiles/additional_files/ohsome-api/heidelberg.mv.db .



Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/pay-publicapi.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/pay-publicapi/em_config.yaml .
COPY ./dockerfiles/additional_files/pay-publicapi/em_config.yaml .



Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/reservations-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
tmpfs:
- '/data/db'
volumes:
- ../scripts/dockerize/data/additional_files/reservations-api/mongo-init.js:/docker-entrypoint-initdb.d/01-init-replica.js
- ../scripts/dockerize/data/additional_files/reservations-api/mongo_import.sh:/docker-entrypoint-initdb.d/mongo_import.sh
- ../scripts/dockerize/data/additional_files/reservations-api/init.json:/fixtures/init.json
- ./additional_files/reservations-api/mongo-init.js:/docker-entrypoint-initdb.d/01-init-replica.js
- ./additional_files/reservations-api/mongo_import.sh:/docker-entrypoint-initdb.d/mongo_import.sh
- ./additional_files/reservations-api/init.json:/fixtures/init.json
command: mongod --replSet rs0 --bind_ip_all
4 changes: 2 additions & 2 deletions dockerfiles/scout-api.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/scout-api/init_db.sql .
COPY ./dockerfiles/additional_files/scout-api/init_db.sql .

COPY ./scripts/dockerize/data/additional_files/scout-api/scout_api_evomaster.yml .
COPY ./dockerfiles/additional_files/scout-api/scout_api_evomaster.yml .



Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/spring-ecommerce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ services:
MONGODB_REPLICA_SET_MODE: primary
ALLOW_EMPTY_PASSWORD: yes
volumes:
- ../scripts/dockerize/data/additional_files/spring-ecommerce/mongo_import.sh:/docker-entrypoint-initdb.d/mongo_import.sh
- ../scripts/dockerize/data/additional_files/spring-ecommerce/init.json:/fixtures/init.json
- ./additional_files/spring-ecommerce/mongo_import.sh:/docker-entrypoint-initdb.d/mongo_import.sh
- ./additional_files/spring-ecommerce/init.json:/fixtures/init.json
redis:
image: redis:7.0.11
elasticsearch:
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/swagger-petstore.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/swagger-petstore/inflector.yaml .
COPY ./dockerfiles/additional_files/swagger-petstore/inflector.yaml .



Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tiltaksgjennomforing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ services:
SERVER_PORT: ${AUTH_PORT:-8081}
JSON_CONFIG_PATH: /app/mockoauth2.json
volumes:
- ../scripts/dockerize/data/additional_files/tiltaksgjennomforing/mockoauth2.json:/app/mockoauth2.json
- ./additional_files/tiltaksgjennomforing/mockoauth2.json:/app/mockoauth2.json
ports:
- '${AUTH_PORT:-8081}:${AUTH_PORT:-8081}'
2 changes: 1 addition & 1 deletion dockerfiles/webgoat.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./dist/jacocoagent.jar .



COPY ./scripts/dockerize/data/additional_files/webgoat/test.mv.db .
COPY ./dockerfiles/additional_files/webgoat/test.mv.db .



Expand Down
8 changes: 5 additions & 3 deletions notes_adding_suts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ As there are quite a few things to keep in mind, we list here the most important
(eg "http://localhost:8080/v3/api-docs"). Used to fetch the schema in BB experiments.
* TARGET_URL: the base URL of the running SUT, typically "http://localhost:8080".
* COPY_ADDITIONAL_FILES: TRUE/FALSE. If TRUE, ALL files inside the folder
"scripts/dockerize/data/additional_files/NAME" are copied (COPY) into the working directory of the Docker image.
"dockerfiles/additional_files/NAME" are copied (COPY) into the working directory of the Docker image.
This is for SUTs needing extra files at runtime next to the JAR (eg configuration files such as YAML configs).
Note the folder MUST exist and MUST have the same name as the SUT (NAME), otherwise the generation fails.
* DEPENDS_ON: semicolon-separated list of service names the SUT container must wait for (rendered as
Expand All @@ -190,7 +190,7 @@ As there are quite a few things to keep in mind, we list here the most important
- "environment": semicolon-separated list of "KEY: value" environment entries for the service
(eg "POSTGRES_PASSWORD: password;POSTGRES_DB: foo"). Empty string if none.
- "volume": semicolon-separated list of "host_path:container_path" mounts. Host paths here point into
"../scripts/dockerize/data/additional_files/NAME/..." (relative to the "dockerfiles" folder), eg to
"./additional_files/NAME/..." (relative to the "dockerfiles" folder), eg to
provide DB init scripts ("/docker-entrypoint-initdb.d/...") or mock-server configs. Empty string if none.
- "port": optional "host:container" port mapping, if the service must be reachable from outside the
compose network (eg mock OAuth servers).
Expand All @@ -203,7 +203,9 @@ As there are quite a few things to keep in mind, we list here the most important

- if the SUT needs any extra file inside Docker (either copied into the SUT image via COPY_ADDITIONAL_FILES, or
mounted as a volume of a service in SERVICES), such file must be placed under
"scripts/dockerize/data/additional_files/NAME", where NAME is exactly the same name of the SUT used in "sut.csv".
"dockerfiles/additional_files/NAME", where NAME is exactly the same name of the SUT used in "sut.csv".
Note: this folder MUST be under "dockerfiles", as that is the only folder distributed by "wfd.dockerfile".
Paths pointing outside of it would break when WFD is distributed as a Docker image.
See the existing subfolders there (eg "blogapi", "pay-publicapi", "webgoat") for examples.

- after updating "sut.csv" (and "statistics/data.csv"), run "scripts/createDockerFiles.py" to (re)generate
Expand Down
7 changes: 7 additions & 0 deletions scripts/createDockerFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
SUTS_LOCATION = os.path.join(SCRIPT_LOCATION, 'dockerize/data/sut.csv')
GENERATOR_LOCATION = os.path.join(SCRIPT_LOCATION, 'dockerize/docker_generator.py')

LEGACY_ADDITIONAL_FILES = os.path.join(SCRIPT_LOCATION, 'dockerize/data/additional_files')
if os.path.isdir(LEGACY_ADDITIONAL_FILES):
raise EnvironmentError(
f"'{LEGACY_ADDITIONAL_FILES}' should not exist anymore. "
"Additional files must be put under 'dockerfiles/additional_files'."
)

PYTHON_CMD = shutil.which('python3') or shutil.which('python')
if not PYTHON_CMD:
raise EnvironmentError("Could not find Python interpreter")
Expand Down
Loading
Loading