Topcoder - Improve Docker Environment For Online Review

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Previously, we have worked out a docker environment for local development, but it is not optimal, you can see the recent guide by https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/online_review 

It contains different Dockerfiles for different purposes. 

For this challenge, we'd like to simplify and improve it, we'd like to have a single Docker image to build and run the online review.

Following are the ultimate goals.

1. Assumption, we have the whole source code ready, including the components.

2. A Dockerfile which is used to create the base image for build and run.  The docker image should
2.1 Setup the prerequist software, similar as https://github.com/appirio-tech/tc-common-tutorials/blob/master/docker/online_review/docker/env/Dockerfile, but no need to unjar the jboss-4.0.2.tar.gz file, which will be unzipped during the build process.
2.2 Define Volumes
-  /root/online-review  ----- this is going to mount the whole source code for build and deploy.
- /root/jboss-4.0.2 ----- this is going to unzip the jboss-4.0.2.tar.gz and deploy the online review application into
- /root/auto_pilot ----- this is going to hold the deployment pieces for auto_pilot


2.3 Script to build and run 
 - build-online-review.sh --- this is going to build the online review application, generally it is going to do 
* unjar the jboss-4.0.2.tar.gz to /root/jboss-4.0.2
* run `ant first_deploy deploy`
- build-auto-pilot.sh -- this is going to build the auto-pilot application, it should do like 
cd /root/online_review/scripts/auto_pilot
* copy the proper build.properties and token.properties files for deploying auto-pilot
* ant clean dist deploy
- build.sh --- this is going to build online-review and auto-pilot
- run-online-review.sh --- this is used to run the online review (jboss-4.0.2)
- run-auto-pilot.sh -- this is used to run the auto-pilot
- run.sh --- this is used to run the online review and auto-pilot togather.

these scripts should be put inside the docker image.

Expected Scenarios are 

1.  Use the Dockerfile to create the build and run image like 

docker build -t appiriodevops/online-review:build .

2. Build the online review and auto-pilot
2.1 build online review and autopilot
docker run -v /local/online-review:/root/online-review -v /local/deploy/jboss-4.0.2:/root/jboss-4.0.2 -v /local/deploy/auto-pilot:/root/auto-pilot -it appiriodevops/online-review:build
2.2 build online review
docker run -v /local/online-review:/root/online-review -v /local/deploy/jboss-4.0.2:/root/jboss-4.0.2 -v /local/deploy/auto-pilot:/root/auto-pilot -it appiriodevops/online-review:build /root/scripts/build-online-review.sh
2.3 build autopilot
docker run -v /local/online-review:/root/online-review -v /local/deploy/jboss-4.0.2:/root/jboss-4.0.2 -v /local/deploy/auto-pilot:/root/auto-pilot -it appiriodevops/online-review:build /root/scripts/build-auto-pilot.sh

3. Run the online review and auto-pilot

3.1 run onlie review and autopilot
docker run -v /local/deploy/jboss-4.0.2:/root/jboss-4.0.2 -v /local/deploy/auto-pilot:/root/auto-pilot -it appiriodevops/online-review:build /root/scripts/run.sh

3.2 run online review
docker run -v /local/deploy/jboss-4.0.2:/root/jboss-4.0.2 -it appiriodevops/online-review:build /root/scripts/run-online-review.sh

3.3 run auto-pilot
docker run -v /local/deploy/auto-pilot:/root/auto-pilot -it appiriodevops/online-review:build /root/scripts/run-auto-pilot.sh

4. Update the docker-compose.yaml file to have different services for build and run online review and autopilot, an env.sh should be used to define the location volumes

5. README.md file should be updated to clearly describe the usage.

6. Please use the source code at https://github.com/topcoder-platform/tc-online-review 
 

Final Submission Guidelines

- Updated Docker environment for Online Review

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30057377