-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_and_push.sh
executable file
·32 lines (24 loc) · 1.17 KB
/
build_and_push.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
algorithm_name=comfyui-inference
account=$(aws sts get-caller-identity --query Account --output text)
# Get the region defined in the current configuration (default to us-west-2 if none defined)
region=$(aws configure get region)
fullname="${account}.dkr.ecr.${region}.amazonaws.com/${algorithm_name}:latest"
# If the repository doesn't exist in ECR, create it.
aws ecr describe-repositories --repository-names "${algorithm_name}" > /dev/null 2>&1
if [ $? -ne 0 ]
then
aws ecr create-repository --repository-name "${algorithm_name}" > /dev/null
fi
#load public ECR image
#aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
# Log into Docker
pwd=$(aws ecr get-login-password --region ${region})
docker login --username AWS -p ${pwd} ${account}.dkr.ecr.${region}.amazonaws.com
# Build the docker image locally with the image name and then push it to ECR
# with the full name.
#git clone https://github.com/comfyanonymous/ComfyUI.git
git clone https://github.com/qingyuan18/ComfyUI.git
docker build -t ${algorithm_name} ./ -f ./dockerfile-simple
docker tag ${algorithm_name} ${fullname}
docker push ${fullname}
rm -rf ./ComfyUI