Commit 95aee7bb authored by Artem Baranovskyi's avatar Artem Baranovskyi
Browse files

Image build is optimized.

parent aee745d1
Pipeline #10740 failed with stages
in 4 minutes and 3 seconds
Showing with 3 additions and 17 deletions
+3 -17
...@@ -42,16 +42,12 @@ after_script: ...@@ -42,16 +42,12 @@ after_script:
build: build:
stage: build stage: build
image: docker:latest image: docker:latest
# image: docker:dind
services: services:
- name: docker:dind - name: docker:dind
command: ["--host=fd://", "--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"] command: ["--host=tcp://0.0.0.0:2375", "--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
script: script:
- docker buildx create --use - docker buildx create --use
# - docker build --cache-from=flask-backend-full --no-cache --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile .
- docker build --cache-from=22baar1mst/asyst-nlp-grader --no-cache --progress=plain -t 22baar1mst/asyst-nlp-grader:latest -f flask_ml_api/Dockerfile . - docker build --cache-from=22baar1mst/asyst-nlp-grader --no-cache --progress=plain -t 22baar1mst/asyst-nlp-grader:latest -f flask_ml_api/Dockerfile .
# - docker build --no-cache --progress=plain -t 22baar1mst/asyst-nlp-grader:latest -f flask_ml_api/Dockerfile .
- echo $DOCKER_REPO
- docker push 22baar1mst/asyst-nlp-grader:latest - docker push 22baar1mst/asyst-nlp-grader:latest
only: only:
- master - master
...@@ -59,7 +55,6 @@ build: ...@@ -59,7 +55,6 @@ build:
deploy: deploy:
stage: deploy stage: deploy
image: docker:latest image: docker:latest
# image: docker:dind
services: services:
- name: docker:dind - name: docker:dind
command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"] command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"]
......
#FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime as build
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
...@@ -14,19 +13,11 @@ COPY . /app ...@@ -14,19 +13,11 @@ COPY . /app
RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \ RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \
pip install --no-cache-dir --upgrade setuptools wheel && \ pip install --no-cache-dir --upgrade setuptools wheel && \
rm -rf /root/.cache/pip \ rm -rf /root/.cache/pip
#RUN pip install --no-cache-dir Flask && \
# pip install --no-cache-dir matplotlib && \
# pip install --no-cache-dir scikit-learn && \
# pip install --no-cache-dir transformers && \
# pip install --no-cache-dir pandas && \
# pip install --no-cache-dir sentence_transformers && \
# pip install --no-cache-dir --upgrade setuptools wheel
#RUN rm -rf /root/.cache/pip
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime
COPY --from=build /opt/myenv /opt/myenv COPY --from=build /opt/myenv /opt/myenv
ENV PATH="/opt/myenv/bin:$PATH" ENV PATH="/opt/myenv/bin:$PATH"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment