|
5 | 5 | cloud_provider:
|
6 | 6 | description: Provider where Otomi will be installed
|
7 | 7 | type: string
|
8 |
| - default: scaleway |
| 8 | + default: linode |
9 | 9 | kubernetes_versions:
|
10 | 10 | description: "Kubernetes versions (JSON formatted list e.g.: ['1.27'])"
|
11 | 11 | type: string
|
|
50 | 50 | options:
|
51 | 51 | - scaleway
|
52 | 52 | - linode
|
53 |
| - - digitalocean |
54 | 53 | default: 'linode'
|
55 | 54 | kubernetes_versions:
|
56 | 55 | description: 'Kubernetes version'
|
@@ -123,16 +122,16 @@ on:
|
123 | 122 | default: 'yes'
|
124 | 123 | env:
|
125 | 124 | CACHE_REGISTRY: ghcr.io
|
126 |
| - CACHE_REPO: redkubes/otomi-core |
| 125 | + CACHE_REPO: linode/apl-core |
127 | 126 | REPO: otomi/core
|
128 |
| - GIT_USER: redkubesbot |
| 127 | + GIT_USER: svcAPLBot |
129 | 128 | SCALEWAY_NODE_TYPE: PRO2-M
|
130 | 129 | SCALEWAY_NODE_POOL_MIN_SIZE: 3
|
131 | 130 | SCALEWAY_VPC_ID: e1019b0c-7c7d-49ef-86e4-b02f55b2e0d3
|
132 |
| - DIGITALOCEAN_NODE_SIZE: s-8vcpu-16gb |
133 |
| - DIGITALOCEAN_NODE_POOL_MIN_SIZE: 3 |
134 | 131 | CHECK_CONTEXT: continuous-integration/integration-test
|
135 | 132 | COMMIT_ID: '${{ github.event.pull_request.head.sha || github.sha }}'
|
| 133 | + BOT_EMAIL: ${{ vars.BOT_EMAIL }} |
| 134 | + BOT_USERNAME: ${{ vars.BOT_USERNAME }} |
136 | 135 |
|
137 | 136 | jobs:
|
138 | 137 | preprocess-input:
|
@@ -175,30 +174,6 @@ jobs:
|
175 | 174 | echo $versions
|
176 | 175 | echo "versions=$versions" >> $GITHUB_OUTPUT
|
177 | 176 |
|
178 |
| - preprocess-digitalocean-input: |
179 |
| - needs: preprocess-input |
180 |
| - if: ${{ inputs.cloud_provider == 'digitalocean' }} |
181 |
| - name: Preprocess input variables for digital ocean |
182 |
| - runs-on: ubuntu-latest |
183 |
| - outputs: |
184 |
| - kubernetes_versions: ${{ steps.k8s-versions.outputs.versions }} |
185 |
| - steps: |
186 |
| - - name: Install doctl |
187 |
| - uses: digitalocean/action-doctl@v2 |
188 |
| - with: |
189 |
| - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
190 |
| - - id: k8s-versions |
191 |
| - name: Process k8s version input |
192 |
| - run: | |
193 |
| - if [ -z '${{ inputs.kubernetes_versions }}' ]; then |
194 |
| - echo "Kubernetes versions not specified, determine DO supported versions" |
195 |
| - versions=`doctl kubernetes options versions -o json | jq -ce 'map(.kubernetes_versions)'` |
196 |
| - else |
197 |
| - versions='${{ inputs.kubernetes_versions }}' |
198 |
| - fi |
199 |
| - echo $versions |
200 |
| - echo "versions=$versions" >> $GITHUB_OUTPUT |
201 |
| -
|
202 | 177 | preprocess-linode-input:
|
203 | 178 | needs: preprocess-input
|
204 | 179 | if: ${{ inputs.cloud_provider == 'linode' }}
|
@@ -283,16 +258,16 @@ jobs:
|
283 | 258 | run: |
|
284 | 259 | kubectl create secret docker-registry reg-otomi-github \
|
285 | 260 | --docker-server=${{ env.CACHE_REGISTRY }} \
|
286 |
| - --docker-username=${{ env.GIT_USER }} \ |
287 |
| - --docker-password='${{ secrets.NPM_TOKEN }}' |
| 261 | + --docker-username=${{ env.BOT_USERNAME }} \ |
| 262 | + --docker-password='${{ secrets.BOT_PULL_TOKEN }}' |
288 | 263 | - name: Checkout
|
289 | 264 | uses: actions/checkout@v4
|
290 | 265 | - name: Prepare Otomi chart
|
291 | 266 | if: ${{ inputs.install_profile != 'no-otomi' }}
|
292 | 267 | run: |
|
293 | 268 | ref=${{ github.event.pull_request.head.ref || github.ref }}
|
294 | 269 | tag=${ref##*/}
|
295 |
| - sed --in-place "s/APP_VERSION_PLACEHOLDER/$tag/g" chart/otomi/Chart.yaml |
| 270 | + sed --in-place "s/APP_VERSION_PLACEHOLDER/$tag/g" chart/apl/Chart.yaml |
296 | 271 | sed --in-place "s/CONTEXT_PLACEHOLDER/${{ env.SCALEWAY_CLUSTER_CONTEXT }}/g" tests/integration/${{ inputs.install_profile }}.yaml
|
297 | 272 | sed --in-place "s/OTOMI_VERSION_PLACEHOLDER/${GITHUB_REF##*/}/g" tests/integration/${{ inputs.install_profile }}.yaml
|
298 | 273 | touch values-container-registry.yaml
|
@@ -325,7 +300,7 @@ jobs:
|
325 | 300 | [[ '${{ inputs.certificate }}' == 'letsencrypt_staging' ]] && echo "$LETSENCRYPT_STAGING" >> values.yaml
|
326 | 301 | [[ '${{ inputs.certificate }}' == 'letsencrypt_production' ]] && echo "$LETSENCRYPT_PRODUCTION" >> values.yaml
|
327 | 302 |
|
328 |
| - install_args="--wait --wait-for-jobs --timeout 90m0s otomi chart/otomi \ |
| 303 | + install_args="--wait --wait-for-jobs --timeout 90m0s otomi chart/apl \ |
329 | 304 | --values tests/integration/${{ inputs.install_profile }}.yaml \
|
330 | 305 | --values values-container-registry.yaml
|
331 | 306 | --values values.yaml \
|
@@ -362,140 +337,6 @@ jobs:
|
362 | 337 | SLACK_TITLE: Scheduled integration tests
|
363 | 338 | SLACK_USERNAME: RedKubesBot
|
364 | 339 |
|
365 |
| - run-integration-test-digitalocean: |
366 |
| - if: ${{ inputs.cloud_provider == 'digitalocean' }} |
367 |
| - name: Run integration test on digitalocean cluster |
368 |
| - needs: preprocess-digitalocean-input |
369 |
| - runs-on: ubuntu-latest |
370 |
| - strategy: |
371 |
| - fail-fast: false |
372 |
| - matrix: |
373 |
| - kubernetes_versions: ${{ fromJSON(needs.preprocess-digitalocean-input.outputs.kubernetes_versions) }} |
374 |
| - max-parallel: 5 |
375 |
| - steps: |
376 |
| - - name: Install doctl |
377 |
| - uses: digitalocean/action-doctl@v2 |
378 |
| - with: |
379 |
| - token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} |
380 |
| - - name: Set k8s cluster name |
381 |
| - run: | |
382 |
| - echo "DIGITALOCEAN_CLUSTER_NAME=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')-$(TZ='GMT-2' date +'%m-%d-%H-%M')" >> $GITHUB_ENV |
383 |
| - # Cluster name must be no longer than 63 characters |
384 |
| - - name: Determine exact k8s version |
385 |
| - run: | |
386 |
| - echo "DIGITALOCEAN_K8S_VERSION=$(doctl kubernetes options versions -o json | jq -r '.[] | select(.kubernetes_version | startswith("${{ matrix.kubernetes_versions }}")) | .slug')" >> $GITHUB_ENV |
387 |
| -
|
388 |
| - - name: Get default VPC for region |
389 |
| - run: | |
390 |
| - echo DIGITALOCEAN_VPC_UUID=`doctl vpcs list -o json | jq -re 'map(select((.region == "ams3") and .default)) | .[0] | .id'` >> $GITHUB_ENV |
391 |
| - - name: Create k8s cluster for testing |
392 |
| - run: | |
393 |
| - doctl kubernetes cluster create ${{ env.DIGITALOCEAN_CLUSTER_NAME }} \ |
394 |
| - --tag source:github \ |
395 |
| - --ha \ |
396 |
| - --maintenance-window any=03:00 \ |
397 |
| - --region ams3 \ |
398 |
| - --vpc-uuid ${{ env.DIGITALOCEAN_VPC_UUID }} \ |
399 |
| - --node-pool "name=int-test-${{ strategy.job-index }}-${{ env.COMMIT_ID }};size=${{ env.DIGITALOCEAN_NODE_SIZE }};tag=integration-test;auto-scale=true;min-nodes=${{ env.DIGITALOCEAN_NODE_POOL_MIN_SIZE }};max-nodes=5;count=${{ env.DIGITALOCEAN_NODE_POOL_MIN_SIZE }};" \ |
400 |
| - --version ${{ env.DIGITALOCEAN_K8S_VERSION }} \ |
401 |
| - --wait |
402 |
| - - name: Retrieve cluster id |
403 |
| - run: echo DIGITALOCEAN_CLUSTER_ID=`doctl kubernetes cluster get ${{ env.DIGITALOCEAN_CLUSTER_NAME }} --format ID --no-header` >> $GITHUB_ENV |
404 |
| - - name: Assign the cluster to the project |
405 |
| - run: doctl projects resources assign ${{ secrets.DIGITALOCEAN_PROJECT }} --resource=do:kubernetes:${{ env.DIGITALOCEAN_CLUSTER_ID }} |
406 |
| - - name: Save kubectl config with auth token |
407 |
| - run: doctl kubernetes cluster kubeconfig save --expiry-seconds 36000 ${{ env.DIGITALOCEAN_CLUSTER_NAME }} |
408 |
| - - name: Get kubectl environment |
409 |
| - run: echo DIGITALOCEAN_CLUSTER_CONTEXT=`kubectl config current-context` >> $GITHUB_ENV |
410 |
| - - name: Create image pull secret on test cluster |
411 |
| - run: | |
412 |
| - kubectl create secret docker-registry reg-otomi-github \ |
413 |
| - --docker-server=${{ env.CACHE_REGISTRY }} \ |
414 |
| - --docker-username=${{ env.GIT_USER }} \ |
415 |
| - --docker-password='${{ secrets.NPM_TOKEN }}' |
416 |
| - - name: Checkout |
417 |
| - uses: actions/checkout@v4 |
418 |
| - - name: Prepare Otomi chart |
419 |
| - if: ${{ inputs.install_profile != 'no-otomi' }} |
420 |
| - run: | |
421 |
| - ref=${{ github.event.pull_request.head.ref || github.ref }} |
422 |
| - tag=${ref##*/} |
423 |
| - sed --in-place "s/APP_VERSION_PLACEHOLDER/$tag/g" chart/otomi/Chart.yaml |
424 |
| - sed --in-place "s/CONTEXT_PLACEHOLDER/${{ env.DIGITALOCEAN_CLUSTER_CONTEXT }}/g" tests/integration/${{ inputs.install_profile }}.yaml |
425 |
| - sed --in-place "s/OTOMI_VERSION_PLACEHOLDER/${GITHUB_REF##*/}/g" tests/integration/${{ inputs.install_profile }}.yaml |
426 |
| - touch values-container-registry.yaml |
427 |
| -
|
428 |
| - # If a pipeline installs Otomi from the semver tag then pull container image from DockerHub |
429 |
| - [[ ${GITHUB_REF##*/} =~ ^v[0-9].+$ ]] && exit 0 |
430 |
| -
|
431 |
| - # Pull image from cache registry |
432 |
| - cat << EOF > values-container-registry.yaml |
433 |
| - imageName: "${{ env.CACHE_REGISTRY }}/${{ env.CACHE_REPO }}" |
434 |
| - imagePullSecretNames: |
435 |
| - - reg-otomi-github |
436 |
| - EOF |
437 |
| - - name: Otomi install |
438 |
| - if: ${{ inputs.install_profile != 'no-otomi' }} |
439 |
| - env: |
440 |
| - AZ_DNS: ${{ secrets.AZ_DNS }} |
441 |
| - AZ_KMS: ${{ secrets.AZ_KMS }} |
442 |
| - AZ_OIDC: ${{ secrets.AZ_OIDC }} |
443 |
| - LETSENCRYPT_STAGING: ${{ secrets.LETSENCRYPT_STAGING }} |
444 |
| - LETSENCRYPT_PRODUCTION: ${{ secrets.LETSENCRYPT_PRODUCTION }} |
445 |
| - OTOMI_LICENSE: ${{ secrets.OTOMI_LICENSE }} |
446 |
| - run: | |
447 |
| - domainSuffix='' |
448 |
| - touch values.yaml |
449 |
| - [[ '${{ inputs.license }}' == 'yes' ]] && echo "$OTOMI_LICENSE" >> values.yaml |
450 |
| - [[ '${{ inputs.dns }}' == 'az_dns' ]] && echo "$AZ_DNS" >> values.yaml && domainSuffix='--set cluster.domainSuffix=tst-${{ github.run_id }}.aks.redkubes.net' |
451 |
| - [[ '${{ inputs.kms }}' == 'az_kms' ]] && echo "$AZ_KMS" >> values.yaml |
452 |
| - [[ '${{ inputs.oidc }}' == 'az_oidc' ]] && echo "$AZ_OIDC" >> values.yaml |
453 |
| - [[ '${{ inputs.certificate }}' == 'letsencrypt_staging' ]] && echo "$LETSENCRYPT_STAGING" >> values.yaml |
454 |
| - [[ '${{ inputs.certificate }}' == 'letsencrypt_production' ]] && echo "$LETSENCRYPT_PRODUCTION" >> values.yaml |
455 |
| -
|
456 |
| - install_args="--wait --wait-for-jobs --timeout 90m0s otomi chart/otomi \ |
457 |
| - --values tests/integration/${{ inputs.install_profile }}.yaml \ |
458 |
| - --values values-container-registry.yaml |
459 |
| - --values values.yaml \ |
460 |
| - --set cluster.provider=${{ inputs.cloud_provider }} |
461 |
| - $domainSuffix" |
462 |
| -
|
463 |
| - [[ '${{ inputs.generate_password }}' == 'no' ]] && install_args="$install_args --set otomi.adminPassword=welcomeotomi" |
464 |
| -
|
465 |
| - helm install $install_args |
466 |
| -
|
467 |
| - - name: Gather k8s events on failure |
468 |
| - if: failure() |
469 |
| - run: | |
470 |
| - kubectl get events --sort-by='.lastTimestamp' -A |
471 |
| - - name: Gather k8s pods on failure |
472 |
| - if: failure() |
473 |
| - run: | |
474 |
| - kubectl get pods -A -o wide |
475 |
| - - name: Gather otomi logs on failure |
476 |
| - if: failure() |
477 |
| - run: | |
478 |
| - kubectl logs jobs/otomi --tail 150 |
479 |
| - - name: Gather otomi-e2e logs on failure |
480 |
| - if: failure() |
481 |
| - run: | |
482 |
| - kubectl logs -n maintenance -l app.kubernetes.io/instance=job-e2e --tail 15000 |
483 |
| - - name: Remove the test cluster |
484 |
| - if: always() |
485 |
| - run: | |
486 |
| - [[ "${{ inputs.cluster_persistence }}" == "preserve" ]] && echo "The cluster ${{ env.DIGITALOCEAN_CLUSTER_NAME }} will NOT be destroyed!!" && exit 0 |
487 |
| - doctl kubernetes cluster delete ${{ env.DIGITALOCEAN_CLUSTER_NAME }} -f --dangerous |
488 |
| - - name: Slack Notification |
489 |
| - if: always() |
490 |
| - uses: rtCamp/action-slack-notify@v2 |
491 |
| - env: |
492 |
| - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
493 |
| - SLACK_CHANNEL: github-ci |
494 |
| - SLACK_COLOR: ${{ job.status }} |
495 |
| - SLACK_ICON: https://github.com/redkubes.png?size=48 |
496 |
| - SLACK_TITLE: Scheduled integration tests |
497 |
| - SLACK_USERNAME: RedKubesBot |
498 |
| - |
499 | 340 | run-integration-test-linode:
|
500 | 341 | if: ${{ inputs.cloud_provider == 'linode' }}
|
501 | 342 | name: Run integration test on linode cluster
|
@@ -572,16 +413,16 @@ jobs:
|
572 | 413 | run: |
|
573 | 414 | kubectl create secret docker-registry reg-otomi-github \
|
574 | 415 | --docker-server=${{ env.CACHE_REGISTRY }} \
|
575 |
| - --docker-username=${{ env.GIT_USER }} \ |
576 |
| - --docker-password='${{ secrets.NPM_TOKEN }}' |
| 416 | + --docker-username=${{ env.BOT_USERNAME }} \ |
| 417 | + --docker-password='${{ secrets.BOT_PULL_TOKEN }}' |
577 | 418 | - name: Checkout
|
578 | 419 | uses: actions/checkout@v4
|
579 | 420 | - name: Prepare Otomi chart
|
580 | 421 | if: ${{ inputs.install_profile != 'no-otomi' }}
|
581 | 422 | run: |
|
582 | 423 | ref=${{ github.event.pull_request.head.ref || github.ref }}
|
583 | 424 | tag=${ref##*/}
|
584 |
| - sed --in-place "s/APP_VERSION_PLACEHOLDER/$tag/g" chart/otomi/Chart.yaml |
| 425 | + sed --in-place "s/APP_VERSION_PLACEHOLDER/$tag/g" chart/apl/Chart.yaml |
585 | 426 | sed --in-place "s/CONTEXT_PLACEHOLDER/${{ env.LINODE_CLUSTER_CONTEXT }}/g" tests/integration/${{ inputs.install_profile }}.yaml
|
586 | 427 | sed --in-place "s/OTOMI_VERSION_PLACEHOLDER/${GITHUB_REF##*/}/g" tests/integration/${{ inputs.install_profile }}.yaml
|
587 | 428 | touch values-container-registry.yaml
|
@@ -614,7 +455,7 @@ jobs:
|
614 | 455 | [[ '${{ inputs.certificate }}' == 'letsencrypt_staging' ]] && echo "$LETSENCRYPT_STAGING" >> values.yaml
|
615 | 456 | [[ '${{ inputs.certificate }}' == 'letsencrypt_production' ]] && echo "$LETSENCRYPT_PRODUCTION" >> values.yaml
|
616 | 457 |
|
617 |
| - install_args="--wait --wait-for-jobs --timeout 90m0s otomi chart/otomi \ |
| 458 | + install_args="--wait --wait-for-jobs --timeout 90m0s otomi chart/apl \ |
618 | 459 | --values tests/integration/${{ inputs.install_profile }}.yaml \
|
619 | 460 | --values values-container-registry.yaml
|
620 | 461 | --values values.yaml \
|
|
0 commit comments