Skip to content

Commit 62fb7da

Browse files
xpuska513davinchia
authored andcommitted
fix: Update oss charts. Add acceptance tests for helm (airbytehq#16131)
* fix: revert extraEnv. Move updated extraEnv to env_vars * fix: Add node pool selector feature for gke deployments * fix: hotfix. Fix webapp values and imagepullsecrets * fix: remove nodeSelector duplicate * fix: revert imagePullSecrets changes * fix nit * fix: fix bootloader imagepullsecrets * fix: fix image pull secrets again... * feat: add acceptance tests for helm * add step to install unzip * fix incorrect command spelling(helm) * update slack notification sending for Airbyte CI workflow * Rename Helm E2E test report name * fix: Update helm charts * fix: fix temporal DB Port bug * fix nits * do a small testing for sake of science * Update test chart.yaml with note block * Revert changes for AC tests * fix: Include airbytehq#16166 * fix: add metrics to the ci workflow * fix: revert changes for temporal service. move them to server service; * fix: revert fullstory deletion * fix: change way of defining image tag and make it to be set in global values. Add values.yaml.test for integration testing and local deployment * fix: udpate docs, update values.yaml * fix: fix helpers.tpl in all subcharts * Update chart docs Co-authored-by: Davin Chia <[email protected]>
1 parent ff50ccb commit 62fb7da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3619
-905
lines changed

.github/workflows/gradle.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,167 @@ jobs:
700700
label: ${{ needs.start-kube-acceptance-test-runner.outputs.label }}
701701
ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner.outputs.ec2-instance-id }}
702702

703+
704+
## Kube Acceptance Tests
705+
# Docker acceptance tests run as part of the build job.
706+
# In case of self-hosted EC2 errors, remove this block.
707+
start-helm-acceptance-test-runner:
708+
name: "Platform: Start Helm Acceptance Test Runner"
709+
needs:
710+
- changes
711+
- find_valid_pat
712+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
713+
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
714+
timeout-minutes: 10
715+
runs-on: ubuntu-latest
716+
outputs:
717+
label: ${{ steps.start-ec2-runner.outputs.label }}
718+
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
719+
steps:
720+
- name: Checkout Airbyte
721+
uses: actions/checkout@v2
722+
- name: Start AWS Runner
723+
id: start-ec2-runner
724+
uses: ./.github/actions/start-aws-runner
725+
with:
726+
# github-self-hosted-runner-ubuntu-20-with-150gdisk-docker-20.10.7-and-socat
727+
ec2-image-id: ami-0c1a9bc22624339d8
728+
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
729+
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
730+
github-token: ${{ needs.find_valid_pat.outputs.pat }}
731+
732+
733+
734+
helm-acceptance-test:
735+
name: "Platform: Acceptance Tests (Helm)"
736+
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
737+
needs: start-helm-acceptance-test-runner # required to start the main job when the runner is ready
738+
runs-on: ${{ needs.start-helm-acceptance-test-runner.outputs.label }} # run the job on the newly created runner
739+
environment: more-secrets
740+
timeout-minutes: 90
741+
steps:
742+
- name: Checkout Airbyte
743+
uses: actions/checkout@v2
744+
745+
- name: Cache Build Artifacts
746+
uses: ./.github/actions/cache-build-artifacts
747+
with:
748+
cache-key: ${{ secrets.CACHE_VERSION }}
749+
cache-python: "false"
750+
751+
- uses: actions/setup-java@v1
752+
with:
753+
java-version: "17"
754+
755+
- uses: actions/setup-node@v2
756+
with:
757+
node-version: "lts/gallium"
758+
759+
- name: Install unzip
760+
shell: bash
761+
run: sudo apt-get update && sudo apt-get install -y unzip
762+
763+
- uses: azure/setup-helm@v3
764+
with:
765+
version: 'latest'
766+
token: ${{ secrets.GITHUB_TOKEN }}
767+
id: install
768+
769+
- name: Fix EC-2 Runner
770+
run: |
771+
mkdir -p /home/runner
772+
773+
- name: Set up CI Gradle Properties
774+
run: |
775+
mkdir -p ~/.gradle/
776+
cat > ~/.gradle/gradle.properties <<EOF
777+
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
778+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
779+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
780+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
781+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
782+
org.gradle.workers.max=8
783+
org.gradle.vfs.watch=false
784+
EOF
785+
786+
- name: Create cluster config file
787+
run: |
788+
cat > /tmp/kind-config.yaml <<EOF
789+
kind: Cluster
790+
apiVersion: kind.x-k8s.io/v1alpha4
791+
nodes:
792+
- role: control-plane
793+
- role: worker
794+
EOF
795+
796+
- name: KIND Kubernetes Cluster Setup
797+
uses: helm/[email protected]
798+
with:
799+
node_image: kindest/node:v1.21.2
800+
config: /tmp/kind-config.yaml
801+
# In case of self-hosted EC2 errors, remove this env block.
802+
env:
803+
USER: root
804+
HOME: /home/runner
805+
CHANGE_MINIKUBE_NONE_USER: true
806+
807+
- name: Build Platform Docker Images
808+
run: SUB_BUILD=PLATFORM ./gradlew assemble -x test --scan
809+
810+
- name: Run Helm End-to-End Acceptance Tests
811+
env:
812+
USER: root
813+
HOME: /home/runner
814+
# AWS_S3_INTEGRATION_TEST_CREDS can be found in LastPass as AWS_S3_INTEGRATION_TEST_CREDS
815+
AWS_S3_INTEGRATION_TEST_CREDS: ${{ secrets.AWS_S3_INTEGRATION_TEST_CREDS }}
816+
SECRET_STORE_GCP_CREDENTIALS: ${{ secrets.SECRET_STORE_GCP_CREDENTIALS }}
817+
SECRET_STORE_GCP_PROJECT_ID: ${{ secrets.SECRET_STORE_GCP_PROJECT_ID }}
818+
run: |
819+
CI=true IS_MINIKUBE=true ./tools/bin/acceptance_test_kube_helm.sh
820+
821+
- name: Generate Test Report
822+
uses: dorny/test-reporter@v1
823+
if: always() # run this step even if previous step failed
824+
with:
825+
name: Platform Helm E2E Test Report
826+
path: '/actions-runner/_work/airbyte/airbyte/*/build/test-results/*/*.xml'
827+
reporter: java-junit
828+
829+
- uses: actions/upload-artifact@v2
830+
if: failure()
831+
with:
832+
name: Kubernetes Logs
833+
path: /tmp/kubernetes_logs/*
834+
835+
# In case of self-hosted EC2 errors, remove this block.
836+
stop-helm-acceptance-test-runner:
837+
name: "Platform: Stop Helm Acceptance Test EC2 Runner"
838+
timeout-minutes: 10
839+
needs:
840+
- start-helm-acceptance-test-runner # required to get output from the start-runner job
841+
- helm-acceptance-test # required to wait when the main job is done
842+
- find_valid_pat
843+
runs-on: ubuntu-latest
844+
# Always is required to stop the runner even if the previous job has errors. However always() runs even if the previous step is skipped.
845+
# Thus, we check for skipped here.
846+
if: ${{ always() && needs.start-helm-acceptance-test-runner.result != 'skipped'}}
847+
steps:
848+
- name: Configure AWS credentials
849+
uses: aws-actions/configure-aws-credentials@v1
850+
with:
851+
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
852+
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
853+
aws-region: us-east-2
854+
- name: Stop EC2 runner
855+
uses: supertopher/[email protected]
856+
with:
857+
mode: stop
858+
github-token: ${{ needs.find_valid_pat.outputs.pat }}
859+
label: ${{ needs.start-helm-acceptance-test-runner.outputs.label }}
860+
ec2-instance-id: ${{ needs.start-helm-acceptance-test-runner.outputs.ec2-instance-id }}
861+
862+
863+
703864
notify-failure-slack-channel:
704865
name: "Notify Slack Channel on Build Failures"
705866
runs-on: ubuntu-latest
@@ -709,6 +870,7 @@ jobs:
709870
- octavia-cli-build
710871
- platform-build
711872
- kube-acceptance-test
873+
- helm-acceptance-test
712874
if: ${{ failure() && github.ref == 'refs/heads/master' }}
713875
steps:
714876
- name: Publish to OSS Build Failure Slack Channel
@@ -733,6 +895,7 @@ jobs:
733895
- octavia-cli-build
734896
- platform-build
735897
- kube-acceptance-test
898+
- helm-acceptance-test
736899
if: success()
737900
steps:
738901
- name: Get Previous Workflow Status

charts/airbyte-bootloader/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# airbyte-bootloader
22

3-
![Version: 0.39.36](https://img.shields.io/badge/Version-0.39.36-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.39.41-alpha](https://img.shields.io/badge/AppVersion-0.39.41--alpha-informational?style=flat-square)
3+
![Version: 0.39.36](https://img.shields.io/badge/Version-0.39.36-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.4](https://img.shields.io/badge/AppVersion-0.40.4-informational?style=flat-square)
44

55
Helm chart to deploy airbyte-bootloader
66

@@ -16,17 +16,27 @@ Helm chart to deploy airbyte-bootloader
1616
|-----|------|---------|-------------|
1717
| affinity | object | `{}` | |
1818
| enabled | bool | `true` | |
19+
| env_vars | object | `{}` | |
20+
| extraContainers | list | `[]` | |
21+
| extraEnv | list | `[]` | |
22+
| extraInitContainers | list | `[]` | |
23+
| extraVolumeMounts | list | `[]` | |
24+
| extraVolumes | list | `[]` | |
1925
| global.database.secretName | string | `""` | |
2026
| global.database.secretValue | string | `""` | |
2127
| global.deploymentMode | string | `"oss"` | |
28+
| global.env_vars | object | `{}` | |
29+
| global.extraContainers | list | `[]` | |
2230
| global.secretName | string | `""` | |
31+
| global.secrets | object | `{}` | |
2332
| global.serviceAccountName | string | `"placeholderServiceAccount"` | |
2433
| image.pullPolicy | string | `"IfNotPresent"` | |
2534
| image.repository | string | `"airbyte/bootloader"` | |
2635
| nodeSelector | object | `{}` | |
2736
| podAnnotations | object | `{}` | |
2837
| resources.limits | object | `{}` | |
2938
| resources.requests | object | `{}` | |
39+
| secrets | object | `{}` | |
3040
| tolerations | list | `[]` | |
3141

3242
----------------------------------------------

charts/airbyte-bootloader/templates/_helpers.tpl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,26 @@ Create chart name and version as used by the chart label.
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "airbyte.labels" -}}
37+
helm.sh/chart: {{ include "airbyte.chart" . }}
38+
{{ include "airbyte.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "airbyte.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "airbyte.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
3353
{{/*
3454
Define db secret
3555
*/}}
@@ -49,3 +69,17 @@ Define db secret
4969
{{- end -}}
5070
{{- end -}}
5171
{{- end -}}
72+
73+
{{/*
74+
Define imageTag
75+
*/}}
76+
77+
{{- define "bootloader.imageTag" -}}
78+
{{- if ((.Values.global.image).tag) }}
79+
{{- printf "%s" .Values.global.image.tag }}
80+
{{- else if .Values.image.tag }}
81+
{{- printf "%s" .Values.image.tag }}
82+
{{- else }}
83+
{{- printf "%s" .Chart.AppVersion }}
84+
{{- end }}
85+
{{- end }}

charts/airbyte-bootloader/templates/bootloader-secrets.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ kind: Secret
55
metadata:
66
name: bootloader-secrets
77
labels:
8-
app.kubernetes.io/name: {{ include "airbyte.name" . }}
9-
app.kubernetes.io/instance: {{ .Release.Name }}
10-
helm.sh/chart: {{ include "airbyte.chart" . }}
11-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
12-
app.kubernetes.io/managed-by: {{ .Release.Service }}
13-
app.airbyte.io/fullname: {{ include "airbyte.fullname" . }}
8+
{{- include "airbyte.labels" . | nindent 4 }}
149
annotations:
1510
helm.sh/hook: pre-install,pre-upgrade
1611
helm.sh/hook-weight: "-1"

charts/airbyte-bootloader/templates/pod.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ kind: Pod
44
metadata:
55
name: {{ include "common.names.fullname" . }}
66
labels:
7-
app.kubernetes.io/name: {{ include "airbyte.name" . }}
8-
app.kubernetes.io/instance: {{ .Release.Name }}
9-
helm.sh/chart: {{ include "airbyte.chart" . }}
10-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
11-
app.kubernetes.io/managed-by: {{ .Release.Service }}
12-
app.airbyte.io/fullname: {{ include "airbyte.fullname" . }}
7+
{{- include "airbyte.labels" . | nindent 4 }}
138
annotations:
149
helm.sh/hook: pre-install,pre-upgrade
1510
helm.sh/hook-weight: "0"
@@ -36,7 +31,7 @@ spec:
3631
{{- end }}
3732
containers:
3833
- name: airbyte-bootloader-container
39-
image: {{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) }}
34+
image: {{ printf "%s:%s" .Values.image.repository (include "bootloader.imageTag" .) }}
4035
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
4136
env:
4237
{{- if eq .Values.global.deploymentMode "oss" }}
@@ -58,8 +53,8 @@ spec:
5853
- name: DATABASE_PASSWORD
5954
valueFrom:
6055
secretKeyRef:
61-
name: {{ .Values.global.database.secretName | default (printf "%s-postgresql" .Release.Name ) }}
62-
key: {{ .Values.global.database.secretValue | default "postgresql-password" }}
56+
name: {{ .Values.global.database.secretName | default (printf "%s-airbyte-secrets" .Release.Name ) }}
57+
key: {{ .Values.global.database.secretValue | default "DATABASE_PASSWORD" }}
6358
- name: DATABASE_URL
6459
valueFrom:
6560
configMapKeyRef:
@@ -68,7 +63,7 @@ spec:
6863
- name: DATABASE_USER
6964
valueFrom:
7065
secretKeyRef:
71-
name: {{ .Values.global.configMapName | default (printf "%s-airbyte-secrets" .Release.Name) }}
66+
name: {{ .Values.global.secretName | default (printf "%s-airbyte-secrets" .Release.Name) }}
7267
key: DATABASE_USER
7368
{{- end }}
7469
# Values from secret
@@ -96,3 +91,17 @@ spec:
9691
{{- end }}
9792

9893
resources: {{- toYaml .Values.resources | nindent 8 }}
94+
{{- if .Values.extraVolumeMounts }}
95+
volumeMounts:
96+
{{- toYaml .Values.extraVolumeMounts | nindent 8 }}
97+
{{- end }}
98+
{{- if .Values.extraContainers }}
99+
{{ toYaml .Values.extraContainers | indent 4 }}
100+
{{- end }}
101+
{{- if .Values.global.extraContainers }}
102+
{{ toYaml .Values.global.extraContainers | indent 4 }}
103+
{{- end }}
104+
{{- if .Values.extraVolumes }}
105+
volumes:
106+
{{- toYaml .Values.extraVolumes | nindent 2 }}
107+
{{- end }}

0 commit comments

Comments
 (0)