diff --git a/tensorboard-controller/rockcraft.yaml b/tensorboard-controller/rockcraft.yaml new file mode 100644 index 0000000..536c503 --- /dev/null +++ b/tensorboard-controller/rockcraft.yaml @@ -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: __ +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