diff --git a/.vib/jax/goss/goss.yaml b/.vib/jax/goss/goss.yaml new file mode 100644 index 0000000000000..6e0760bc1885f --- /dev/null +++ b/.vib/jax/goss/goss.yaml @@ -0,0 +1,14 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +gossfile: + # Goss tests exclusive to the current container + ../../jax/goss/jax.yaml: {} + # Load scripts from .vib/common/goss/templates + ../../common/goss/templates/check-app-version.yaml: {} + ../../common/goss/templates/check-binaries.yaml: {} + ../../common/goss/templates/check-broken-symlinks.yaml: {} + ../../common/goss/templates/check-ca-certs.yaml: {} + ../../common/goss/templates/check-directories.yaml: {} + ../../common/goss/templates/check-linked-libraries.yaml: {} + ../../common/goss/templates/check-spdx.yaml: {} diff --git a/.vib/jax/goss/jax.yaml b/.vib/jax/goss/jax.yaml new file mode 100644 index 0000000000000..e878f38c0621e --- /dev/null +++ b/.vib/jax/goss/jax.yaml @@ -0,0 +1,15 @@ +# Copyright VMware, Inc. +# SPDX-License-Identifier: APACHE-2.0 + +user: + jax: + exists: true + uid: 1001 + gid: 0 +command: + run-jax: + exec: python -c 'import jax.numpy as jnp; from jax import grad, jit, vmap; from jax import random; key = random.PRNGKey(0); x = random.normal(key, (10,)); print(x)' + timeout: 8000 + exit-status: 0 + stdout: + - 0.3721109 diff --git a/.vib/jax/goss/vars.yaml b/.vib/jax/goss/vars.yaml new file mode 100644 index 0000000000000..8faf592e06ada --- /dev/null +++ b/.vib/jax/goss/vars.yaml @@ -0,0 +1,10 @@ +binaries: + - python +root_dir: /opt/bitnami +directories: + - paths: + # Paths to the client and server directories + - /opt/bitnami/python +version: + bin_name: python + flag: "-c 'import jax; print(jax.__version__)'" diff --git a/.vib/jax/vib-publish.json b/.vib/jax/vib-publish.json new file mode 100644 index 0000000000000..d65504925038a --- /dev/null +++ b/.vib/jax/vib-publish.json @@ -0,0 +1,123 @@ +{ + "context": { + "resources": { + "url": "{VIB_ENV_CONTAINER_URL}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + }, + "architectures": [ + "linux/amd64", + "linux/arm64" + ] + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "jax/goss/goss.yaml", + "vars_file": "jax/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-jax" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": [ + "OS" + ] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": [ + "OS" + ] + } + }, + { + "action_id": "osspi-application", + "params": { + "additional_packages_file": "osspi-packages-amd64.json", + "scan_type": "BASE_OS", + "osm": { + "associated_bossd_release": "{VIB_ENV_BOSSD_RELEASE_ID}", + "product_name": "main-catalog-{VIB_ENV_CONTAINER}", + "product_version": "{VIB_ENV_APP_VERSION}-{VIB_ENV_OS_FLAVOUR}-container", + "architecture_overrides": [ + { + "architecture": "linux/amd64", + "product_version": "{VIB_ENV_APP_VERSION}-{VIB_ENV_OS_FLAVOUR}-container", + "additional_packages_file": "osspi-packages-amd64.json" + }, + { + "architecture": "linux/arm64", + "product_version": "{VIB_ENV_APP_VERSION}-{VIB_ENV_OS_FLAVOUR}-container-arm64", + "additional_packages_file": "osspi-packages-arm64.json" + } + ] + }, + "resources": { + "url": "{VIB_ENV_PACKAGES_JSON_URL}", + "path": "/{VIB_ENV_PATH}", + "authn": { + "header": "Authorization", + "token": "Bearer {VIB_ENV_GITHUB_TOKEN}" + } + } + } + } + ] + }, + "publish": { + "actions": [ + { + "action_id": "container-image-publish", + "params": { + "metadata": { + "tags": {VIB_ENV_ROLLING_TAGS} + }, + "repository": { + "kind": "OCI", + "url": "{VIB_ENV_REGISTRY_URL}", + "username": "{VIB_ENV_REGISTRY_USERNAME}", + "password": "{VIB_ENV_REGISTRY_PASSWORD}" + } + } + } + ] + } + } +} diff --git a/.vib/jax/vib-verify.json b/.vib/jax/vib-verify.json new file mode 100644 index 0000000000000..05a5323bae776 --- /dev/null +++ b/.vib/jax/vib-verify.json @@ -0,0 +1,65 @@ +{ + "context": { + "resources": { + "url": "{SHA_ARCHIVE}", + "path": "{VIB_ENV_PATH}" + }, + "runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd" + }, + "phases": { + "package": { + "actions": [ + { + "action_id": "container-image-package", + "params": { + "application": { + "details": { + "name": "{VIB_ENV_CONTAINER}", + "tag": "{VIB_ENV_TAG}" + } + } + } + }, + { + "action_id": "container-image-lint", + "params": { + "threshold": "error" + } + } + ] + }, + "verify": { + "actions": [ + { + "action_id": "goss", + "params": { + "resources": { + "path": "/.vib" + }, + "tests_file": "jax/goss/goss.yaml", + "vars_file": "jax/goss/vars.yaml", + "remote": { + "pod": { + "workload": "deploy-jax" + } + } + } + }, + { + "action_id": "trivy", + "params": { + "threshold": "CRITICAL", + "vuln_type": ["OS"] + } + }, + { + "action_id": "grype", + "params": { + "threshold": "CRITICAL", + "package_type": ["OS"] + } + } + ] + } + } +}