Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Asyst Moodle Plugin
Commits
135ce25e
Commit
135ce25e
authored
4 months ago
by
Artem Baranovskyi
Browse files
Options
Download
Email Patches
Plain Diff
Image build is optimized.
parent
d49e35a1
master
No related merge requests found
Pipeline
#10736
failed
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+11
-3
.gitlab-ci.yml
flask_ml_api/Dockerfile
+8
-3
flask_ml_api/Dockerfile
with
19 additions
and
6 deletions
+19
-6
.gitlab-ci.yml
+
11
-
3
View file @
135ce25e
...
...
@@ -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"
]
...
...
This diff is collapsed.
Click to expand it.
flask_ml_api/Dockerfile
+
8
-
3
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
\
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.1
0.
0
-cuda11.7-cudnn8-runtime
COPY
--from=build /opt/myenv /opt/myenv
ENV
PATH="/opt/myenv/bin:$PATH"
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets