-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
87 lines (76 loc) · 2.35 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
variables:
GIT_SUBMODULE_STRATEGY: recursive
image: docker:latest
services:
- docker:dind
stages:
- tests
- models
- translate-service
- translate-batch
- use-models-tools
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
tests:
image: python:3.11.0-slim-bullseye
before_script:
- apt-get update && apt-get install make gcc git -y
- pip install nose2
stage: tests
script:
- pip install -r use-models-tools/requirements.txt
- make run-tests
models:
stage: models
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/nmt-models
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=models/docker/Dockerfile
- docker build --tag nmt-models --tag $IMAGE_NAME . -f $DOCKER_PATH
- docker push $IMAGE_NAME
translate-service:
stage: translate-service
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/translate-service
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=serving/translate-service/docker/Dockerfile
- docker build --tag translate-service -f $DOCKER_PATH --tag $IMAGE_NAME .
needs:
- models
translate-service-test:
stage: translate-service
script:
- export IMAGE_NAME=translate-service-test
- export DOCKER_PATH=serving/translate-service/docker/Dockerfile-test
- docker build -f $DOCKER_PATH --tag $IMAGE_NAME .
- docker run -t $IMAGE_NAME
needs:
- translate-service
translate-service-publish:
stage: translate-service
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/translate-service
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- docker push $IMAGE_NAME
needs:
- translate-service-test
translate-batch:
stage: translate-batch
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/translate-batch
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=serving/translate-batch/docker/Dockerfile
- docker build -f $DOCKER_PATH --tag $IMAGE_NAME .
- docker push $IMAGE_NAME
needs:
- models
use-models-tools:
stage: use-models-tools
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/use-models-tools
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=use-models-tools/docker/Dockerfile
- docker build -f $DOCKER_PATH --tag latest --tag $IMAGE_NAME .
- docker push $IMAGE_NAME
needs:
- models