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
bddd72d6
Commit
bddd72d6
authored
Jan 05, 2025
by
Artem Baranovskyi
Browse files
Image build is optimized.
parent
baeadd5a
Pipeline
#10698
failed with stages
in 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
bddd72d6
...
...
@@ -21,6 +21,12 @@ variables:
DOCKER_OPTS
:
"
--data-root=/mnt/volume/docker-data"
DOCKER_MEMORY
:
"
4g"
DOCKER_CPUS
:
"
2"
# DOCKER_HUB_USERNAME: "22baar1mst@hft-stuttgart.de"
# DOCKER_HUB_PASSWORD: "" # is set at https://transfer.hft-stuttgart.de/gitlab/ulrike.pado/asyst-moodle-plugin/-/settings/ci_cd
# DOCKER_REPO: "22baar1mst/asyst-nlp-grader"
before_script
:
-
docker login -u $DOCKER_USER -p $DOCKER_HUB_PASSWORD
build
:
stage
:
build
...
...
@@ -28,53 +34,20 @@ build:
services
:
-
name
:
docker:dind
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"
-
export DOCKER_TMPDIR=/mnt/volume
-
docker system prune -a -f --volumes ||
true
-
docker container prune -f ||
true
-
docker network prune -f ||
true
-
docker image prune -a -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
-
docker network prune -f
-
docker image prune -a -f
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 flask-backend-full -o /mnt/volume/flask-backend-full.tar
artifacts
:
paths
:
-
/mnt/volume/flask-backend-full.tar
cache
:
key
:
build-cache
paths
:
-
/mnt/volume
timeout
:
2h
-
docker build --cache-from=$DOCKER_REPO --no-cache --progress=plain -t $DOCKER_REPO -f flask_ml_api/Dockerfile .
-
docker push $DOCKER_REPO
only
:
-
master
deploy
:
stage
:
deploy
dependencies
:
-
build
image
:
docker:dind
services
:
-
name
:
docker:dind
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
-
docker pull $DOCKER_REPO
-
docker run -d $DOCKER_REPO
only
:
-
master
\ No newline at end of file
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