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

feat: patch for visualization server #35

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bokeh
gcsfs
google-api-python-client
itables
ipykernel
ipython
jupyter_client
nbconvert
nbformat
scikit_learn
tornado
mistune
47 changes: 28 additions & 19 deletions visualisation-server/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dockerfile: https://github.com/kubeflow/pipelines/blob/2.0.0-alpha.7/backend/Dockerfile.visualization
# Dockerfile: https://github.com/kubeflow/pipelines/blob/2.0.0/backend/Dockerfile.visualization
name: ml-pipeline-visualization-server
base: ubuntu:20.04
version: '2.0.0-alpha.7_20.04_1'
version: '2.0.0_20.04_1'
summary: ml-pipeline/visualization-server
description: |
ml-pipeline/visualization-server
Expand All @@ -13,7 +13,7 @@ run-user: _daemon_
services:
vis-server:
override: replace
command: python3.6 /server.py
command: python3 /server.py
startup: enabled

package-repositories:
Expand All @@ -22,20 +22,36 @@ package-repositories:
priority: always

parts:
patch:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, you can use the dump plugin: https://snapcraft.io/docs/dump-plugin

plugin: nil
source: .
override-build: |
cp backend/src/apiserver/visualization/requirements.in ${CRAFT_PART_INSTALL}/

python:
after: [patch]
plugin: python
source: https://github.com/kubeflow/pipelines.git
source-subdir: backend/src/apiserver/visualization
source-tag: 2.0.0-alpha.7
source-tag: 2.0.0
stage-packages:
- python3.6-venv
python-requirements:
- requirements.txt
- pip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need pip at the end?

- python3.8-venv
override-build: |
rm "${CRAFT_PART_INSTALL}"/usr/bin/python3.6m
ln -s python3.6 "${CRAFT_PART_INSTALL}"/usr/bin/python3
craftctl default

# install tensorflow*
python3.8 -m pip install pip install tensorflow==2.11.1 tensorflow-metadata tensorflow-model-analysis tensorflow-data-validation tensorflow-serving-api

# copy requirements.in from patch part
cp /root/parts/patch/install/requirements.in backend/src/apiserver/visualization/requirements.in

python3.8 -m pip install pip==22.0.4 setuptools --upgrade --quiet
python3.8 -m pip install pip-tools==5.4.0 --quiet
export PATH=$PATH:${CRAFT_PART_INSTALL}/usr/local/bin
pip-compile --verbose backend/src/apiserver/visualization/requirements.in
python3.8 -m pip install cython
python3.8 -m pip install -r backend/src/apiserver/visualization/requirements.txt --no-cache-dir

cp -r backend/src/apiserver/visualization/* ${CRAFT_PART_INSTALL}

gcloud:
plugin: nil
stage-packages:
Expand All @@ -50,10 +66,3 @@ parts:
tar -C "${CRAFT_PART_INSTALL}"/usr/local/gcloud -xf /tmp/google-cloud-sdk.tar.gz
"${CRAFT_PART_INSTALL}"/usr/local/gcloud/google-cloud-sdk/install.sh
cp backend/src/apiserver/visualization/server.py $CRAFT_PART_INSTALL

files:
plugin: nil
source: https://github.com/kubeflow/pipelines.git
source-tag: 2.0.0-alpha.7
override-build: |
cp -r backend/src/apiserver/visualization/* $CRAFT_PART_INSTALL