diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5da8f94e059a5d3d04f7b1972f5f82d1c2b01424..bf1d2559a431d5de61f1f6c99aa522a6a7d31482 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,13 @@ variables: before_script: - mkdir -p ~/.docker - echo $DOCKER_CONFIG_JSON | base64 -d > ~/.docker/config.json -# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - docker system prune -a -f --volumes || true + - docker container prune -f || true + - docker network prune -f || true + - docker image prune -a -f || true + - docker builder prune -f || true + - +after_script: - docker system prune -a -f --volumes || true - docker container prune -f || true - docker network prune -f || true @@ -35,7 +41,8 @@ before_script: build: stage: build - image: docker:dind + image: docker:latest +# image: docker:dind services: - name: docker:dind command: ["--host=fd://", "--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"] @@ -51,7 +58,8 @@ build: deploy: stage: deploy - image: docker:dind + image: docker:latest +# image: docker:dind services: - name: docker:dind command: ["--tls=false", "--storage-driver=overlay2", "--mtu=1500", "--data-root=/mnt/volume"] diff --git a/flask_ml_api/Dockerfile b/flask_ml_api/Dockerfile index e69265fae46ac6ffea56577a965d0fc1810392ad..c6c6c161da6771677cc0116d9ef893bff9335ae4 100755 --- a/flask_ml_api/Dockerfile +++ b/flask_ml_api/Dockerfile @@ -1,4 +1,5 @@ -FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime as build +#FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime as build +FROM pytorch/pytorch:1.10.0-cuda11.7-cudnn8-runtime as build RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential python3-venv && \ @@ -8,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN python3 -m venv /opt/myenv ENV PATH="/opt/myenv/bin:$PATH" +WORKDIR /app +COPY . /app + RUN pip install --no-cache-dir Flask && \ pip install --no-cache-dir matplotlib && \ pip install --no-cache-dir scikit-learn && \ @@ -16,9 +20,10 @@ RUN pip install --no-cache-dir Flask && \ pip install --no-cache-dir sentence_transformers && \ pip install --no-cache-dir --upgrade setuptools wheel -RUN docker system prune -a --volumes +RUN rm -rf /root/.cache/pip + -FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime +FROM pytorch/pytorch:1.10.0-cuda11.7-cudnn8-runtime COPY --from=build /opt/myenv /opt/myenv ENV PATH="/opt/myenv/bin:$PATH"