From fb1cf952d85fd7ce06c2cc370344b40d612708d5 Mon Sep 17 00:00:00 2001 From: Ash Kulkarni Date: Mon, 8 Jan 2024 15:20:51 -0800 Subject: [PATCH] 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',