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

Rock for TWA #30

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions .github/workflows/build_and_scan_rocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- kfam
- notebook-controller
- volumes-web-app
- tensorboards-web-app
uses: canonical/charmed-kubeflow-workflows/.github/workflows/build_and_scan_rock.yaml@main
with:
rock: ${{ matrix.rock }}
112 changes: 112 additions & 0 deletions tensorboards-web-app/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: tensorboards-web-app
summary: Tensorboards Web App
description: |
This web app is responsible for allowing the user to manipulate Tensorboard
instances in their Kubeflow cluster. To achieve this it provides a user
friendly way to handle the lifecycle of Tensorboard CRs.
version: v1.7.0_20.04_1
license: Apache-2.0
base: ubuntu:20.04

run-user: _daemon_
services:
serve:
override: replace
summary: "tensorboards service"
command: gunicorn -w 3 --bind 0.0.0.0:5000 --access-logfile - entrypoint:app
startup: enabled
environment:
NODE_ENV: production
platforms:
amd64:

parts:
security-team-requirement:
plugin: nil
override-build: |
mkdir -p ${CRAFT_PART_INSTALL}/usr/share/rocks
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query

backend:
plugin: nil
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
source-depth: 1
build-packages:
- python3-venv
- python3-setuptools
- python3-pip
override-build: |
python3 -m pip install wheel
cd components/crud-web-apps/common/backend
python3 setup.py bdist_wheel
# XXX: Upstream has a hardcoded/dummy version=1.1 in setup.py
cp dist/kubeflow-1.1-py3-none-any.whl $CRAFT_STAGE

frontend-lib:
plugin: nil
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
source-depth: 1
build-snaps:
- node/12/stable
build-environment:
- NG_CLI_ANALYTICS: "ci"
override-build: |
cd components/crud-web-apps/common/frontend/kubeflow-common-lib
npm ci
npm run build
cp -r dist/kubeflow/ $CRAFT_STAGE

frontend:
after: [frontend-lib]
plugin: nil
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
source-depth: 1
build-snaps:
- node/12/stable
build-environment:
- NG_CLI_ANALYTICS: "ci"
override-build: |
cd components/crud-web-apps/tensorboards/frontend
npm ci
cp -r $CRAFT_STAGE/kubeflow/ ./node_modules/ # TODO confirm
npm run build -- --output-path=./dist --configuration=production
cp -r dist $CRAFT_STAGE

webapp:
after: [backend, frontend]
plugin: nil
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
source-depth: 1
build-packages:
- python3-venv
- python3-setuptools
- python3-pip
override-build: |
pip3 install $CRAFT_STAGE/kubeflow-1.1-py3-none-any.whl
cd components/crud-web-apps/tensorboards/backend
cp -r $CRAFT_STAGE/dist/ app/static/
cp -r app $CRAFT_STAGE/
cp entrypoint.py $CRAFT_STAGE
override-stage: |
cp -r app $CRAFT_PRIME
cp entrypoint.py $CRAFT_PRIME
# XXX: Ubuntu 20.04 has Python 3.8
cp -r /usr/local/lib/python3.8/dist-packages/* $CRAFT_PRIME

gunicorn:
plugin: python
source: https://github.com/kubeflow/kubeflow.git
source-tag: v1.7-branch # upstream branch
source-depth: 1
python-requirements:
- components/crud-web-apps/tensorboards/backend/requirements.txt
stage-packages:
- python3-venv