Building and pushing Docker containers

Now that we've done the hard work of preparing all our templates and scripts, we can get on with actually making the Docker images and pushing them to ECR ahead of a full cluster deployment.

First, we export the AWS credentials we generated earlier in this chapter:

export AWS_DEFAULT_REGION=ap-southeast-2
export AWS_ACCESS_KEY_ID="<your key here>"
export AWS_SECRET_ACCESS_KEY="<your secret here>"

Then we get the container repository login. This is necessary to allow us to push the created Docker image to ECR, which in turn will be pulled down by our Kubernetes nodes at model training or inference time. Note that this step assumes you have AWS CLI installed:

aws ecr get-login --no-include-email

The output of this command should resemble the following:

docker login -u AWS -p xxxxx https://ACCOUNTID.dkr.ecr.ap-southeast-2.amazonaws.com

We can then execute make cifarcnn-image and make cifarcnn-push This will build the docker image we specified in the Dockerfile and push it to AWS's container storage service. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.34.146