Challenge Overview
Previously, we have created a way to run TC Direct locally, that approach works properly for Linux and Mac OS X environments, but we met problems with docker compose in windows, as it can not mount the volume properly, which can not be easily resolved.
Rethinking of the general approach we' like to change the way to build and run.
1. Separate out local setup related stuff into tc-common-tutorials, we'd like to host these under docker/direct-app directory.
for current stuff they are
1.1 direct-app/docker-compose.yaml
1.2 direct-app/LOCAL_SETUP.md
1.3 drect-app/token.properties.docker-local
1.3 direct-app/topcoder_global.properties.docker-local
1.4 direct-app/docker/local-setup
For testing, these should be removed from the direct-app source directory first, or you can just use bd5b1c1fc470c95f0875f95048750a980777ec84 commit.
2. Please use the direct-app-docker.zip as your start kit.
1. Update direct-app-base docker image setup and rename into docker/direct-app/base directory
move the jboss related setup to build, this will built the base image for build and run. like
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L24-L26
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L42-L46
these should be moved to build docker image build.
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L55-L57
these should be moved to run docker image build.
2. Create a docker/direct-app/build docker image setup
2.1 it will mount two volumes, one is for direct-app source code, one is for built stuff - you should be clean up for each build
2.2 it will copy token.properties.docker-local and topcoder-global.properties.docker-local
2.2 it will execute the `ant first_deploy`, outputs deployment pieces to the deployment volume, so once finished, we will have a directory locally with all deployment pieces.
2.3 it will do cleanup properly.
3. Create a direct-app/run docker image setup, which will copy the deployment pieces previously built into the image and it will have entrypoint to start the jboss. Ideally, we'd like to have jboss-4.2.3-GA copied to /root/, if that is impossible, please use /data/ instead.
4. Update the docker/direct-app/docker-compose.yaml file to use the direct-app image directly.
5. Update the README.md file to reflect the new build and run process.
So the expected approach will be like
1. cd docker/direct-app/base
2. docker build -t appiriodevops/direct-app:base .
3. cd docker/direct-app/build
4. docker builld -t appiriodevops/direct-app:build .
5. docker run -v <<path-to-direct-app>>:/root/direct -v <<path-to-deployment>>:/data/ -t appiriodevops/direct-app:build
7. cd docker/direct-app/run
8 docker build -t appiriodevops/direct-app .
9. cd docker/direct-app
10. docker-compose up tc-direct - which will run the direct-app locally
If we push these base image and run image to docker hub, then we can directly run TC Direct locally without any sourcecode.
About Testing
Please make sure the above approach working properly in Windows, Linux and Mac OS X. Linux and Mac OS X are similar so you can choose one for testing.
2. Winner will be responsible to create PR for merging related stuff into https://github.com/appirio-tech/tc-common-tutorials
3. Verification Steps
4. Winner Will be responsible for making final adjustments, not for new features.
Rethinking of the general approach we' like to change the way to build and run.
1. Separate out local setup related stuff into tc-common-tutorials, we'd like to host these under docker/direct-app directory.
for current stuff they are
1.1 direct-app/docker-compose.yaml
1.2 direct-app/LOCAL_SETUP.md
1.3 drect-app/token.properties.docker-local
1.3 direct-app/topcoder_global.properties.docker-local
1.4 direct-app/docker/local-setup
For testing, these should be removed from the direct-app source directory first, or you can just use bd5b1c1fc470c95f0875f95048750a980777ec84 commit.
2. Please use the direct-app-docker.zip as your start kit.
1. Update direct-app-base docker image setup and rename into docker/direct-app/base directory
move the jboss related setup to build, this will built the base image for build and run. like
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L24-L26
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L42-L46
these should be moved to build docker image build.
https://github.com/appirio-tech/direct-app/blob/dev/docker/local-setup/direct-app-base/Dockerfile#L55-L57
these should be moved to run docker image build.
2. Create a docker/direct-app/build docker image setup
2.1 it will mount two volumes, one is for direct-app source code, one is for built stuff - you should be clean up for each build
2.2 it will copy token.properties.docker-local and topcoder-global.properties.docker-local
2.2 it will execute the `ant first_deploy`, outputs deployment pieces to the deployment volume, so once finished, we will have a directory locally with all deployment pieces.
2.3 it will do cleanup properly.
3. Create a direct-app/run docker image setup, which will copy the deployment pieces previously built into the image and it will have entrypoint to start the jboss. Ideally, we'd like to have jboss-4.2.3-GA copied to /root/, if that is impossible, please use /data/ instead.
4. Update the docker/direct-app/docker-compose.yaml file to use the direct-app image directly.
5. Update the README.md file to reflect the new build and run process.
So the expected approach will be like
1. cd docker/direct-app/base
2. docker build -t appiriodevops/direct-app:base .
3. cd docker/direct-app/build
4. docker builld -t appiriodevops/direct-app:build .
5. docker run -v <<path-to-direct-app>>:/root/direct -v <<path-to-deployment>>:/data/ -t appiriodevops/direct-app:build
7. cd docker/direct-app/run
8 docker build -t appiriodevops/direct-app .
9. cd docker/direct-app
10. docker-compose up tc-direct - which will run the direct-app locally
If we push these base image and run image to docker hub, then we can directly run TC Direct locally without any sourcecode.
About Testing
Please make sure the above approach working properly in Windows, Linux and Mac OS X. Linux and Mac OS X are similar so you can choose one for testing.
Final Submission Guidelines
1. Updated direct-app-docker.zip2. Winner will be responsible to create PR for merging related stuff into https://github.com/appirio-tech/tc-common-tutorials
3. Verification Steps
4. Winner Will be responsible for making final adjustments, not for new features.