Skip to content

Commit

Permalink
OPSEXP-2439 Helm test with dtas (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Feb 2, 2024
1 parent d245e64 commit c1bd8b9
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Wait ACS to warm up
run: sleep 60

- uses: nick-fields/retry@v2
- uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v.3.0.0
id: newman
if: matrix.name == 'alfresco-content-services'
with:
Expand Down
65 changes: 46 additions & 19 deletions .github/workflows/helm-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,36 +87,50 @@ jobs:
ingress-nginx-ref: controller-v1.8.2

- name: Set nginx ingress config
run: |
kubectl -n ingress-nginx patch cm ingress-nginx-controller \
-p '{"data": {"allow-snippet-annotations":"true"}}'
run: >-
kubectl -n ingress-nginx patch cm ingress-nginx-controller
-p '{"data": {"allow-snippet-annotations":"true"}}'
- name: Create registries auth secret
run: |
kubectl create secret generic regcred \
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
run: >-
kubectl create secret generic regcred
--from-file=.dockerconfigjson=$HOME/.docker/config.json
--type=kubernetes.io/dockerconfigjson
- name: Check if cgroup v2 workaround is needed
id: extra-values
id: cgroupv2-workaround-extra-values
run: |
acs_version=$(echo ${{ matrix.values }} | cut -d'.' -f1,2)
is_affected=$(echo "$acs_version <= 7.2" | bc -l)
if [ "$is_affected" -eq 1 ]; then
echo "Enabling cgroupv v2 workaround"
echo "helm_install_params=--values test/cgroup-v2-workaround-values.yaml" >> "$GITHUB_OUTPUT"
fi
- name: Helm install
- name: Check if we want additional helm customizations
id: configurable-extra-values
run: |
helm dep up ./helm/alfresco-content-services
helm install acs ./helm/alfresco-content-services \
--set global.search.sharedSecret="$(openssl rand -hex 24)" \
--set global.known_urls=http://localhost \
--set global.alfrescoRegistryPullSecrets=regcred \
--wait --timeout 6m0s \
--values helm/${{ matrix.name }}/${{ matrix.values }} \
--values test/enterprise-integration-test-values.yaml \
${{ steps.extra-values.outputs.helm_install_params }}
if [ "${{ matrix.values }}" = "values.yaml" ]; then
echo "Enabling clustered tests"
echo "helm_install_params=--set alfresco-repository.replicaCount=2 --set dtas.additionalArgs[0]='-k not test_renditions'" >> "$GITHUB_OUTPUT"
fi
if [ "${{ matrix.values }}" = "7.0.N_values.yaml" ]; then
echo "Skipping renditions tests on ACS 7.0.N"
echo "helm_install_params=--set dtas.additionalArgs[0]='-k not test_renditions'" >> "$GITHUB_OUTPUT"
fi
- name: Helm install
run: >-
helm dep up ./helm/alfresco-content-services &&
helm install acs ./helm/alfresco-content-services
--set global.search.sharedSecret="$(openssl rand -hex 24)"
--set global.known_urls=http://localhost
--set global.alfrescoRegistryPullSecrets=regcred
--wait --timeout 7m0s
--values helm/${{ matrix.name }}/${{ matrix.values }}
--values test/enterprise-integration-test-values.yaml
${{ steps.cgroupv2-workaround-extra-values.outputs.helm_install_params }}
${{ steps.configurable-extra-values.outputs.helm_install_params }}
- name: Spit cluster status after install
if: always()
Expand All @@ -125,7 +139,8 @@ jobs:
kubectl get all --all-namespaces
kubectl describe pod
- uses: nick-fields/retry@v2
- name: Run Newman tests
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v.3.0.0
id: newman
with:
timeout_minutes: 1
Expand All @@ -137,9 +152,21 @@ jobs:
-t postman/newman run /etc/postman/helm/acs-test-helm-collection.json
--global-var protocol=http --global-var url=localhost
- name: Spit cluster status after tests
- name: Spit cluster status after newman tests
if: always() && steps.newman.outcome != 'skipped'
run: |
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod
- name: Run helm test
id: helm_test
run: helm test acs

- name: Spit cluster status after helm test
if: always() && steps.helm_test.outcome != 'skipped'
run: |
kubectl logs -l app.kubernetes.io/component=dtas --tail=-1
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod
2 changes: 1 addition & 1 deletion docs/helm/values/local-dev-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ alfresco-transform-service:
cpu: "0.01"
memory: "256Mi"
limits:
memory: "512Mi"
memory: "1Gi"
replicaCount: 1
libreoffice:
resources:
Expand Down
5 changes: 5 additions & 0 deletions helm/alfresco-content-services/23.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ alfresco-connector-ms365:
alfresco-connector-msteams:
image:
tag: 2.0.0
dtas:
config:
assertions:
acs:
version: 23.1.1
12 changes: 12 additions & 0 deletions helm/alfresco-content-services/7.0.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ alfresco-control-center:
global:
search:
securecomms: none
dtas:
config:
assertions:
acs:
version: 7.0.1
modules:
- id: org.alfresco.integrations.google.docs
version: 3.2.1.3
installed: true
- id: alfresco-aos-module
version: 1.4.0.1
installed: true
12 changes: 12 additions & 0 deletions helm/alfresco-content-services/7.1.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,15 @@ alfresco-control-center:
global:
search:
securecomms: none
dtas:
config:
assertions:
acs:
version: 7.1.1
modules:
- id: org.alfresco.integrations.google.docs
version: 3.2.1.3
installed: true
- id: alfresco-aos-module
version: 1.4.0.1
installed: true
12 changes: 12 additions & 0 deletions helm/alfresco-content-services/7.2.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,15 @@ alfresco-connector-ms365:
alfresco-connector-msteams:
image:
tag: 1.1.0
dtas:
config:
assertions:
acs:
version: 7.2.1
modules:
- id: org.alfresco.integrations.google.docs
version: 3.2.1.3
installed: true
- id: alfresco-aos-module
version: 1.4.1
installed: true
12 changes: 12 additions & 0 deletions helm/alfresco-content-services/7.3.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,15 @@ alfresco-connector-ms365:
alfresco-connector-msteams:
image:
tag: 1.1.0
dtas:
config:
assertions:
acs:
version: 7.3.1
modules:
- id: org.alfresco.integrations.google.docs
version: 3.3.0
installed: true
- id: alfresco-aos-module
version: 1.5.0
installed: true
12 changes: 12 additions & 0 deletions helm/alfresco-content-services/7.4.N_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,15 @@ alfresco-connector-ms365:
alfresco-connector-msteams:
image:
tag: 2.0.0
dtas:
config:
assertions:
acs:
version: 7.4.1
modules:
- id: org.alfresco.integrations.google.docs
version: 3.4.2
installed: true
- id: alfresco-aos-module
version: 1.6.2
installed: true
18 changes: 18 additions & 0 deletions helm/alfresco-content-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,24 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| database.sync.user | string | `nil` | External Postgresql database user |
| database.url | string | `nil` | External Postgresql jdbc url ex: `jdbc:postgresql://oldfashioned-mule-postgresql-acs:5432/alfresco` |
| database.user | string | `nil` | External Postgresql database user |
| dtas.additionalArgs | list | `[]` | |
| dtas.config.assertions.acs.edition | string | `"Enterprise"` | |
| dtas.config.assertions.acs.identity | bool | `false` | |
| dtas.config.assertions.acs.modules[0].id | string | `"org.alfresco.integrations.google.docs"` | |
| dtas.config.assertions.acs.modules[0].installed | bool | `true` | |
| dtas.config.assertions.acs.modules[0].version | string | `"4.0.0"` | |
| dtas.config.assertions.acs.modules[1].id | string | `"alfresco-aos-module"` | |
| dtas.config.assertions.acs.modules[1].installed | bool | `true` | |
| dtas.config.assertions.acs.modules[1].version | string | `"2.0.0"` | |
| dtas.config.assertions.acs.version | string | `"23.2.0"` | |
| dtas.config.assertions.adw.base_path | string | `"/workspace"` | |
| dtas.config.config.host | string | `"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local"` | |
| dtas.config.config.password | string | `"admin"` | |
| dtas.config.config.username | string | `"admin"` | |
| dtas.enabled | bool | `false` | Enables the deployment test suite which can run via `helm test` (currently available for Enterprise only) |
| dtas.image.pullPolicy | string | `"IfNotPresent"` | |
| dtas.image.repository | string | `"quay.io/alfresco/alfresco-deployment-test-automation-scripts"` | |
| dtas.image.tag | string | `"v1.5.1"` | |
| elasticsearch.clusterHealthCheckParams | string | `"wait_for_status=yellow&timeout=1s"` | |
| elasticsearch.enabled | bool | `false` | Enables the embedded elasticsearch cluster |
| elasticsearch.replicas | int | `1` | |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.dtas.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: dtas-config
data:
config.json: {{ .Values.dtas.config | toJson | quote }}
{{- end -}}
31 changes: 31 additions & 0 deletions helm/alfresco-content-services/templates/test/pod-dtas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.dtas.enabled -}}
apiVersion: v1
kind: Pod
metadata:
name: dtas-{{ randAlpha 5 | lower }}
annotations:
"helm.sh/hook": test
labels:
{{- include "alfresco-content-services.labels" . | nindent 4 }}
app.kubernetes.io/component: dtas
spec:
containers:
- name: dtas
image: {{ .Values.dtas.image.repository }}:{{ .Values.dtas.image.tag }}
imagePullPolicy: {{ .Values.dtas.image.pullPolicy }}
args:
- --configuration=/usr/src/dtas/config/config.json
{{- range .Values.dtas.additionalArgs }}
- {{ . }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /usr/src/dtas/config
volumes:
- name: config-volume
configMap:
name: dtas-config
restartPolicy: Never
imagePullSecrets:
- name: {{ .Values.global.alfrescoRegistryPullSecrets}}
{{- end -}}
28 changes: 28 additions & 0 deletions helm/alfresco-content-services/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,31 @@ elasticsearch:
enabled: false
replicas: 1
clusterHealthCheckParams: "wait_for_status=yellow&timeout=1s"

dtas:
# -- Enables the deployment test suite which can run via `helm test` (currently available for Enterprise only)
enabled: false
image:
repository: quay.io/alfresco/alfresco-deployment-test-automation-scripts
tag: v1.5.1
pullPolicy: IfNotPresent
additionalArgs: []
config:
config:
host: http://ingress-nginx-controller.ingress-nginx.svc.cluster.local
username: admin
password: admin
assertions:
acs:
edition: Enterprise
version: 23.2.0
identity: false
modules:
- id: org.alfresco.integrations.google.docs
version: 4.0.0
installed: true
- id: alfresco-aos-module
version: 2.0.0
installed: true
adw:
base_path: "/workspace"
2 changes: 2 additions & 0 deletions test/community-integration-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,5 @@ postgresql:
limits:
cpu: "2"
memory: "1Gi"
dtas:
enabled: true
8 changes: 6 additions & 2 deletions test/enterprise-integration-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ alfresco-repository:
limits:
cpu: "2"
memory: "2Gi"
replicaCount: 2
# https://alfresco.atlassian.net/browse/ACS-6670
replicaCount: 1
persistence:
accessModes:
- ReadWriteOnce
Expand Down Expand Up @@ -57,7 +58,7 @@ alfresco-transform-service:
memory: "256Mi"
limits:
cpu: "2"
memory: "512Mi"
memory: "1Gi"
replicaCount: 1
libreoffice:
livenessProbe:
Expand Down Expand Up @@ -127,9 +128,12 @@ alfresco-sync-service:
memory: "1Gi"
alfresco-ai-transformer:
enabled: true
replicaCount: 1
aws:
accessKeyId: AAAAAAAAAAAAAAAAA
secretAccessKey: ZZZZZZZZZZZZZZZZZ
s3Bucket: somebucket
region: us-east-1
comprehendRoleARN: arn:aws:iam::000000000000:user/comprehend
dtas:
enabled: true
Loading

0 comments on commit c1bd8b9

Please sign in to comment.