AWS_ECR module

AWS_ECR.containerize(region, files_to_process, n_jobs=1)

Function enables parallel containerization of several docker files and will push to ECR when completed. If the ECR container repo does not exist, TwinModules will attempt to create. Note this assumes users have proper IAM access and will auto login into ECR for tagging and pushing.

This function call can also be called from the CLI for quick building and pushing of containers. E.g.

python tfcli.py -bp --region us-east-1 -d ./mydockerfile -t mydocker

Here an ECR repo will be looked for or created in the us-east-1 region, the mydockerfile will be used to create the container and the tag my docker will be used for naming the container and the ECR repo.

Return type:

None

Parameters:
  • region (str) – AWS region.

  • files_to_process (list[dict]) –

    Expecting a list of dictionaries. Where the key is the repo name and the value is the location of the docker file.

    Example:
    files_to_process = [

    {‘gpu-worker’: ‘/home/ubuntu/projects/twinflow/examples/Dockerfile-gpu-worker’} ]

  • n_jobs (int, optional) – Number of cpu to use. The default is 1.

Return type:

None