Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/k8s-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Deploys the Helm chart into a k3d cluster and drives one user flow through the
# gateway: upload a dataset, create a workflow, run it on a Kubernetes computing
# unit, and check its result. It deploys published images rather than building
# them, so it tests the chart in this checkout against those images.
name: K8s integration test

on:
workflow_dispatch:
inputs:
image_registry:
description: 'Registry prefix of the Texera images (e.g., ghcr.io/apache, docker.io/apache)'
required: false
default: 'ghcr.io/apache'
type: string
image_tag:
description: 'Tag of the Texera images'
required: false
default: 'latest'
type: string
# Once the nightly build has published fresh ghcr.io/apache/*:latest images.
workflow_run:
workflows: ['Build and push images']
types: [completed]
pull_request:
paths:
- 'bin/k8s/**'
- '.github/workflows/k8s-integration-test.yml'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
K3D_VERSION: v5.9.0
HELM_VERSION: v4.3.0
KUBECTL_VERSION: v1.35.5

jobs:
k3d:
runs-on: ubuntu-latest
# A manually dispatched image build pushes some other tag, so only the nightly one
# leaves `latest` worth testing.
if: >-
github.event_name != 'workflow_run' ||
(github.event.workflow_run.event == 'schedule' &&
github.event.workflow_run.conclusion == 'success')
timeout-minutes: 60
env:
IMAGE_REGISTRY: ${{ github.event.inputs.image_registry || 'ghcr.io/apache' }}
IMAGE_TAG: ${{ github.event.inputs.image_tag || 'latest' }}
DIAGNOSTICS_DIR: ${{ github.workspace }}/k8s-integration-diagnostics
steps:
- name: Checkout Texera
uses: actions/checkout@v7

- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost /usr/local/lib/android
df -h /

- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.12'

- name: Install test dependencies
run: python -m pip install -r bin/k8s/tests/integration/requirements.txt

- name: Install k3d, kubectl and helm
run: |
bin_dir="$RUNNER_TEMP/k8s-tools"
mkdir -p "$bin_dir"
curl -fsSL --retry 5 -o "$bin_dir/k3d" \
"https://github.com/k3d-io/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64"
curl -fsSL --retry 5 -o "$bin_dir/kubectl" \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
curl -fsSL --retry 5 "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" \
| tar -xz -C "$bin_dir" --strip-components=1 linux-amd64/helm
chmod +x "$bin_dir/k3d" "$bin_dir/kubectl" "$bin_dir/helm"
echo "$bin_dir" >> "$GITHUB_PATH"

- name: Deploy to k3d and run the integration test
run: bin/k8s/tests/integration/run_k3d_integration_test.sh

- name: Upload diagnostics
if: failure()
uses: actions/upload-artifact@v7
with:
name: k8s-integration-diagnostics
path: ${{ env.DIAGNOSTICS_DIR }}
retention-days: 7
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ spec:
- name: {{ .name }}
value: "{{ .value }}"
{{- end }}
{{- include "texera.observability.env" . | nindent 12 }}
{{- include "texera.observability.env" . | nindent 12 }}
readinessProbe:
httpGet:
path: /api/healthcheck
port: {{ .Values.fileService.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
26 changes: 25 additions & 1 deletion bin/k8s/templates/base/webserver/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,32 @@ spec:
value: {{ .Values.lakekeeperInit.warehouse.region | quote }}
- name: STORAGE_ICEBERG_CATALOG_REST_S3_BUCKET
value: {{ .Values.lakekeeperInit.warehouse.s3Bucket | quote }}
# Object store a per-user warehouse is registered on in Lakekeeper. Unset, it
# defaults to localhost, which Lakekeeper cannot reach.
- name: STORAGE_S3_ENDPOINT
value: {{ include "texera.s3.endpoint" . }}
{{- if .Values.storage.s3.endpoint }}
- name: STORAGE_S3_REGION
value: {{ .Values.storage.s3.region | quote }}
{{- end }}
- name: STORAGE_S3_AUTH_USERNAME
valueFrom:
secretKeyRef:
name: {{ include "texera.s3.secretName" . }}
key: {{ include "texera.s3.accessKeyIdKey" . }}
- name: STORAGE_S3_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "texera.s3.secretName" . }}
key: {{ include "texera.s3.secretAccessKeyKey" . }}
{{- range .Values.texeraEnvVars }}
- name: {{ .name }}
value: "{{ .value }}"
{{- end }}
{{- include "texera.observability.env" . | nindent 12 }}
{{- include "texera.observability.env" . | nindent 12 }}
readinessProbe:
httpGet:
path: /api/healthcheck
port: {{ .Values.webserver.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@ spec:
- name: {{ .name }}
value: "{{ .value }}"
{{- end }}
{{- include "texera.observability.env" . | nindent 12 }}
{{- include "texera.observability.env" . | nindent 12 }}
readinessProbe:
httpGet:
path: /api/healthcheck
port: {{ .Values.workflowCompilingService.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,10 @@ spec:
- name: {{ .name }}
value: "{{ .value }}"
{{- end }}
{{- include "texera.observability.env" . | nindent 12 }}
{{- include "texera.observability.env" . | nindent 12 }}
readinessProbe:
httpGet:
path: /api/healthcheck
port: {{ .Values.workflowComputingUnitManager.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
Loading
Loading