summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker-compose.yml43
-rw-r--r--simulator/Dockerfile27
2 files changed, 49 insertions, 21 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index 837f9019..5e45ea59 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,4 +1,4 @@
-version: "3"
+version: "3.8"
services:
frontend:
build:
@@ -33,26 +33,26 @@ services:
- OPENDC_ROOT_DIR
- OPENDC_SERVER_BASE_URL
- # TODO: Implement new database interaction on the simulator side
- # simulator:
- # build:
- # context: ./opendc-simulator
- # dockerfile: opendc-model-odc/setup/Dockerfile
- # image: simulator
- # restart: on-failure
- # links:
- # - mongo
- # depends_on:
- # - mongo
- # environment:
- # - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc
- # - PERSISTENCE_USER=opendc
- # - PERSISTENCE_PASSWORD=opendcpassword
- # - COLLECT_MACHINE_STATES=ON
- # - COLLECT_TASK_STATES=ON
- # - COLLECT_STAGE_MEASUREMENTS=OFF
- # - COLLECT_TASK_METRICS=OFF
- # - COLLECT_JOB_METRICS=OFF
+ simulator:
+ build: ./simulator
+ image: simulator
+ restart: on-failure
+ networks:
+ - backend
+ depends_on:
+ - mongo
+ volumes:
+ - type: bind
+ source: ./traces
+ target: /home/gradle/simulator/traces
+ - type: volume
+ source: results-volume
+ target: /home/gradle/simulator/results
+ environment:
+ - OPENDC_DB
+ - OPENDC_DB_USERNAME
+ - OPENDC_DB_PASSWORD
+ - OPENDC_DB_HOST=mongo
mongo:
build:
@@ -90,6 +90,7 @@ services:
volumes:
mongo-volume:
external: false
+ results-volume:
networks:
backend: {}
diff --git a/simulator/Dockerfile b/simulator/Dockerfile
new file mode 100644
index 00000000..c923cddf
--- /dev/null
+++ b/simulator/Dockerfile
@@ -0,0 +1,27 @@
+FROM gradle:jdk14
+MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
+
+# Set the home directory to our gradle user's home.
+ENV HOME=/home/gradle
+ENV APP_HOME=$HOME/simulator
+
+# Copy OpenDC simulator
+COPY ./ $APP_HOME
+
+# Build as root
+USER root
+
+# Set the working directory to the simulator
+WORKDIR $APP_HOME
+
+# Build the application
+RUN gradle --no-daemon assemble installDist
+
+# Fix permissions
+RUN chown -R gradle:gradle $APP_HOME
+
+# Downgrade user
+USER gradle
+
+# Start the Gradle application on run
+CMD opendc/opendc-runner-web/build/install/opendc-runner-web/bin/opendc-runner-web