Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
TakoB222 committed Oct 20, 2024
1 parent 87f8397 commit 39e5904
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
19 changes: 14 additions & 5 deletions pvcviewer-controller/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ platforms:

services:
pvcviewer-controller:
override: merge
command: "pvc-viewer"
command: /manager
override: replace
startup: enabled
user: ubuntu

Expand All @@ -23,16 +23,25 @@ parts:
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
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && \
dpkg-query --root=${CRAFT_PROJECT_DIR}/../bundles/ubuntu-22.04/rootfs/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) \
> ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query
pvcviewer-controller:
plugin: go
build-snaps:
- go/1.21/stable
- go/1.22/stable
source: https://github.com/kubeflow/kubeflow.git
source-tag: v1.9.0
source-depth: 1
source-tag: v1.9.0
build-environment:
- CGO_ENABLED: "0"
- GOOS: "linux"
source-subdir: components/pvcviewer-controller
override-build: |
cd $CRAFT_PART_SRC_WORK
go mod download
go build -a -o $CRAFT_PART_INSTALL/manager main.go
non-root-user:
plugin: nil
Expand Down
2 changes: 1 addition & 1 deletion pvcviewer-controller/tests/test_rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_rock(rock_test_env):
"exec",
"ls",
"-la",
"/bin/pvc-viewer",
"/manager",
],
check=True,
)
Expand Down
18 changes: 9 additions & 9 deletions pvcviewer-controller/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ allowlist_externals =
skopeo
yq
commands =
# export rock to docker
# export rock to docker
bash -c 'NAME=$(yq eval .name rockcraft.yaml) && \
VERSION=$(yq eval .version rockcraft.yaml) && \
ARCH=$(yq eval ".platforms | keys | .[0]" rockcraft.yaml) && \
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}.rock" && \
DOCKER_IMAGE=$NAME:$VERSION && \
echo "Exporting $ROCK to docker as $DOCKER_IMAGE" && \
skopeo --insecure-policy copy oci-archive:$ROCK docker-daemon:$DOCKER_IMAGE'
VERSION=$(yq eval .version rockcraft.yaml) && \
ARCH=$(yq eval ".platforms | keys | .[0]" rockcraft.yaml) && \
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}.rock" && \
DOCKER_IMAGE=$NAME:$VERSION && \
echo "Exporting $ROCK to docker as $DOCKER_IMAGE" && \
skopeo --insecure-policy copy oci-archive:$ROCK docker-daemon:$DOCKER_IMAGE'

[testenv:sanity]
passenv = *
deps =
pytest
charmed-kubeflow-chisme
commands =
# run rock tests
# run rock tests
pytest -s -v --tb native --show-capture=all --log-cli-level=INFO {posargs} {toxinidir}/tests

[testenv:integration]
passenv = *
allowlist_externals =
echo
commands =
# TODO: Implement integration tests here
# TODO: Implement integration tests here
echo "WARNING: This is a placeholder test - no test is implemented here."

0 comments on commit 39e5904

Please sign in to comment.