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
a8c20428
Commit
a8c20428
authored
Jan 04, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
97c54fcf
Pipeline
#10689
failed with stages
in 20 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
a8c20428
...
...
@@ -11,8 +11,8 @@
# for the default branch and all other (MR) branches.
stages
:
-
build
-
deploy
-
build
-
deploy
variables
:
DOCKER_DRIVER
:
overlay2
...
...
@@ -27,7 +27,7 @@ build:
image
:
docker:dind
services
:
-
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"
]
before_script
:
-
mkdir -p /mnt/volume
-
mount /dev/vdb /mnt/volume || echo "Failed to mount /dev/vdb"
...
...
@@ -36,8 +36,12 @@ build:
-
docker container prune -f ||
true
-
docker network prune -f ||
true
-
df -h
-
free -h
-
top -b -n
1
after_script
:
-
df -h
-
free -h
-
top -b -n
1
-
docker system prune -a -f
-
docker volume prune -f
-
docker container prune -f
...
...
@@ -45,6 +49,8 @@ build:
script
:
-
docker build --cache-from=flask-backend-full --no-cache --progress=plain -t flask-backend-full -f flask_ml_api/Dockerfile .
-
df -h
-
free -h
-
top -b -n
1
-
docker save -o /mnt/volume/flask-backend-full.tar flask-backend-full
artifacts
:
paths
:
...
...
@@ -53,7 +59,7 @@ build:
key
:
build-cache
paths
:
-
/mnt/volume
timeout
:
1h
timeout
:
2h
# Увеличиваем таймаут до 2 часов
deploy
:
stage
:
deploy
...
...
@@ -62,9 +68,11 @@ deploy:
image
:
docker:dind
services
:
-
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"
]
before_script
:
-
df -h
-
free -h
-
top -b -n
1
-
docker load -i /mnt/volume/flask-backend-full.tar
script
:
-
docker run -d flask-backend-full
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