Last active
July 19, 2016 05:04
-
-
Save steveandroulakis/41c9cfa9d28d25c17cbdaab6aca0eabf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ## bioapps TCP | |
| ### Aws location: | |
| * Monash eSol AWS account [https://login.monash.edu/adfs/ls/idpinitiatedsignon](https://login.monash.edu/adfs/ls/idpinitiatedsignon) | |
| * RES-SPT-Automation/Steve.Androulakis@monash.edu | |
| * Oregon availability zone | |
| * Elastic Beanstalk controlled | |
| ### Elastic beanstalk scaling settings | |
| **tested with AWS and works** | |
| * Min instances: 2 | |
| * Max instances: 10 | |
| Scaling trigger: | |
| * Avg latency > 1 second | |
| ### Application configuration | |
| Docker image config for elastic beanstalk | |
| ``` | |
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "550842539797.dkr.ecr.us-west-2.amazonaws.com/tcp_shiny:latest", | |
| "Update": "true" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "80" | |
| } | |
| ], | |
| "Logging": "/var/log/nginx" | |
| } | |
| ``` | |
| ### Application Update | |
| Grab this docker image and run it with | |
| `docker run -it -p 5909:80 -p 5910:3838 550842539797.dkr.ecr.us-west-2.amazonaws.com/tcp_shiny:latest bash` | |
| Edit the TCP application under `/srv/shiny/` | |
| Make an image out of the existing container: | |
| *Note: (ctrl + p, ctrl q to get out of interactive)* | |
| `sudo docker commit <imageID> shiny_tcp_1.x` | |
| Returns <newimageID> | |
| App needs to auto run a process for AWS docker to work, so change the image. | |
| `sudo docker commit --change "CMD /tmp/run.sh" <newimageID> tcp_shiny` | |
| ### Push Update | |
| Summary: Commit your new image to AWS docker image catalog (private) and then upload a new elastic beanstalk config referring to it. | |
| Tag the image for amazon by their rules (the long number in the address is our account): | |
| `docker tag -f tcp_shiny 550842539797.dkr.ecr.us-west-2.amazonaws.com/tcp_shiny:latest` | |
| get login first (requires `aws configure` to be run first and the amazon cli tools) | |
| `aws ecr get-login` | |
| For docker cli access to the AWS private docker image store. | |
| `docker push 550842539797.dkr.ecr.us-west-2.amazonaws.com/tcp_shiny:latest` | |
| Your image is now pushed. | |
| Now go to AWS in the web and upload a new elastic beanstalk configuration (create a .json file out of the code above). This will trigger updates. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment