Skip to content

OPSEXP-4226 Only wire SOLR_SECRET for the Community profile, and test it in CI #2783

OPSEXP-4226 Only wire SOLR_SECRET for the Community profile, and test it in CI

OPSEXP-4226 Only wire SOLR_SECRET for the Community profile, and test it in CI #2783

Workflow file for this run

---
name: Helm (Community)
on:
pull_request:
branches:
- master
- release/**
- next/**
paths:
- helm/**
- test/k6/acs-sso-example.js
- test/postman/helm/**
- .github/workflows/helm*
- test/community-integration-test-values.yaml
- test/community-es-integration-test-values.yaml
- test/community-solr-integration-test-values.yaml
push:
branches:
- master
- release/**
concurrency:
group: helm-com-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build_vars:
runs-on: ubuntu-slim
outputs:
ver_json: ${{ steps.app_versions.outputs.json }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Get charts
id: getcharts
uses: ./.github/actions/charts-as-json
with:
charts-root: helm
- name: Select ACS community versions excluding any enterprise versions
id: app_versions
env:
JSON: ${{ toJSON(fromJSON(steps.getcharts.outputs.all)) }}
JQ_FILTER: >-
[inputs | .charts[] | {name: .name, values: .values[]}
| select(.values=="community_values.yaml" or .name=="acs-sso-example")
| (. + {test_values: (if .name=="alfresco-content-services" then "community-solr-integration-test-values.yaml" else "" end),
label: (if .name=="alfresco-content-services" then "acs-solr" else .name end)}),
(select(.name=="alfresco-content-services") + {test_values: "community-es-integration-test-values.yaml",
label: "acs-elasticsearch"})]
run: |
echo "${JSON}" | jq -nc '${{ env.JQ_FILTER }}'
MATRIX=$(echo "${JSON}" | jq -nc '${{ env.JQ_FILTER }}')
echo "json=$MATRIX" >> $GITHUB_OUTPUT
community_charts:
name: ${{ matrix.label }}
runs-on: ubuntu-latest
timeout-minutes: 14
needs:
- build_vars
env:
REGISTRY_SECRET_NAME: ${{ (github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]') && '' || 'regcred' }}
POD_METRICS_LOG: /tmp/pod-metrics.log
NODE_METRICS_LOG: /tmp/node-metrics.log
HELM_INSTALL_TIMEOUT: 10m0s
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.build_vars.outputs.ver_json) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: "3.12.1"
- name: Login to Docker Hub
uses: docker/login-action@abd2ef45e78c5afb21d64d4ca52ee8550d9572c7 # v4.5.1
if: >-
! github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup cluster
id: setup-kind
uses: Alfresco/alfresco-build-tools/.github/actions/setup-kind@v18.21.0
with:
traefik-enabled: true
cloud-provider-kind-enabled: true
metrics: true
import-docker-credentials-secret-name: ${{ env.REGISTRY_SECRET_NAME }}
- name: Background metrics monitoring
id: metrics-init
run: |
while true; do
echo "--- $(date) ---" >> $POD_METRICS_LOG
kubectl top pod --all-namespaces --sort-by=memory >> $POD_METRICS_LOG 2>&1 || true
sleep 10
done &
while true; do
echo "--- $(date) ---" >> $NODE_METRICS_LOG
kubectl top node >> $NODE_METRICS_LOG 2>&1 || true
sleep 10
done &
- name: Add dependency chart repos
run: |
helm repo add self https://alfresco.github.io/alfresco-helm-charts/
helm repo add codecentric https://codecentric.github.io/helm-charts/
helm repo add elastic https://helm.elastic.co/
- name: Determine extra test values
id: extra_values
run: |
if [ -n "${{ matrix.test_values }}" ]; then
echo "args=--values ../../test/${{ matrix.test_values }}" >> "$GITHUB_OUTPUT"
else
echo "args=" >> "$GITHUB_OUTPUT"
fi
- name: Helm install
id: helm_install
run: |
helm dep build .
helm install ${{ matrix.name }} . \
--set global.search.sharedSecret="$(openssl rand -hex 24)" \
--set global.known_urls=http://${{ steps.setup-kind.outputs.ingress-endpoint }} \
--set global.alfrescoRegistryPullSecrets=${{ env.REGISTRY_SECRET_NAME }} \
--set global.imagePullSecrets[0]=${{ env.REGISTRY_SECRET_NAME }} \
--wait --timeout ${{ env.HELM_INSTALL_TIMEOUT }} \
--values ${{ matrix.values }} \
--values ../../test/community-integration-test-values.yaml \
${{ steps.extra_values.outputs.args }}
working-directory: helm/${{ matrix.name }}
- name: Spit cluster status after Helm install
if: always() && steps.helm_install.outcome != 'skipped'
run: |
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod
- name: Disable IPv6 to avoid connection refused when connecting to traefik on localhost
run: |
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
- uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v.4.0.0
if: matrix.name == 'alfresco-content-services'
with:
timeout_minutes: 1
retry_wait_seconds: 30
max_attempts: 5
command: >-
docker run --network=host
-v $(pwd)/test/postman:/etc/postman
-t postman/newman run /etc/postman/helm/acs-test-helm-collection.json
--global-var protocol=http --global-var url=${{ steps.setup-kind.outputs.ingress-endpoint }}
- name: Run helm test
if: matrix.name == 'alfresco-content-services'
uses: ./.github/actions/helm-test
with:
release-name: ${{ matrix.name }}
- name: Setup k6
if: matrix.name == 'acs-sso-example'
uses: grafana/setup-k6-action@db07bd9765aac508ef18982e52ab937fe633a065 # v1.2.1
with:
k6-version: "1.6.1"
browser: true
- name: Run SSO example chart tests
if: matrix.name == 'acs-sso-example'
uses: grafana/run-k6-action@de51a7390bdf0ac85a3bef493691bd71d4c7c158 # v1.4.0
with:
path: test/k6/acs-sso-example.js
flags: -e BASE_URL=http://${{ steps.setup-kind.outputs.ingress-endpoint }}
disable-analytics: true
- name: Spit cluster status after tests
if: always() && steps.helm_install.outcome != 'skipped'
run: |
helm ls --all-namespaces
kubectl get all --all-namespaces
kubectl describe pod
kubectl logs -n traefik -l app.kubernetes.io/name=traefik --tail=-1
OOM_PODS=$(kubectl get pods -o jsonpath='{.items[?(@.status.containerStatuses[*].lastState.terminated.reason=="OOMKilled")].metadata.name}')
if [ -n "$OOM_PODS" ]; then
echo "::error::OOMKilled pods detected: $OOM_PODS"
fi
- name: Spit pod metrics logs
if: always() && steps.metrics-init.outcome != 'skipped'
run: |
cat $POD_METRICS_LOG
- name: Spit node metrics logs
if: always() && steps.metrics-init.outcome != 'skipped'
run: |
cat $NODE_METRICS_LOG
- name: Upload pods logs
if: always() && steps.helm_install.outcome != 'skipped'
uses: Alfresco/alfresco-build-tools/.github/actions/kubectl-keep-nslogs@v18.21.0
with:
namespace: default
log_retention: 7
log_name_identifier: "logs-pods-helm-com-${{ matrix.label }}"