-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rockcraft.yaml for tensorboards-web-app. Signed-off-by: Dimitris Aragiorgis <[email protected]>
- Loading branch information
Showing
2 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |