Skip to content

Commit

Permalink
feat: update paddleserver for version 0.14.1 (#116)
Browse files Browse the repository at this point in the history
* feat: update pmmlserver for version 0.14.1

* Update rockcraft.yaml
  • Loading branch information
misohu authored Feb 11, 2025
1 parent 9527517 commit 99f7dc9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
4 changes: 2 additions & 2 deletions paddleserver/dummy_pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ description = ""
authors = ["none"]

[tool.poetry.dependencies]
# This range should match that used upstream: https://github.com/kserve/kserve/blob/v0.11.2/python/paddleserver/pyproject.toml#L13
python = ">=3.8,<3.11"
# This range should match that used upstream: https://github.com/kserve/kserve/blob/v0.14.1/python/paddleserver/pyproject.toml#L13C1-L13C23
python = ">=3.9,<3.13"
kserve = { path = "../python/kserve", develop = false }
paddleserver = { path = "../python/paddleserver", develop = false }

37 changes: 16 additions & 21 deletions paddleserver/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Based on https://github.com/kserve/kserve/blob/v0.13.0/python/paddle.Dockerfile
# Based on https://github.com/kserve/kserve/blob/v0.14.1/python/paddle.Dockerfile
#
# See ../CONTRIBUTING.md for more details about the patterns used in this rock.
# This rock is implemented with some atypical patterns due to the native of the upstream
# Dockerfile.
name: paddleserver
summary: Paddle server for Kserve deployments
description: "Kserve Paddle server"
version: "0.13.0"
version: "0.14.1"
license: Apache-2.0
base: [email protected]
platforms:
Expand All @@ -33,22 +33,19 @@ parts:
plugin: nil
source: https://github.com/kserve/kserve.git
source-subdir: python
source-tag: v0.13.0
source-tag: v0.14.1
build-packages:
- build-essential
- libgomp1
stage-packages:
- libgomp1
- python3.11
- python3.11-venv
overlay-packages:
- python3.10
# Including python3-pip here means pip also gets primed for the final rock
- python3-pip
- python3.11
override-build: |
# Populate the build system's python environment with all packages needed for
# the server in the final rock
# Ensure Python 3.11 is the default version
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
update-alternatives --set python3 /usr/bin/python3.11
# Setup poetry
pip install poetry==1.7.1
python3 -m pip install --upgrade pip setuptools poetry==1.8.3
poetry config virtualenvs.create false
# Install the kserve package, this specific server package, and their dependencies.
Expand All @@ -57,21 +54,19 @@ parts:
(cd python_env_builddir && poetry install --no-interaction --no-root)
# Promote the packages we've installed from the local env to the primed image
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.10/dist-packages
cp -fr /usr/local/lib/python3.10/dist-packages/* $CRAFT_PART_INSTALL/usr/local/lib/python3.10/dist-packages/
mkdir -p $CRAFT_PART_INSTALL/usr/local/lib/python3.11/dist-packages
cp -fr /usr/local/lib/python3.11/dist-packages/* $CRAFT_PART_INSTALL/usr/local/lib/python3.11/dist-packages/
# Ensure `python` is an executable command in our primed image by making
# a symbolic link
# Ensure `python` is an executable command in our primed image
mkdir -p $CRAFT_PART_INSTALL/usr/bin/
ln -s /usr/bin/python3.10 $CRAFT_PART_INSTALL/usr/bin/python
ln -s /usr/bin/python3.11 $CRAFT_PART_INSTALL/usr/bin/python
# Copy licenses
third-party:
plugin: nil
after: [python]
source: https://github.com/kserve/kserve.git
source-subdir: python
source-tag: v0.13.0
source-tag: v0.14.1
override-build: |
cp -fr third_party/* ${CRAFT_PART_INSTALL}/third_party
4 changes: 2 additions & 2 deletions paddleserver/tests/test_rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_rock(rock_test_env):
"/bin/bash",
LOCAL_ROCK_IMAGE,
"-c",
"ls -la /usr/local/lib/python3.10/dist-packages/paddleserver",
"ls -la /usr/local/lib/python3.11/dist-packages/paddleserver",
],
check=True,
)
Expand All @@ -59,7 +59,7 @@ def test_rock(rock_test_env):
"/bin/bash",
LOCAL_ROCK_IMAGE,
"-c",
"ls -la /usr/local/lib/python3.10/dist-packages/kserve",
"ls -la /usr/local/lib/python3.11/dist-packages/kserve",
],
check=True,
)
Expand Down
4 changes: 2 additions & 2 deletions paddleserver/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ commands =
passenv = *
allowlist_externals =
bash
skopeo
rockcraft
yq
commands =
# pack rock and export to docker
Expand All @@ -34,7 +34,7 @@ commands =
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}.rock" && \
DOCKER_IMAGE=$NAME:$VERSION && \
echo "Exporting $ROCK to docker as $DOCKER_IMAGE" && \
skopeo --insecure-policy copy oci-archive:$ROCK docker-daemon:$DOCKER_IMAGE'
rockcraft.skopeo --insecure-policy copy oci-archive:$ROCK docker-daemon:$DOCKER_IMAGE'

[testenv:sanity]
passenv = *
Expand Down

0 comments on commit 99f7dc9

Please sign in to comment.