-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make RFS runnable as Container (#550)
This changes introduces a Dockerfile for RFS that is linked to the gradle build process such that a user can make changes to RFS code or dependencies and simply execute ./gradlew buildDockerImages from the RFS directory and create a Docker image with the latest changes. A user could alternatively execute ./gradlew composeUp and create a docker environment with source/target/RFS containers using latest changes. Note: The gradle link is in place for docker compose but more work is needed here to limit manual steps a user needs to take to test RFS in this environment. Along with this a few command line arguments were incorporated into RFS Signed-off-by: Tanner Lewis <[email protected]>
- Loading branch information
Showing
9 changed files
with
207 additions
and
15 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,5 @@ | ||
# Ignore Gradle project-specific cache directory | ||
.gradle | ||
|
||
# Ignore Gradle build output directory | ||
build |
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
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
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,27 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
|
||
plugins { | ||
// Support convention plugins written in Groovy. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
id 'groovy-gradle-plugin' | ||
id 'org.owasp.dependencycheck' version '8.2.1' | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'com.bmuschko:gradle-docker-plugin:9.3.1' | ||
} | ||
|
||
tasks.withType(Tar){ | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} | ||
|
||
tasks.withType(Zip){ | ||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
} |
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,7 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This settings file is used to specify which projects to include in your build-logic build. | ||
*/ | ||
|
||
rootProject.name = 'buildSrc' |
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,8 @@ | ||
# Using same base image as other Java containers in this repo | ||
FROM openjdk:11-jre | ||
# Requires Gradle to genearte runtime jars initially | ||
COPY ./build/runtimeJars /rfs-app/jars | ||
WORKDIR /rfs-app | ||
RUN printf "#!/bin/sh\njava -XX:MaxRAMPercentage=80.0 -cp /rfs-app/jars/*:. \"\$@\" " > /rfs-app/runJavaWithClasspath.sh | ||
RUN chmod +x /rfs-app/runJavaWithClasspath.sh | ||
CMD ["tail", "-f", "/dev/null"] |
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,38 @@ | ||
version: '3.7' | ||
services: | ||
|
||
# TODO: Sync gradle for RFS and C&R | ||
# Temporarily this requires the user to first build the elasticsearch image from the TrafficCapture gradle project | ||
# directory using a command like ./gradlew buildDockerImages | ||
elasticsearchsource: | ||
image: 'migrations/elasticsearch_searchguard:latest' | ||
networks: | ||
- migrations | ||
environment: | ||
- discovery.type=single-node | ||
ports: | ||
- '19200:9200' | ||
|
||
# TODO: Add example command users can run to kickoff RFS after data is loaded on source | ||
reindex-from-snapshot: | ||
image: 'migrations/reindex_from_snapshot:latest' | ||
depends_on: | ||
elasticsearchsource: | ||
condition: service_started | ||
opensearchtarget: | ||
condition: service_started | ||
networks: | ||
- migrations | ||
|
||
opensearchtarget: | ||
image: 'opensearchproject/opensearch:2.11.1' | ||
environment: | ||
- discovery.type=single-node | ||
networks: | ||
- migrations | ||
ports: | ||
- "29200:9200" | ||
|
||
networks: | ||
migrations: | ||
driver: bridge |
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
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