Skip to content

Commit

Permalink
feat: reverted to use shell and yq vs test class
Browse files Browse the repository at this point in the history
Summary of changes:
- Reverted to use of shell commands and `yq` instead of CheckRock test
  class from chisme package.

NOTE: Use of bash shell commands significantly reduces maintability of
tox.ini
  • Loading branch information
Ivan Chvets committed Jun 15, 2023
1 parent 2c6fc8d commit 9bd3ee8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sklearnserver/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ deps =
commands =
# build and pack rock
rockcraft pack
bash -c 'ROCK=$(python -c '\''from charmed_kubeflow_chisme.rock import CheckRock; \
print(CheckRock("rockcraft.yaml").get_image_name())'\'') && \
VERSION=$(python -c '\''from charmed_kubeflow_chisme.rock import CheckRock; \
print(CheckRock("rockcraft.yaml").get_version())'\'') && \
bash -c 'NAME=$(yq eval .name rockcraft.yaml) && \
VERSION=$(yq eval .version rockcraft.yaml) && \
ARCH=$(yq eval ".platforms | keys" rockcraft.yaml | awk -F " " '\''{ print $2 }'\'') && \
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}" && \
sudo skopeo --insecure-policy copy oci-archive:$ROCK.rock docker-daemon:$ROCK:$VERSION'
# run rock tests
Expand Down Expand Up @@ -60,10 +60,10 @@ commands =
# replace jinja2 templated value with yq safe placeholder
sed -i "s/namespace: {{ namespace }}/namespace: YQ_SAFE/" {env:LOCAL_CHARM_DIR}/src/templates/configmap.yaml.j2
# upload rock to docker and microk8s cache, replace charm's container with local rock reference
bash -c 'ROCK=$(python -c '\''from charmed_kubeflow_chisme.rock import CheckRock; \
print(CheckRock("rockcraft.yaml").get_image_name())'\'') && \
VERSION=$(python -c '\''from charmed_kubeflow_chisme.rock import CheckRock; \
print(CheckRock("rockcraft.yaml").get_version())'\'') && \
bash -c 'NAME=$(yq eval .name rockcraft.yaml) && \
VERSION=$(yq eval .version rockcraft.yaml) && \
ARCH=$(yq eval ".platforms | keys" rockcraft.yaml | awk -F " " '\''{ print $2 }'\'') && \
ROCK="$\{NAME\}_$\{VERSION\}_$\{ARCH\}" && \
sudo skopeo --insecure-policy copy oci-archive:$ROCK.rock docker-daemon:$ROCK:$VERSION && \
docker save $ROCK > $ROCK.tar && \
microk8s ctr image import $ROCK.tar --digests=true && \
Expand Down

0 comments on commit 9bd3ee8

Please sign in to comment.