Skip to content

Commit

Permalink
OPCT-289: Bump workflows for v0.5.0-alpha.5/plugin refact (#104)
Browse files Browse the repository at this point in the history
Adjusting plugin manifest for the standard workflow to the new plugin
archictecture, introducing the replay plugin also supported when
redhat-openshift-ecosystem/provider-certification-plugins#57
is merged.

blocked by
redhat-openshift-ecosystem/provider-certification-plugins#57
  • Loading branch information
mtulio authored Aug 7, 2024
1 parent ed7ee37 commit 3f09909
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 143 deletions.
2 changes: 2 additions & 0 deletions data/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestDataTemplatesPluginsManifests(t *testing.T) {
want := []string{
"templates/plugins/openshift-artifacts-collector.yaml",
"templates/plugins/openshift-cluster-upgrade.yaml",
"templates/plugins/openshift-conformance-replay.yaml",
"templates/plugins/openshift-conformance-validated.yaml",
"templates/plugins/openshift-kube-conformance.yaml",
}
Expand Down Expand Up @@ -56,6 +57,7 @@ func TestDataTemplatesPluginsManifests(t *testing.T) {
assert.Equal(t, want, got, "plugin manifests are readable")
},
},
// TODO: add test for plugin manifest content are rendered as expected.
}

efs.UpdateData(&testTemplatesPluginsAll)
Expand Down
54 changes: 20 additions & 34 deletions data/templates/plugins/openshift-artifacts-collector.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,41 @@
---
podSpec:
restartPolicy: Never
serviceAccountName: sonobuoy-serviceaccount
priorityClassName: system-node-critical
volumes:
- name: shared
emptyDir: {}
containers:
- name: report-progress
image: "{{ .PluginsImage }}"
imagePullPolicy: Always
priorityClassName: system-node-critical
command: ["./report-progress.sh"]
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
env:
- name: PLUGIN_ID
value: "99"
- name: ENV_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ENV_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ENV_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
sonobuoy-config:
driver: Job
plugin-name: 99-openshift-artifacts-collector
result-format: raw
description: The OpenShift Provider Certification Tool artifacts collector executed on the post-certification.
source-url: https://github.com/redhat-openshift-ecosystem/provider-certification-tool/blob/main/manifests/openshift-artifacts-collector.yaml
description: |
OPCT artifacts plugin collects the artifacts from the OpenShift Container
Platform post-validation.
source-url:
"https://github.com/redhat-openshift-ecosystem/provider-certification-tool/\
blob/main/manifests/openshift-artifacts-collector.yaml"
skipCleanup: true
spec:
name: plugin
image: "{{ .PluginsImage }}"
image: "{{ .CollectorImage }}"
imagePullPolicy: Always
command: ["/bin/bash", "/plugin/entrypoint-collector.sh"]
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
env:
- name: PLUGIN_ID
value: "99"
- name: PLUGIN_NAME
value: "openshift-artifacts-collector"
- name: PLUGIN_BLOCKED_BY
value: "80-openshift-tests-replay"
- name: IMAGE_OVERRIDE_MUST_GATHER
value: "{{ .MustGatherMonitoringImage }}"
- name: ENV_NODE_NAME
valueFrom:
fieldRef:
Expand Down Expand Up @@ -77,4 +64,3 @@ spec:
name: plugins-config
key: mirror-registry
optional: true

97 changes: 67 additions & 30 deletions data/templates/plugins/openshift-cluster-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,91 @@
---
podSpec:
restartPolicy: Never
serviceAccountName: sonobuoy-serviceaccount
priorityClassName: system-node-critical
volumes:
- name: shared
emptyDir: {}
containers:
- name: report-progress
initContainers:
- name: sync
image: "{{ .PluginsImage }}"
imagePullPolicy: Always
priorityClassName: system-node-critical
command: ["./report-progress.sh"]
command:
- "/bin/bash"
- "-c"
- "cp -vf ./entrypoint-tests.sh ./platform.sh /tmp/shared/"
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
- mountPath: /tmp/shared
name: shared
- name: login
image: "{{ .OpenshiftTestsImage }}"
imagePullPolicy: Always
command:
- "/bin/bash"
- "-c"
- |
/usr/bin/oc login "${KUBE_API_URL}" \
--token="$(cat "${SA_TOKEN_PATH}")" \
--certificate-authority="${SA_CA_PATH}";
env:
- name: PLUGIN_ID
value: "05"
- name: ENV_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ENV_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ENV_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KUBECONFIG
value: "/tmp/shared/kubeconfig"
- name: KUBE_API_URL
value: "https://172.30.0.1:443"
- name: SA_TOKEN_PATH
value: "/var/run/secrets/kubernetes.io/serviceaccount/token"
- name: SA_CA_PATH
value: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
volumeMounts:
- mountPath: /tmp/shared
name: shared
containers:
- name: tests
image: "{{ .OpenshiftTestsImage }}"
imagePullPolicy: Always
volumeMounts:
- mountPath: /tmp/shared
name: shared
command: ["/bin/bash", "/tmp/shared/entrypoint-tests.sh"]
env:
- name: KUBECONFIG
value: /tmp/shared/kubeconfig
- name: DEFAULT_SUITE_NAME
value: "none"
- name: OT_RUN_COMMAND
value: "run-upgrade"
- name: PLUGIN_NAME
value: "openshift-cluster-upgrade"

sonobuoy-config:
driver: Job
plugin-name: 05-openshift-cluster-upgrade
result-format: junit
description: The end-to-end tests maintained by OpenShift to certify the Provider running the OpenShift Container Platform.
source-url: https://github.com/redhat-openshift-ecosystem/provider-certification-tool/blob/main/manifests/openshift-conformance-validated.yaml
description: |
The end-to-end tests maintained by OpenShift to validate provider
running the OpenShift Container Platform.
source-url:
"https://github.com/redhat-openshift-ecosystem/provider-certification-tool/\
blob/main/manifests/openshift-conformance-validated.yaml"
skipCleanup: true
spec:
name: plugin
image: "{{ .PluginsImage }}"
command:
- "/bin/sh"
- "-c"
- "/usr/bin/openshift-tests-plugin run --name ${PLUGIN_NAME}"
imagePullPolicy: Always
priorityClassName: system-node-critical
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
env:
- name: KUBECONFIG
value: /tmp/shared/kubeconfig
- name: PLUGIN_NAME
value: "openshift-cluster-upgrade"
- name: PLUGIN_ID
value: "05"
- name: ENV_NODE_NAME
Expand Down Expand Up @@ -78,4 +116,3 @@ spec:
name: plugins-config
key: mirror-registry
optional: true

118 changes: 118 additions & 0 deletions data/templates/plugins/openshift-conformance-replay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
podSpec:
restartPolicy: Never
serviceAccountName: sonobuoy-serviceaccount
priorityClassName: system-node-critical
volumes:
- name: shared
emptyDir: {}
initContainers:
- name: sync
image: "{{ .PluginsImage }}"
imagePullPolicy: Always
command:
- "/bin/bash"
- "-c"
- "cp -vf ./entrypoint-tests.sh ./platform.sh /tmp/shared/"
volumeMounts:
- mountPath: /tmp/shared
name: shared
- name: login
image: "{{ .OpenshiftTestsImage }}"
imagePullPolicy: Always
command:
- "/bin/bash"
- "-c"
- |
/usr/bin/oc login "${KUBE_API_URL}" \
--token="$(cat "${SA_TOKEN_PATH}")" \
--certificate-authority="${SA_CA_PATH}";
env:
- name: KUBECONFIG
value: /tmp/shared/kubeconfig
- name: KUBE_API_URL
value: "https://172.30.0.1:443"
- name: SA_TOKEN_PATH
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: SA_CA_PATH
value: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
volumeMounts:
- mountPath: /tmp/shared
name: shared
containers:
- name: tests
image: "{{ .OpenshiftTestsImage }}"
imagePullPolicy: Always
volumeMounts:
- mountPath: /tmp/shared
name: shared
command: ["/bin/bash", "/tmp/shared/entrypoint-tests.sh"]
env:
- name: KUBECONFIG
value: /tmp/shared/kubeconfig
- name: PLUGIN_NAME
value: openshift-tests-replay
- name: DEFAULT_SUITE_NAME
value: all
- name: OT_RUN_COMMAND
value: run

sonobuoy-config:
driver: Job
plugin-name: 80-openshift-tests-replay
result-format: junit
description: |
OPCT plugin to collect e2e failures from previous executions and
schedule a new execution running in serial mode with openshift-tests.
source-url: |
https://github.com/redhat-openshift-ecosystem/provider-certification-tool/\
blob/main/manifests/openshift-conformance-validated.yaml
skipCleanup: true
spec:
name: plugin
image: "{{ .PluginsImage }}"
command:
- "/bin/sh"
- "-c"
- "/usr/bin/openshift-tests-plugin run --name ${PLUGIN_NAME}"
imagePullPolicy: Always
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
- mountPath: /tmp/shared
name: shared
env:
- name: KUBECONFIG
value: /tmp/shared/kubeconfig
- name: PLUGIN_NAME
value: openshift-tests-replay
- name: PLUGIN_ID
value: "80"
- name: ENV_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ENV_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ENV_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: RUN_MODE
valueFrom:
configMapKeyRef:
name: plugins-config
key: run-mode
- name: DEV_MODE_COUNT
valueFrom:
configMapKeyRef:
name: plugins-config
key: dev-count
- name: MIRROR_IMAGE_REPOSITORY
valueFrom:
configMapKeyRef:
name: plugins-config
key: mirror-registry
optional: true
Loading

0 comments on commit 3f09909

Please sign in to comment.