Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KNIGHT
Asyst Moodle Plugin
Commits
135ce25e
Commit
135ce25e
authored
Jan 06, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
d49e35a1
Pipeline
#10736
failed
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
135ce25e
...
@@ -26,7 +26,13 @@ variables:
...
@@ -26,7 +26,13 @@ variables:
before_script
:
before_script
:
-
mkdir -p ~/.docker
-
mkdir -p ~/.docker
-
echo $DOCKER_CONFIG_JSON | base64 -d > ~/.docker/config.json
-
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 system prune -a -f --volumes ||
true
-
docker container prune -f ||
true
-
docker container prune -f ||
true
-
docker network prune -f ||
true
-
docker network prune -f ||
true
...
@@ -35,7 +41,8 @@ before_script:
...
@@ -35,7 +41,8 @@ before_script:
build
:
build
:
stage
:
build
stage
:
build
image
:
docker:dind
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=fd://"
,
"
--tls=false"
,
"
--storage-driver=overlay2"
,
"
--mtu=1500"
,
"
--data-root=/mnt/volume"
]
...
@@ -51,7 +58,8 @@ build:
...
@@ -51,7 +58,8 @@ build:
deploy
:
deploy
:
stage
:
deploy
stage
:
deploy
image
:
docker:dind
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"
]
...
...
flask_ml_api/Dockerfile
View file @
135ce25e
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
\
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
build-essential python3-venv
&&
\
build-essential python3-venv
&&
\
...
@@ -8,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
...
@@ -8,6 +9,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN
python3
-m
venv /opt/myenv
RUN
python3
-m
venv /opt/myenv
ENV
PATH="/opt/myenv/bin:$PATH"
ENV
PATH="/opt/myenv/bin:$PATH"
WORKDIR
/app
COPY
. /app
RUN
pip
install
--no-cache-dir
Flask
&&
\
RUN
pip
install
--no-cache-dir
Flask
&&
\
pip
install
--no-cache-dir
matplotlib
&&
\
pip
install
--no-cache-dir
matplotlib
&&
\
pip
install
--no-cache-dir
scikit-learn
&&
\
pip
install
--no-cache-dir
scikit-learn
&&
\
...
@@ -16,9 +20,10 @@ RUN pip install --no-cache-dir Flask && \
...
@@ -16,9 +20,10 @@ RUN pip install --no-cache-dir Flask && \
pip
install
--no-cache-dir
sentence_transformers
&&
\
pip
install
--no-cache-dir
sentence_transformers
&&
\
pip
install
--no-cache-dir
--upgrade
setuptools wheel
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.1
0.
0
-cuda11.7-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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment