Submitted originally by: katie.shakman
Looking around for the best step-by-step instructions for how to cache an environment. I'll post a couple of answers from articles I've found. Please post if you think you have better instructions. Let's all vote to promote the answer we think is best.
Note: See comments below this article for guidance on this topic.
Also, we now have a support article written by an expert that covers this: Creating a new executor AMI
Comments
3 comments
Copied from the link above.
Bake an environment into an AMI
Created by Mark Silverberg
Last updated Jun 21, 2018 by Pulu Anau
In private deployments, it is possible to "bake" compute environments' Dockerfiles on the executor template AMI so that the compute environment is cached, ready, and available for the user when they are ready.
In short, doing this in AWS VPC environments will significantly reduce the amount of time a customer spends at the "Building" or "Pulling" run states
Step-by-step guide
domino-CUSTOMER-executor-template
) and start it (it will likely be in the "stopped" state)docker images
to see what images are cacheddocker pull URL
for the images you want to cache onto the executor; it's probably a good idea to go in and cache all global environmentssalt-call state.highstate
before creating the AMI so that all necessary software and system updates are appliedVERBOSE=TRUE DRY_RUN=FALSE /domino/create_executor_amis.sh
(you might have to chmod +x this file first)aws ec2 describe-images --image-ids ami-865ef0f9 --region us-east-1
| grep State
db.executor_group_configuration.update({},{$set:{"executorImage":"NEW_AMI_ID"}},{multi:true})
salt "*exec-high*" cmd.run "df -h"
Submitted by: katie.shakman
Copied from the article linked above.
Cache a Dockerfile on all currently running executors
Created by Mark Silverberg
Last updated May 05, 2017
These instructions walk you through how to build/cache a Docker file on all of a Domino deployment's existing executors.
Note: this is most useful for on-prem deployments where there is a fixed number of executors which are always running. This is also useful if you have snapped a new AMI for a customer with the latest Dockerfile cached and you want the existing executors to have the latest layer(s) too.
Another note: this uses the "salt" command – essentially, Salt keeps a record of all the servers and their configs and we can tell it to run a command on all of the servers at the same time
salt '*exec*'
cmd.run 'rm -rf /tmp/build && mkdir /tmp/build'
salt-cp '*exec*'
/tmp/Dockerfile /tmp/build/Dockerfile
salt '*exec*'
cmd.run 'docker build /tmp/build'
Submitted by: katie.shakman
Note that we have a support article on this: Creating a new executor AMI
Submitted by: nick.jablonski
Please sign in to leave a comment.