Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIP-4600: [Part 2 of 3] Add in publishing to ZG Artifactory #8

Merged
merged 17 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ca04bf3
AIP-4600: Add in publishing to ZG Artifactory
alexlatchford Aug 31, 2021
7479ddf
Trigger CICD
alexlatchford Aug 31, 2021
3f68150
AIP-4600: Add in credentials for publishing to Artifactory
alexlatchford Aug 31, 2021
a8fa267
AIP-4600: Add in credentials for publishing to Artifactory
alexlatchford Aug 31, 2021
f2d7e50
AIP-4600: Add in credentials for publishing to Artifactory
alexlatchford Aug 31, 2021
876ebe7
AIP-4600: Add in credentials for publishing to Artifactory
alexlatchford Aug 31, 2021
0558130
AIP-4600: Add in credentials for publishing to Artifactory
alexlatchford Aug 31, 2021
05c3214
AIP-4600: Update PYPI_REPOSITORY to to publish to ANALYTICS_PYPI_REPO…
alexlatchford Sep 1, 2021
147bdbd
AIP-4600: Embed package name and version into sdist
alexlatchford Sep 2, 2021
9790c43
AIP-4600: Fix GNU sed compatibility error
alexlatchford Sep 2, 2021
248ef74
AIP-4600: Ensure + chars in KFP version are replaced when used as K8s…
alexlatchford Sep 2, 2021
95205d8
AIP-4600: Ensure + chars in KFP version are replaced when used as K8s…
alexlatchford Sep 3, 2021
3ebfb12
AIP-4600: Allow ZG to control semantic version of zillow-kfp
alexlatchford Sep 16, 2021
d614fc2
fix(sdk): Get short name of complex input/output types to ensure we c…
alexlatchford Sep 10, 2021
6f9828d
fix(sdk): Update upper bound on kubernetes constraint in Python SDK (…
alexlatchford Sep 9, 2021
ecf30d2
Merge pull request #9 from zillow/alexla/AIP-4600-pt3
alexlatchford Sep 21, 2021
9a564b5
AIP-4600: Update CICD pin
alexlatchford Sep 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include:
alexlatchford marked this conversation as resolved.
Show resolved Hide resolved
- project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template'
ref: &include_ref 'alexla/AIP-4600' # TODO AIP-4600 Replace with v2
alexlatchford marked this conversation as resolved.
Show resolved Hide resolved
file: '/blocks/python.yml'

stages:
- build

build:publish:
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")
- |
if [ "${CI_COMMIT_BRANCH}" = "${CI_DEFAULT_BRANCH}" ]; then
PY_LIBRARY_VERSION="${KFP_VERSION}.${CI_PIPELINE_IID}"
hsezhiyan marked this conversation as resolved.
Show resolved Hide resolved
else
PY_LIBRARY_VERSION="0.0.${CI_PIPELINE_IID}+${CI_COMMIT_SHORT_SHA}"
fi
# 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
hsezhiyan marked this conversation as resolved.
Show resolved Hide resolved
- 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}"
4 changes: 2 additions & 2 deletions sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def _create_workflow(
default=default_param_values[param.name]))

op_transformers = [add_pod_env]
pod_labels = {_SDK_VERSION_LABEL: kfp.__version__, _SDK_ENV_LABEL:_SDK_ENV_DEFAULT}
pod_labels = {_SDK_VERSION_LABEL: kfp.__version__.replace('+', '-'), _SDK_ENV_LABEL:_SDK_ENV_DEFAULT}
op_transformers.append(add_pod_labels(pod_labels))
op_transformers.extend(pipeline_conf.op_transformers)

Expand Down Expand Up @@ -974,7 +974,7 @@ def _create_workflow(


# Labels might be logged better than annotations so adding some information here as well
labels[_SDK_VERSION_LABEL] = kfp.__version__
labels[_SDK_VERSION_LABEL] = kfp.__version__.replace('+', '-')

return workflow

Expand Down
2 changes: 1 addition & 1 deletion sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import re
from setuptools import setup

NAME = 'kfp'
NAME = 'zillow-kfp' # 'kfp'
#VERSION = .... Change the version in kfp/__init__.py

# NOTICE, after any updates to the following, ./requirements.in should be updated
Expand Down