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

Add rockcraft.yaml for tensorboard-controller #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
57 changes: 57 additions & 0 deletions tensorboard-controller/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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-environment:
- CGO_ENABLED: 0
- GOOS: linux
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-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

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