Update Build
This commit is contained in:
parent
a59d4c51f4
commit
d3708468b0
@ -48,12 +48,12 @@ RUN cd /workspace/cope2n-ai-fi/modules/ocr_engine/externals/sdsvtr && pip3 insta
|
||||
RUN cd /workspace/cope2n-ai-fi/modules/sdsvkvu && pip3 install -v -e . --no-cache-dir
|
||||
RUN cd /workspace/cope2n-ai-fi && pip3 install -r requirements.txt --no-cache-dir
|
||||
|
||||
RUN rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublasLt.so.11 && \
|
||||
rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublas.so.11 && \
|
||||
rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libnvblas.so.11 && \
|
||||
ln -s /opt/conda/lib/libcublasLt.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublasLt.so.11 && \
|
||||
ln -s /opt/conda/lib/libcublas.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublas.so.11 && \
|
||||
ln -s /opt/conda/lib/libnvblas.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libnvblas.so.11
|
||||
# RUN rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublasLt.so.11 && \
|
||||
# rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublas.so.11 && \
|
||||
# rm -f /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libnvblas.so.11 && \
|
||||
# ln -s /opt/conda/lib/libcublasLt.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublasLt.so.11 && \
|
||||
# ln -s /opt/conda/lib/libcublas.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libcublas.so.11 && \
|
||||
# ln -s /opt/conda/lib/libnvblas.so /usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib/libnvblas.so.11
|
||||
|
||||
|
||||
WORKDIR /workspace
|
||||
|
@ -11,3 +11,4 @@ easydict
|
||||
imagesize==1.4.1
|
||||
pdf2image==1.16.3
|
||||
redis==5.0.1
|
||||
celery==5.3.6
|
@ -8,8 +8,8 @@ from datetime import datetime
|
||||
|
||||
BASH_FILE = './deploy_images.sh'
|
||||
S3_ENDPOINT = ""
|
||||
S3_ACCESS_KEY = "AKIA3AFPFVWZD77UACHE"
|
||||
S3_SECRET_KEY = "OLJ6wXBJE63SBAcOHaYVeX1qXYvaG4DCrxp7+xIT"
|
||||
S3_ACCESS_KEY = "secret"
|
||||
S3_SECRET_KEY = "secret"
|
||||
S3_BUCKET = "ocr-deployment-config"
|
||||
|
||||
class MinioS3Client:
|
||||
@ -77,7 +77,8 @@ def deploy():
|
||||
# Define the variable
|
||||
tag = str(random_hash()[:8])
|
||||
now = datetime.now()
|
||||
tag = tag + "_" + str(now.strftime("%d%m%y%H%M%S"))
|
||||
# tag = tag + "_" + str(now.strftime("%d%m%y%H%M%S"))
|
||||
tag = "4cae5134_261223123256"
|
||||
print(tag)
|
||||
|
||||
# Execute the Bash script with the variable as a command-line argument
|
||||
|
@ -1,23 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
tag=$1
|
||||
|
||||
echo "[INFO] Tag received from Python: $tag"
|
||||
|
||||
echo "[INFO] Pushing AI image with tag: $tag..."
|
||||
docker compose -f docker-compose-dev.yml build cope2n-fi-sbt
|
||||
docker tag sidp/cope2n-ai-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag}
|
||||
docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag}
|
||||
# echo "[INFO] Pushing AI image with tag: $tag..."
|
||||
# docker compose -f docker-compose-dev.yml build cope2n-fi-sbt
|
||||
# docker tag sidp/cope2n-ai-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag}
|
||||
# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag}
|
||||
|
||||
echo "[INFO] Pushing BE image with tag: $tag..."
|
||||
docker compose -f docker-compose-dev.yml build be-ctel-sbt
|
||||
docker tag sidp/cope2n-be-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag}
|
||||
docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag}
|
||||
# echo "[INFO] Pushing BE image with tag: $tag..."
|
||||
# docker compose -f docker-compose-dev.yml build be-ctel-sbt
|
||||
# docker tag sidp/cope2n-be-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag}
|
||||
# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag}
|
||||
|
||||
echo "[INFO] Pushing FE image with tag: $tag..."
|
||||
docker compose -f docker-compose-dev.yml build fe-sbt
|
||||
docker tag sidp/cope2n-fe-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag}
|
||||
docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag}
|
||||
# echo "[INFO] Pushing FE image with tag: $tag..."
|
||||
# docker compose -f docker-compose-dev.yml build fe-sbt
|
||||
# docker tag sidp/cope2n-fe-fi-sbt:latest public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag}
|
||||
# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag}
|
||||
|
||||
cp ./docker-compose-prod.yml ./docker-compose_${tag}.yml
|
||||
sed -i "s/{{tag}}/$tag/g" ./docker-compose_${tag}.yml
|
||||
|
@ -173,7 +173,7 @@ services:
|
||||
db-sbt:
|
||||
restart: always
|
||||
mem_reservation: 500m
|
||||
image: postgres:14.7-alpine
|
||||
image: postgres:15.4-alpine
|
||||
volumes:
|
||||
- ./data/postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
|
@ -51,15 +51,16 @@ services:
|
||||
- S3_SECRET_KEY=${S3_SECRET_KEY}
|
||||
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
|
||||
restart: always
|
||||
privileged: true # for chmod
|
||||
mem_limit: 10gb
|
||||
image: public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:{{tag}}
|
||||
networks:
|
||||
- ctel-sbt
|
||||
volumes:
|
||||
- ${HOST_MEDIA_FOLDER}:${MEDIA_ROOT}
|
||||
- BE_media:${MEDIA_ROOT}
|
||||
- BE_static:/app/static
|
||||
working_dir: /app
|
||||
command: sh -c "chmod -R 777 /app/static; sleep 5; python manage.py collectstatic --no-input &&
|
||||
command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input &&
|
||||
python manage.py migrate &&
|
||||
python manage.py compilemessages &&
|
||||
gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod
|
||||
@ -135,7 +136,7 @@ services:
|
||||
rabbitmq-sbt:
|
||||
condition: service_started
|
||||
volumes:
|
||||
- ${HOST_MEDIA_FOLDER}:${MEDIA_ROOT}
|
||||
- BE_media:${MEDIA_ROOT}
|
||||
|
||||
working_dir: /app
|
||||
command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5"
|
||||
@ -191,3 +192,4 @@ services:
|
||||
volumes:
|
||||
db_data:
|
||||
BE_static:
|
||||
BE_media:
|
||||
|
Loading…
Reference in New Issue
Block a user