logos-storage-nim-cs-dist-t.../docker/job-continuous-tests.yaml
E M 5bfbf11013
ci: pre-place openapi.yaml in runner pods via an initContainer
When running in CI, the runner pod does not have access to a Docker daemon,
so the StoragePlugin build cannot extract openapi.yaml from the storage image
itself. Each test job now runs an initContainer on the image under test
(STORAGEDOCKERIMAGE) that copies /logosstorage/openapi.yaml into a shared
volume; the entrypoint then places it into ProjectPlugins/LogosStorageClient
before the build.

run-dist-tests.yaml gains a STORAGEDOCKERIMAGE default so its job manifest
can resolve the initContainer image like the release and continuous jobs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 16:39:42 +10:00

86 lines
2.6 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: ${NAMEPREFIX}
namespace: ${NAMESPACE}
labels:
name: ${NAMEPREFIX}
runid: ${RUNID}
spec:
ttlSecondsAfterFinished: 86400
backoffLimit: 0
template:
metadata:
name: ${NAMEPREFIX}
labels:
app: continuous-tests-runner
name: ${NAMEPREFIX}
runid: ${RUNID}
spec:
priorityClassName: system-node-critical
nodeSelector:
workload-type: "tests-runners-ci"
initContainers:
# Extract openapi.yaml from the storage image under test into a shared volume.
# The runner pod has no Docker daemon, so the StoragePlugin build consumes this
# file instead of extracting it itself (see ProjectPlugins/LogosStorageClient).
- name: fetch-openapi
image: ${STORAGEDOCKERIMAGE}
imagePullPolicy: Always
command: ["cp", "/logosstorage/openapi.yaml", "/shared/openapi.yaml"]
volumeMounts:
- name: openapi
mountPath: /shared
containers:
- name: ${NAMEPREFIX}-runner
image: logosstorage/logos-storage-dist-tests:latest
imagePullPolicy: Always
resources:
requests:
memory: "1Gi"
env:
- name: KUBECONFIG
value: "/opt/kubeconfig.yaml"
- name: LOGPATH
value: "/var/log/storage-continuous-tests/${DEPLOYMENT_NAMESPACE}"
- name: NAMESPACE
value: "${NAMESPACE}"
- name: BRANCH
value: "${BRANCH}"
- name: SOURCE
value: "${SOURCE}"
- name: RUNID
value: "${RUNID}"
- name: STORAGEDOCKERIMAGE
value: "${STORAGEDOCKERIMAGE}"
- name: TESTID
value: "${TESTID}"
- name: DEPLOYMENT_NAMESPACE
value: "${DEPLOYMENT_NAMESPACE}"
- name: TESTS_TYPE
value: "continuous-tests"
- name: TESTS_TARGET_DURATION
value: "${TESTS_TARGET_DURATION}"
- name: TESTS_FILTER
value: "${TESTS_FILTER}"
- name: TESTS_CLEANUP
value: "${TESTS_CLEANUP}"
volumeMounts:
- name: kubeconfig
mountPath: /opt/kubeconfig.yaml
subPath: kubeconfig.yaml
- name: logs
mountPath: /var/log/storage-continuous-tests
- name: openapi
mountPath: /shared
restartPolicy: Never
volumes:
- name: kubeconfig
secret:
secretName: storage-dist-tests-app-kubeconfig
- name: logs
hostPath:
path: /var/log/storage-continuous-tests
- name: openapi
emptyDir: {}