Skip to content

Commit

Permalink
Rock for TWA
Browse files Browse the repository at this point in the history
Add rockcraft.yaml for tensorboards-web-app.

Signed-off-by: Dimitris Aragiorgis <[email protected]>
  • Loading branch information
dimara committed Jul 24, 2023
1 parent 7af1462 commit bfa1600
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 0 deletions.
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 }}
122 changes: 122 additions & 0 deletions tensorboards-web-app/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
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_1
license: Apache-2.0
base: ubuntu:20.04

services:
serve:
override: replace
summary: "tensorboards service"
command: gunicorn -w 3 --bind 0.0.0.0:5000 --access-logfile - entrypoint:app
startup: enabled
user: ubuntu
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

non-root-user:
plugin: nil
after: [ubuntu]
overlay-script: |
# Create a user in the $CRAFT_OVERLAY chroot
groupadd -R $CRAFT_OVERLAY -g 1001 ubuntu
useradd -R $CRAFT_OVERLAY -M -r -u 1001 -g ubuntu ubuntu
override-prime: |
craftctl default

0 comments on commit bfa1600

Please sign in to comment.