UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Containers
G
Galvanize
galvanize
java-code-evaluator
Commits
fa34f793
Commit
fa34f793
authored
Apr 16, 2021
by
Michael Uranaka
Browse files
minor updates
parent
53f371e4
Pipeline
#223513
failed with stages
in 1 minute and 52 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
21 deletions
+26
-21
Dockerfile
Dockerfile
+7
-7
README.md
README.md
+1
-1
hardening_manifest.yaml
hardening_manifest.yaml
+1
-1
scripts/Dockerfile.packages
scripts/Dockerfile.packages
+9
-5
scripts/repackage.sh
scripts/repackage.sh
+8
-7
No files found.
Dockerfile
View file @
fa34f793
ARG
BASE_REGISTRY=registry1.dso.mil
ARG
BASE_REGISTRY=registry1.dso.mil
ARG
BASE_IMAGE=
ironbank/
opensource/gradle/gradle-jre11
ARG
BASE_IMAGE=opensource/gradle/gradle-jre11
ARG
BASE_TAG=6.7.1
ARG
BASE_TAG=6.7.1
FROM
${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
FROM
${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
USER
0
USER
0
# Make sure we are up to date
# Make sure we are up to date
.
RUN
dnf update
-y
&&
dnf clean all
RUN
dnf update
-y
&&
dnf clean all
# Copy in the project files
# Copy in the project files
.
COPY
./scripts \
COPY
./scripts \
redis-cli.tar.gz \
redis-cli.tar.gz \
jars.tar.gz /app/
jars.tar.gz /app/
...
@@ -28,16 +28,16 @@ RUN tar xzf redis-cli.tar.gz \
...
@@ -28,16 +28,16 @@ RUN tar xzf redis-cli.tar.gz \
&&
chown
-R
1000 /app
\
&&
chown
-R
1000 /app
\
&&
chmod
0555 /app/get-job.sh
&&
chmod
0555 /app/get-job.sh
# Change to the gradle user
# Change to the gradle user
.
USER
1000
USER
1000
# Pre-build. This should speed things up before processing the first job
# Pre-build. This should speed things up before processing the first job
.
RUN
gradle
--offline
build
\
RUN
gradle
--offline
build
\
&&
cd
process_job
&&
gradle
--offline
build
&&
cd
..
\
&&
cd
process_job
&&
gradle
--offline
build
&&
cd
..
\
&&
cd
send_results
&&
gradle
--offline
build
&&
cd
..
&&
cd
send_results
&&
gradle
--offline
build
&&
cd
..
# Health check
# Health check
.
HEALTHCHECK
none
HEALTHCHECK
none
# Start the job processor
# Start the job processor
.
ENTRYPOINT
["/app/get-job.sh"]
ENTRYPOINT
["/app/get-job.sh"]
\ No newline at end of file
README.md
View file @
fa34f793
...
@@ -8,7 +8,7 @@ code snippets that were submitted from students through the LEARN application.
...
@@ -8,7 +8,7 @@ code snippets that were submitted from students through the LEARN application.
## Requirements:
## Requirements:
-
Redis CLI
-
Redis CLI
-
Java 11
-
Java 11
-
Gradle 6.
7
-
Gradle 6.
8
## Container Usage:
## Container Usage:
...
...
hardening_manifest.yaml
View file @
fa34f793
...
@@ -14,7 +14,7 @@ tags:
...
@@ -14,7 +14,7 @@ tags:
# Build args passed to Dockerfile ARGs
# Build args passed to Dockerfile ARGs
args
:
args
:
BASE_IMAGE
:
"
opensource/gradle/gradle-jre11"
BASE_IMAGE
:
"
opensource/gradle/gradle-jre11"
BASE_TAG
:
"
6.
7.1
"
BASE_TAG
:
"
6.
8.3
"
# Docker image labels
# Docker image labels
labels
:
labels
:
...
...
scripts/Dockerfile.packages
View file @
fa34f793
...
@@ -6,7 +6,8 @@ FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
...
@@ -6,7 +6,8 @@ FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
USER 0
USER 0
# Install required libs.
# Install required libs.
RUN dnf update -y && dnf install -y \
RUN dnf update -y \
&& dnf install -y \
curl \
curl \
make \
make \
gcc \
gcc \
...
@@ -16,13 +17,16 @@ RUN dnf update -y && dnf install -y \
...
@@ -16,13 +17,16 @@ RUN dnf update -y && dnf install -y \
WORKDIR /app
WORKDIR /app
# Redis
# Redis
RUN curl -L http://download.redis.io/redis-stable.tar.gz -o redis-stable.tar.gz
RUN curl -L http://download.redis.io/redis-stable.tar.gz -o redis-stable.tar.gz \
RUN tar xzf redis-stable.tar.gz
&& tar xzf redis-stable.tar.gz
WORKDIR /app/redis-stable
WORKDIR /app/redis-stable
RUN make redis-cli
RUN make redis-cli
WORKDIR /app/redis-stable/src
WORKDIR /app/redis-stable/src
RUN tar czf redis-cli.tar.gz redis-cli
RUN tar czf redis-cli.tar.gz redis-cli \
RUN mv redis-cli.tar.gz /app/
&& mv redis-cli.tar.gz /app/
WORKDIR /app
WORKDIR /app
# Add write permissions.
# Add write permissions.
...
...
scripts/repackage.sh
View file @
fa34f793
#!/
bin/
bash
#!/
usr/bin/env
bash
# Image Params.
# Image Params.
BASE_REGISTRY
=
registry.il2.dso.mil
BASE_REGISTRY
=
registry.il2.dso.mil
...
@@ -8,7 +8,7 @@ BASE_TAG=6.7.1
...
@@ -8,7 +8,7 @@ BASE_TAG=6.7.1
# This is the profile name in your aws credentials file.
# This is the profile name in your aws credentials file.
DEPENDENCY_FOLDER
=
build_dependencies
DEPENDENCY_FOLDER
=
build_dependencies
AWS_PROFILE_NAME
=
revacomm
AWS_PROFILE_NAME
=
revacomm
AWS_BUCKET_NAME
=
learn-dependencies/java-evaluator
AWS_BUCKET_NAME
=
learn-dependencies/java-evaluator
-dev
AWS_REGION
=
us-gov-west-1
AWS_REGION
=
us-gov-west-1
echo
"Clearing dependency folder."
echo
"Clearing dependency folder."
...
@@ -23,24 +23,25 @@ IMAGE_ID=$(docker build --file Dockerfile.packages . -q \
...
@@ -23,24 +23,25 @@ IMAGE_ID=$(docker build --file Dockerfile.packages . -q \
echo
"Image ID:
${
IMAGE_ID
}
"
echo
"Image ID:
${
IMAGE_ID
}
"
echo
"Starting docker container."
echo
"Starting docker container."
CONTAINER_ID
=
$(
docker run
-d
"
$IMAGE_ID
"
)
CONTAINER_ID
=
$(
docker run
-d
$IMAGE_ID
)
echo
"Container ID:
${
CONTAINER_ID
}
"
echo
"Container ID:
${
CONTAINER_ID
}
"
echo
"Copying node modules and gems to the bundles directory."
echo
"Copying node modules and gems to the bundles directory."
docker
cp
"
$CONTAINER_ID
"
:/app/redis-cli.tar.gz
$DEPENDENCY_FOLDER
TIMESTAMP
=
$(
TZ
=
'Pacific/Honolulu'
date
'+%Y%m%d%H%M'
)
docker
cp
$CONTAINER_ID
:/app/redis-cli.tar.gz
$DEPENDENCY_FOLDER
/redis-cli-
${
TIMESTAMP
}
.tar.gz
echo
"Stopping the docker container."
echo
"Stopping the docker container."
docker stop
"
$CONTAINER_ID
"
docker stop
"
$CONTAINER_ID
"
echo
"Uploading all the build dependencies to AWS."
echo
"Uploading all the build dependencies to AWS."
aws s3
sync
$DEPENDENCY_FOLDER
s3://
$AWS_BUCKET_NAME
--delete
--profile
$AWS_PROFILE_NAME
--region
$AWS_REGION
#
aws s3 sync $DEPENDENCY_FOLDER s3://$AWS_BUCKET_NAME --delete --profile $AWS_PROFILE_NAME --region $AWS_REGION
echo
"Checksums:"
echo
"Checksums:"
cd
$DEPENDENCY_FOLDER
cd
$DEPENDENCY_FOLDER
sha256sum
redis-cli.tar.gz
sha256sum
redis-cli
-
${
TIMESTAMP
}
.tar.gz
cd
..
cd
..
echo
"Removing dependency folder."
echo
"Removing dependency folder."
rm
-rf
$DEPENDENCY_FOLDER
#
rm -rf $DEPENDENCY_FOLDER
echo
"Done!"
echo
"Done!"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment