UNCLASSIFIED

Commit fa34f793 authored by Michael Uranaka's avatar Michael Uranaka
Browse files

minor updates

parent 53f371e4
Pipeline #223513 failed with stages
in 1 minute and 52 seconds
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
...@@ -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:
......
...@@ -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:
......
...@@ -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.
......
#!/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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment