forked from kubeflow/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
75 lines (70 loc) · 2.42 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
include:
- project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template'
ref: 'v2'
file: '/blocks/python.yml'
stages:
- build
variables:
MAJOR_VERSION: "1"
MINOR_VERSION: "0"
build:publish-sdk:
extends: .aip_python_debian_image
stage: build
variables:
PY_LIBRARY_NAME: 'zillow-kfp'
KFP_VERSION_PATH: "sdk/python/kfp/__init__.py"
script:
- KFP_VERSION=$(cat $KFP_VERSION_PATH | sed -nr "s/^__version__ = ['\"]([^'\"]*)['\"]$/\1/p")
- |
PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}"
if [ "${CI_COMMIT_BRANCH}" != "${CI_DEFAULT_BRANCH}" ]; then
PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}-dev.${CI_PIPELINE_IID}"
fi
PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}+${KFP_VERSION}"
# Now write back the zillow-kfp version back to the original location we found the original.
- sed -i "s/\(__version__ = ['\"]\)[^'\"]*\(['\"]\)/\1${PY_LIBRARY_VERSION}\2/" $KFP_VERSION_PATH
- cd sdk/python
- python setup.py sdist
# Set up the configuration for Artifactory to publish the python package internally.
- |
cat >~/.pypirc <<EOL
[distutils]
index-servers = artifactory
[artifactory]
repository: ${ANALYTICS_PYPI_REPOSITORY}
username: ${PYPI_USERNAME}
password: ${PYPI_PASSWORD}
EOL
- python setup.py sdist upload --repository "${ANALYTICS_PYPI_REPOSITORY}"
build:publish-metadata-writer:
extends: .aip_python_debian_image
stage: build
variables:
ARTIFACT_NAME: 'zillow-metadata-writer'
before_script:
- !reference [.generate_docker_image_version, before_script]
script:
- |
docker build \
--tag ${IMAGE_REPOSITORY_TAG} \
--file backend/metadata_writer/Dockerfile \
.
- docker login --username ${DOCKER_USERNAME} --password ${DOCKER_API_KEY} ${DOCKER_REPO_URL}
- docker push ${IMAGE_REPOSITORY_TAG}
build:publish-front-end:
extends: .aip_python_debian_image
stage: build
variables:
ARTIFACT_NAME: 'zillow-kfp-frontend'
before_script:
- !reference [.generate_docker_image_version, before_script]
script:
- |
docker build \
--tag ${IMAGE_REPOSITORY_TAG} \
--build-arg COMMIT_HASH=${COMMIT_HASH} \
--build-arg DATE="`date -u`" \
--file frontend/Dockerfile \
.
- docker login --username ${DOCKER_USERNAME} --password ${DOCKER_API_KEY} ${DOCKER_REPO_URL}
- docker push ${IMAGE_REPOSITORY_TAG}