Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasTR committed Apr 14, 2023
1 parent bd25448 commit 1096652
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,41 +56,36 @@ manage_ecr_repositories() {
done
}

# Call the function


# Call the function
aws_configure_from_env
login_ecr
manage_ecr_repositories
build_and_push_container() {
local container_label="$1"

## TODO - add MoLeR
# 1) Build the container with the name and target -t XYZ:latest
echo "Building container: $container_label:latest"
docker build "$container_label" -t "$container_label:latest"

## TODO remove
# Add other functions and commands below
# 2) Check the ECR registry identity of the XYZ docker container
registry_uri=$(aws ecr-public describe-repositories --repository-names "$container_label" --query 'repositories[0].repositoryUri' --output text)
echo "ECR registry URI: $registry_uri"

# build container
# docker build containerfold -t containerfold:blank
# docker build protbert -t protbert --no-cache
# 3) Retag the XYZ:latest container to the ECR identity
echo "Retagging $container_label:latest to $registry_uri:latest"
docker tag "$container_label:latest" "$registry_uri:latest"

# check if the model weights exist in the container directory
#if [ ! -d containerfold/params ]; then
# echo "Model weights not found in local directory, please mount the directory and try again"
# exit 1
#fi

# moving weights to the container
#echo "Moving model weights to container"
#docker run -v $(pwd)/containerfold/params:/params containerfold:blank sh -c "cp -r /params/* /colabfold_batch/colabfold/params && chown -R root:root /colabfold_batch"
# 4) Push the docker container
echo "Pushing container to ECR: $registry_uri:latest"
docker push "$registry_uri:latest"
}

# changing tags
#echo "Changing tag"
#docker commit $(docker ps -lq) containerfold:latest
#docker tag containerfold:latest public.ecr.aws/p7l9w5o7/containerfold:latest

# testing container
#echo "Testing container"
#docker run containerfold:latest colabfold_batch --help
# Call the function
aws_configure_from_env
login_ecr
manage_ecr_repositories

# pushing container
#docker push public.ecr.aws/p7l9w5o7/containerfold:latest
# Call the function with the container label as a CLI argument
if [ $# -eq 1 ]; then
build_and_push_container "$1"
else
echo "Usage: $0 <container-label>"
exit 1
fi

0 comments on commit 1096652

Please sign in to comment.