Skip to content

Commit

Permalink
Add rockcraft.yaml for tensorboard-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
manolis-andr committed Jul 24, 2023
1 parent 7af1462 commit 1fa9f02
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tensorboard-controller/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: tensorboard-controller
summary: An image for Tensorboard controller
description: |
This image is used as part of the Charmed Kubeflow product. The controller allows users to
create a custom resource "TensorBoard"
version: v1.7.0_22.04_1 # version format: <KF-upstream-version>_<base-version>_<Charmed-KF-version>
license: Apache-2.0
base: ubuntu:22.04
services:
tensorboard:
override: replace
summary: "tensorboard-controller service"
startup: enabled
user: ubuntu
command: "/manager"
platforms:
amd64:

parts:
tensorboard-controller:
plugin: go
source: https://github.com/kubeflow/kubeflow
source-type: git
source-tag: v1.7-branch # upstream branch
build-snaps:
- go
build-packages:
- apt
- bash
build-environment:
- CGO_ENABLED: 0
- GOOS: linux
stage-packages:
- bash
override-build: |
set -xe
cd $CRAFT_PART_SRC/components/tensorboard-controller/
# build
go mod tidy
go mod download all
go build -a -o manager main.go
# install build artifacts
mkdir -p $CRAFT_PART_INSTALL/
cp manager $CRAFT_PART_INSTALL/
# security requirement
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
non-root-user:
plugin: nil
after: [tensorboard-controller]
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

0 comments on commit 1fa9f02

Please sign in to comment.