diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-10-24 12:07:09 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2017-10-24 14:55:54 +0200 |
| commit | dad4487fddaccf44240f5d62fa83830f7bbf8a5d (patch) | |
| tree | 41b6eab49e08a846b5a36e8cf9eb77955ff2761e | |
| parent | 25cc35b0e4942e990c01ac6224720e8fe84fd9ae (diff) | |
bug(#6): Improve Docker deployment
This change improves the Docker deployment by moving the build process
from runtime to (image) build time. Also, the opendc-integration-jpa
module now consists of a core and mysql module, where the mysql module
is a specific deployment of the integration.
| -rw-r--r-- | Dockerfile | 20 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/build.gradle (renamed from opendc-integration-jpa/build.gradle) | 15 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt (renamed from opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/core/src/main/resources/jpa/schema.xml (renamed from opendc-integration-jpa/src/main/resources/jpa/schema.xml) | 0 | ||||
| -rw-r--r-- | opendc-integration-jpa/mysql/Dockerfile | 30 | ||||
| -rw-r--r-- | opendc-integration-jpa/mysql/build.gradle | 38 | ||||
| -rw-r--r-- | opendc-integration-jpa/mysql/src/main/resources/META-INF/persistence.xml (renamed from opendc-integration-jpa/src/main/resources/META-INF/persistence.xml) | 4 | ||||
| -rw-r--r-- | settings.gradle | 3 |
31 files changed, 70 insertions, 40 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f8de6b54..00000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM gradle:alpine -MAINTAINER Fabian Mastenbroek <f.s.mastenbroek@student.tudelft.nl> - -# Copy OpenDC simulator -COPY ./ /home/gradle/simulator - -# Fix permissions -USER root -RUN chown -R gradle:gradle /home/gradle/simulator && \ - chmod -R 771 /home/gradle/simulator -USER gradle - -# Set the working directory to the JPA integration -WORKDIR /home/gradle/simulator/opendc-integration-jpa - -# Build the application -RUN gradle --no-daemon installDist - -# Run the application -CMD build/install/opendc-integration-jpa/bin/opendc-integration-jpa diff --git a/opendc-integration-jpa/build.gradle b/opendc-integration-jpa/core/build.gradle index e5be0f46..ed510560 100644 --- a/opendc-integration-jpa/build.gradle +++ b/opendc-integration-jpa/core/build.gradle @@ -43,11 +43,9 @@ buildscript { apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'kotlin-jpa' -apply plugin: 'application' apply plugin: 'org.jetbrains.dokka' apply plugin: 'org.junit.platform.gradle.plugin' -mainClassName = "nl.atlarge.opendc.platform.JpaPlatformRunnerKt" compileKotlin { kotlinOptions { @@ -80,24 +78,11 @@ repositories { jcenter() } -import org.apache.tools.ant.filters.* - -processResources { - filter ReplaceTokens, tokens: [ - 'persistence.url': project.findProperty('persistence.url') ?: '', - 'persistence.user': project.findProperty('persistence.user') ?: '', - 'persistence.password': project.findProperty('persistence.password') ?: '', - ] -} - dependencies { compile project(':opendc-core') compile project(':opendc-stdlib') compile project(':opendc-omega') compile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final' - runtime 'org.slf4j:slf4j-simple:1.7.25' - runtime 'org.hibernate:hibernate-core:5.2.5.Final' - runtime 'mysql:mysql-connector-java:5.1.13' testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-RC3' testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.0-RC3' diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt index cbbe280a..cbbe280a 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/Jpa.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt index 11d5836e..11d5836e 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/ParallelizableConverter.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt index 95027440..95027440 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/converter/SchedulerConverter.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt index b775eb6e..b775eb6e 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Cpu.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt index 1e6eaa2b..1e6eaa2b 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Datacenter.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt index 0b352cb4..0b352cb4 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Experiment.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt index 96fc112c..96fc112c 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/ExperimentState.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt index 94625242..94625242 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Gpu.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt index 394cf478..394cf478 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Job.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt index 4071b342..4071b342 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Machine.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt index 23efe888..23efe888 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/MachineState.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt index ccf3b6e8..ccf3b6e8 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Path.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt index 2d2099a2..2d2099a2 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Rack.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt index f3b7ae06..f3b7ae06 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Room.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt index 0e9fb84f..0e9fb84f 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomObject.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt index 5e138947..5e138947 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/RoomType.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt index e3b8c350..e3b8c350 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Section.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt index 83a98cfb..83a98cfb 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Task.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt index 14441752..14441752 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/TaskState.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt index cd3d9348..cd3d9348 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/integration/jpa/schema/Trace.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt index 59b28d0b..59b28d0b 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperiment.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt index 1d1e118d..1d1e118d 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaExperimentManager.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt index 794ca44e..794ca44e 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/platform/JpaPlatformRunner.kt diff --git a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt index 8def721e..8def721e 100644 --- a/opendc-integration-jpa/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt +++ b/opendc-integration-jpa/core/src/main/kotlin/nl/atlarge/opendc/topology/JpaTopologyFactory.kt diff --git a/opendc-integration-jpa/src/main/resources/jpa/schema.xml b/opendc-integration-jpa/core/src/main/resources/jpa/schema.xml index bd6ea7a1..bd6ea7a1 100644 --- a/opendc-integration-jpa/src/main/resources/jpa/schema.xml +++ b/opendc-integration-jpa/core/src/main/resources/jpa/schema.xml diff --git a/opendc-integration-jpa/mysql/Dockerfile b/opendc-integration-jpa/mysql/Dockerfile new file mode 100644 index 00000000..75e419b4 --- /dev/null +++ b/opendc-integration-jpa/mysql/Dockerfile @@ -0,0 +1,30 @@ +# Docker mysql image for the OpenDC simulator project +# This image requires the context to be set to the root directory of the project in order to correctly build. +FROM gradle:alpine +MAINTAINER Fabian Mastenbroek <f.s.mastenbroek@student.tudelft.nl> + +# 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 :opendc-integration-jpa:mysql:installDist + +# Fix permissions +RUN chown -R gradle:gradle $APP_HOME + +# Downgrade user +USER gradle + +# Start the Gradle application on run +CMD opendc-integration-jpa/mysql/build/install/mysql/bin/mysql + diff --git a/opendc-integration-jpa/mysql/build.gradle b/opendc-integration-jpa/mysql/build.gradle new file mode 100644 index 00000000..c1cc6f58 --- /dev/null +++ b/opendc-integration-jpa/mysql/build.gradle @@ -0,0 +1,38 @@ +/* + * MIT License + * + * Copyright (c) 2017 atlarge-research + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +apply plugin: 'java' +apply plugin: 'application' +mainClassName = "nl.atlarge.opendc.platform.JpaPlatformRunnerKt" + +repositories { + jcenter() +} + +dependencies { + compile project(':opendc-integration-jpa:core') + runtime 'org.slf4j:slf4j-simple:1.7.25' + runtime 'org.hibernate:hibernate-core:5.2.5.Final' + runtime 'mysql:mysql-connector-java:5.1.13' +} diff --git a/opendc-integration-jpa/src/main/resources/META-INF/persistence.xml b/opendc-integration-jpa/mysql/src/main/resources/META-INF/persistence.xml index 311772f4..0e40dc6e 100644 --- a/opendc-integration-jpa/src/main/resources/META-INF/persistence.xml +++ b/opendc-integration-jpa/mysql/src/main/resources/META-INF/persistence.xml @@ -32,10 +32,6 @@ <mapping-file>jpa/schema.xml</mapping-file> <properties> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> - <property name="javax.persistence.jdbc.url" value="@persistence.url@" /> - <property name="javax.persistence.jdbc.user" value="@persistence.user@" /> - <property name="javax.persistence.jdbc.password" value="@persistence.password@" /> - <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> <property name="hibernate.show_sql" value="false" /> <property name="hibernate.hbm2ddl.auto" value="validate" /> diff --git a/settings.gradle b/settings.gradle index 0daac5d7..a92d3d2c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -26,4 +26,5 @@ rootProject.name = "opendc-simulator" include 'opendc-core' include 'opendc-omega' include 'opendc-stdlib' -include 'opendc-integration-jpa' +include 'opendc-integration-jpa:core' +include 'opendc-integration-jpa:mysql' |
