diff --git a/sklearnserver/tox.ini b/sklearnserver/tox.ini index 8ed8612..2575ce0 100644 --- a/sklearnserver/tox.ini +++ b/sklearnserver/tox.ini @@ -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 @@ -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 && \