From fb1cf952d85fd7ce06c2cc370344b40d612708d5 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni Date: Mon, 8 Jan 2024 15:20:51 -0800 Subject: [PATCH 01/11] Copied over our changes in zillow/kserve, only those which are still relevant. We don't need to remove ray anymore as it has been upgraded. --- .gitignore | 1 - .gitlab-ci.yml | 60 +++++++++++++++++++++++++++++++++ python/kserve/kserve/storage.py | 13 +++++-- python/kserve/requirements.txt | 6 ++-- python/kserve/setup.py | 2 +- 5 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitignore b/.gitignore index f63b6d53fd4..488ca37d4be 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,6 @@ bin # Notebook Checkpoints .ipynb_checkpoints -.gitlab-ci.yml .openapi-generator-ignore .openapi-generator/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000000..c54f4be9000 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,60 @@ +include: + - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' + ref: &include_ref 'v3' + file: 'environments/devex.yml' + - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' + ref: *include_ref + file: '/blocks/python.yml' + +variables: + PY_LIBRARY_NAME: "zillow-kserve" + MAJOR_VERSION: "0" + MINOR_VERSION: "7" + KSERVE_VERSION_PATH: "python/kserve/setup.py" + PUBLISH: "true" + +stages: + - build + +.version: &version | + # Extract the open source KServe version as the basis for our forked library version. + KSERVE_VERSION=$(cat $KSERVE_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}" + # Ensure the image tag is compliant with PEP-440, + IMAGE_TAG="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" + else + IMAGE_TAG="${PY_LIBRARY_VERSION}" + fi + # Only apply the KServe version to the python library as Docker versions do not have the concept of + # build metadata and the "+" character causes errors. + PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}+${KSERVE_VERSION}" + +build:publish: + extends: .aip_python_debian_image + stage: build + script: + - *version + # Now write back the zillow-kserve version back to the original location we found the original so + # python package managers can reference it as they need the version stored internally. + - sed -i "s/\(version=['\"]\)[^'\"]*\(['\"]\)/\1${PY_LIBRARY_VERSION}\2/" $KSERVE_VERSION_PATH + - cd python/kserve + - python setup.py sdist + # Set up the configuration for Artifactory to publish the python package internally. + - | + cat >~/.pypirc <=1.8.0 cloudevents>=1.6.2 avro>=1.11.0 -boto3~=1.21 +# AIP: remove boto dependencies as we are not using them and they will slow down dependency resolution +# boto3~=1.21 psutil>=5.9.0 -ray[serve]==2.0.0 +# AIP: relax ray for vllm +ray[serve]>=2.0.0 grpcio>=1.34.0 tritonclient==2.18.0 protobuf>=3.19.0 diff --git a/python/kserve/setup.py b/python/kserve/setup.py index b26ace45ddd..0aab33fd38e 100644 --- a/python/kserve/setup.py +++ b/python/kserve/setup.py @@ -31,7 +31,7 @@ version = version_file.read().strip() setuptools.setup( - name='kserve', + name='zillow-kserve', version=version, author="The KServe Authors", author_email='ellisbigelow@google.com, hejinchi@cn.ibm.com, dsun20@bloomberg.net', From 59644d82633fa949cad416b113d0dac0438a3ef6 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 13:03:55 -0800 Subject: [PATCH 02/11] Updated the release version and the release branch in gitlab CI --- .gitlab-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c54f4be9000..ab140b87faa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ include: - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' - ref: &include_ref 'v3' + ref: &include_ref 'v3' # TODO use v4? file: 'environments/devex.yml' - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' ref: *include_ref @@ -9,7 +9,8 @@ include: variables: PY_LIBRARY_NAME: "zillow-kserve" MAJOR_VERSION: "0" - MINOR_VERSION: "7" + MINOR_VERSION: "10" + RELEASE_BRANCH: "zillow/release-0.10.2" KSERVE_VERSION_PATH: "python/kserve/setup.py" PUBLISH: "true" @@ -18,10 +19,11 @@ stages: .version: &version | # Extract the open source KServe version as the basis for our forked library version. - KSERVE_VERSION=$(cat $KSERVE_VERSION_PATH | sed -nr "s/^ *version=['\"]([^'\"]*)['\"],/\1/p") + KSERVE_VERSION=$(cat python/VERSION) PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}" - if [ "${CI_COMMIT_BRANCH}" != "${CI_DEFAULT_BRANCH}" ]; then + if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then + # TODO Use . instead of . anyways ? PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}-dev.${CI_PIPELINE_IID}" # Ensure the image tag is compliant with PEP-440, IMAGE_TAG="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" From 4e15d37b8bf64c5c71177c659375e8a1c7274924 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:23:43 -0800 Subject: [PATCH 03/11] Added debug logs to gitlab ci --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab140b87faa..568f650147e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,10 @@ stages: .version: &version | # Extract the open source KServe version as the basis for our forked library version. KSERVE_VERSION=$(cat python/VERSION) + echo 'Kserve version is $KSERVE_VERSION' PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}" + echo 'Base PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION' if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then # TODO Use . instead of . anyways ? PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}-dev.${CI_PIPELINE_IID}" @@ -30,9 +32,11 @@ stages: else IMAGE_TAG="${PY_LIBRARY_VERSION}" fi + echo 'IMAGE_TAG is $IMAGE_TAG' # Only apply the KServe version to the python library as Docker versions do not have the concept of # build metadata and the "+" character causes errors. PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}+${KSERVE_VERSION}" + echo 'Final PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION' build:publish: extends: .aip_python_debian_image @@ -59,4 +63,3 @@ build:publish: - if: '$PUBLISH == "true"' # only trigger on zillow/ branches - if: '$CI_COMMIT_BRANCH =~ /^zillow.*/' - From e4de0fc32b8d5c700d5b151e4e0729de96054f63 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:41:53 -0800 Subject: [PATCH 04/11] Updated the sed command to replace the version. --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 568f650147e..52ab1c963d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,9 @@ include: - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' - ref: &include_ref 'v3' # TODO use v4? + ref: &include_ref 'v3' file: 'environments/devex.yml' - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' - ref: *include_ref + ref: *include_ref # TODO Use V4? file: '/blocks/python.yml' variables: @@ -45,7 +45,7 @@ build:publish: - *version # Now write back the zillow-kserve version back to the original location we found the original so # python package managers can reference it as they need the version stored internally. - - sed -i "s/\(version=['\"]\)[^'\"]*\(['\"]\)/\1${PY_LIBRARY_VERSION}\2/" $KSERVE_VERSION_PATH + - sed -i "s/version=version/version=\${PY_LIBRARY_VERSION}/" $KSERVE_VERSION_PATH - cd python/kserve - python setup.py sdist # Set up the configuration for Artifactory to publish the python package internally. From 26e4f49c595134f822b2c4cb5bc23a60f8a7651d Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:21:25 -0800 Subject: [PATCH 05/11] Update gitlab CI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52ab1c963d6..d4e17df4f6e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ build:publish: - *version # Now write back the zillow-kserve version back to the original location we found the original so # python package managers can reference it as they need the version stored internally. - - sed -i "s/version=version/version=\${PY_LIBRARY_VERSION}/" $KSERVE_VERSION_PATH + - sed -i "s/version=version/version=${PY_LIBRARY_VERSION}/" $KSERVE_VERSION_PATH - cd python/kserve - python setup.py sdist # Set up the configuration for Artifactory to publish the python package internally. From f25578791dd6d296e5220124a0dcd6315d8defc7 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:45:00 -0800 Subject: [PATCH 06/11] Fix --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4e17df4f6e..daa72a85221 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,10 +20,10 @@ stages: .version: &version | # Extract the open source KServe version as the basis for our forked library version. KSERVE_VERSION=$(cat python/VERSION) - echo 'Kserve version is $KSERVE_VERSION' + echo Kserve version is $KSERVE_VERSION PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}" - echo 'Base PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION' + echo Base PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then # TODO Use . instead of . anyways ? PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}-dev.${CI_PIPELINE_IID}" @@ -32,11 +32,11 @@ stages: else IMAGE_TAG="${PY_LIBRARY_VERSION}" fi - echo 'IMAGE_TAG is $IMAGE_TAG' + echo IMAGE_TAG is $IMAGE_TAG # Only apply the KServe version to the python library as Docker versions do not have the concept of # build metadata and the "+" character causes errors. PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}+${KSERVE_VERSION}" - echo 'Final PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION' + echo Final PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION build:publish: extends: .aip_python_debian_image From a5cadcc27f6865cc490878d36545c6267873659d Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:05:36 -0800 Subject: [PATCH 07/11] version id creation fix --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index daa72a85221..78d5b0666a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,8 +25,7 @@ stages: PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}" echo Base PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then - # TODO Use . instead of . anyways ? - PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}-dev.${CI_PIPELINE_IID}" + PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" # Ensure the image tag is compliant with PEP-440, IMAGE_TAG="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" else From be49d00974699db40bd61c9472e51ac637fb2f00 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:13:26 -0800 Subject: [PATCH 08/11] adding quotes around version number --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78d5b0666a5..defc52c9953 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,7 @@ build:publish: - *version # Now write back the zillow-kserve version back to the original location we found the original so # python package managers can reference it as they need the version stored internally. - - sed -i "s/version=version/version=${PY_LIBRARY_VERSION}/" $KSERVE_VERSION_PATH + - sed -i "s/version=version/version=\'${PY_LIBRARY_VERSION}\'/" $KSERVE_VERSION_PATH - cd python/kserve - python setup.py sdist # Set up the configuration for Artifactory to publish the python package internally. From 562db5f67215a5909696e29327fb24e65d6b1789 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:59:05 -0800 Subject: [PATCH 09/11] Removed the debug logs and simplified the logic in gitlab CI --- .gitlab-ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index defc52c9953..5b1699bb74d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,22 +20,16 @@ stages: .version: &version | # Extract the open source KServe version as the basis for our forked library version. KSERVE_VERSION=$(cat python/VERSION) - echo Kserve version is $KSERVE_VERSION PY_LIBRARY_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${CI_PIPELINE_IID}" - echo Base PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" - # Ensure the image tag is compliant with PEP-440, - IMAGE_TAG="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" - else - IMAGE_TAG="${PY_LIBRARY_VERSION}" fi - echo IMAGE_TAG is $IMAGE_TAG - # Only apply the KServe version to the python library as Docker versions do not have the concept of - # build metadata and the "+" character causes errors. + IMAGE_TAG="${PY_LIBRARY_VERSION}" + + # Suffix the KServe version to the python library version only, because Docker versions + # do not have the concept of build metadata and the "+" character causes errors. PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}+${KSERVE_VERSION}" - echo Final PY_LIBRARY_VERSION is $PY_LIBRARY_VERSION build:publish: extends: .aip_python_debian_image @@ -44,7 +38,8 @@ build:publish: - *version # Now write back the zillow-kserve version back to the original location we found the original so # python package managers can reference it as they need the version stored internally. - - sed -i "s/version=version/version=\'${PY_LIBRARY_VERSION}\'/" $KSERVE_VERSION_PATH + # - sed -i "s/version=version/version=\'${PY_LIBRARY_VERSION}\'/" $KSERVE_VERSION_PATH -- TODO remove? + - echo "${PY_LIBRARY_VERSION}" > python/VERSION - cd python/kserve - python setup.py sdist # Set up the configuration for Artifactory to publish the python package internally. From efbe5f03f35cb2fcc83014e57ab02055d901a42f Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:23:22 -0800 Subject: [PATCH 10/11] Moved to aip cicd v4 --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b1699bb74d..7ef88f4943c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,9 @@ include: - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' - ref: &include_ref 'v3' + ref: &include_ref 'v4' file: 'environments/devex.yml' - project: 'analytics/artificial-intelligence/ai-platform/aip-infrastructure/ci-templates/ci-cd-template' - ref: *include_ref # TODO Use V4? + ref: *include_ref file: '/blocks/python.yml' variables: @@ -36,9 +36,8 @@ build:publish: stage: build script: - *version - # Now write back the zillow-kserve version back to the original location we found the original so - # python package managers can reference it as they need the version stored internally. - # - sed -i "s/version=version/version=\'${PY_LIBRARY_VERSION}\'/" $KSERVE_VERSION_PATH -- TODO remove? + # Now write back the zillow-kserve version back to the original location we got it from, + # so python package managers can reference it as they need the version stored internally. - echo "${PY_LIBRARY_VERSION}" > python/VERSION - cd python/kserve - python setup.py sdist From 1aee9959888c2e6520ce496da65c0c919443bace Mon Sep 17 00:00:00 2001 From: Ash Kulkarni <51029169+akdigitalself@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:27:44 -0800 Subject: [PATCH 11/11] Removed IMAGE_TAG because it's obsolete. --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ef88f4943c..d8b18f20f0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,6 @@ stages: if [ "${CI_COMMIT_BRANCH}" != "${RELEASE_BRANCH}" ]; then PY_LIBRARY_VERSION="${PY_LIBRARY_VERSION}.dev${CI_PIPELINE_IID}" fi - IMAGE_TAG="${PY_LIBRARY_VERSION}" # Suffix the KServe version to the python library version only, because Docker versions # do not have the concept of build metadata and the "+" character causes errors.