[bitnami/spark] Add VIB tests (#34292)

* [bitnami/spark] Add VIB tests

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Add triggers

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Add group ownership check

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

* Remove triggers

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>

---------

Signed-off-by: Miguel Ruiz <miruiz@vmware.com>
This commit is contained in:
Miguel Ruiz
2023-05-29 08:33:28 +02:00
committed by GitHub
parent 18aba00b16
commit 6f85f13698
5 changed files with 87 additions and 5 deletions

12
.vib/spark/goss/goss.yaml Normal file
View File

@@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../spark/goss/spark.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-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

View File

@@ -0,0 +1,6 @@
command:
{{- range $module:= .Vars.python.modules }}
check-python-{{ $module }}:
exec: /opt/bitnami/spark/venv/bin/python -c 'import {{ $module }}'
exit-status: 0
{{- end }}

32
.vib/spark/goss/vars.yaml Normal file
View File

@@ -0,0 +1,32 @@
binaries:
- python
- spark-shell
- spark-submit
- java
directories:
- mode: "0775"
group: "root"
paths:
- /opt/bitnami/spark/tmp
- /opt/bitnami/spark/logs
- /opt/bitnami/spark/conf
- /opt/bitnami/spark/work
- /opt/bitnami/spark/jars
root_dir: /opt/bitnami
version:
bin_name: spark-shell --version
flag: --version
linked_libraries:
exclude_paths:
# Exclude specific Pip modules from paths because they link to non-existent libraries that are not expected to exist
- .*\/lib\/python[0-9.]+\/site-packages\/numpy.libs\/.*
- .*\/lib\/python[0-9.]+\/site-packages\/psycopg2_binary.libs\/.*
python:
modules:
- pyspark
- awscli
- boto3
- botocore
- psycopg2
- pandas
- py4j

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -33,6 +34,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "spark/goss/goss.yaml",
"vars_file": "spark/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-spark"
}
}
}
},
{
"action_id": "trivy",
"params": {
@@ -77,9 +93,9 @@
"url": "{VIB_ENV_PACKAGES_JSON_URL}",
"path": "/{VIB_ENV_PATH}",
"authn": {
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
"header": "Authorization",
"token": "Bearer {VIB_ENV_GITHUB_TOKEN}"
}
}
}
}

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -29,6 +30,21 @@
},
"verify": {
"actions": [
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "spark/goss/goss.yaml",
"vars_file": "spark/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-spark"
}
}
}
},
{
"action_id": "trivy",
"params": {