Skip to content

Commit 1df4141

Browse files
authored
Merge branch 'main' into feature/lokitool-namespace-regex
2 parents b329f35 + 0edc65d commit 1df4141

File tree

384 files changed

+22968
-15741
lines changed

Some content is hidden

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

384 files changed

+22968
-15741
lines changed

.github/release-workflows.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ local imageJobs = {
3131
promtail: build.image('promtail', 'clients/cmd/promtail', platform=platforms.all),
3232
querytee: build.image('loki-query-tee', 'cmd/querytee', platform=[r.forPlatform('linux/amd64'), r.forPlatform('linux/arm64')]),
3333
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=[r.forPlatform('linux/amd64'), r.forPlatform('linux/arm64')]),
34+
'loki-helm-test': build.image('loki-helm-test', 'production/helm/loki/src/helm-test', platform=platforms.all),
3435
};
3536

3637
local weeklyImageJobs = {

.github/workflows/helm-ci.yml

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
CT_CONFIGFILE: production/helm/ct.yaml
11-
INTEGRARION_TESTS_DIR: production/helm/loki/test/integration
11+
INTEGRATION_TESTS_DIR: production/helm/loki/test/integration
1212

1313
jobs:
1414
# Temporarily disabled linting because this step doesn't easily support passing GO tags yet.
@@ -103,7 +103,7 @@ jobs:
103103

104104
- name: List tests
105105
id: list_tests
106-
working-directory: "${{ env.INTEGRARION_TESTS_DIR }}"
106+
working-directory: "${{ env.INTEGRATION_TESTS_DIR }}"
107107
env:
108108
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
109109
run: |
@@ -153,7 +153,69 @@ jobs:
153153
start: false
154154

155155
- name: Run test
156-
run: helm-chart-toolbox/tools/helm-test/helm-test "${TEST_DIRECTORY}"
156+
run: |
157+
# Enable verbose output only if runner debug mode is enabled
158+
if [ "${{ runner.debug }}" == "1" ]; then
159+
set -x
160+
echo "=== Debug mode enabled - verbose output active ==="
161+
fi
162+
163+
echo "=== Starting Helm Test ==="
164+
echo "Test directory: ${TEST_DIRECTORY}"
165+
helm-chart-toolbox/tools/helm-test/helm-test "${TEST_DIRECTORY}" || {
166+
EXIT_CODE=$?
167+
echo "=== Test failed with exit code: $EXIT_CODE ==="
168+
echo "=== Attempting to gather debug information ==="
169+
170+
# Try to get cluster info if kubectl is available
171+
if command -v kubectl &> /dev/null; then
172+
echo "=== Kubernetes Cluster Debug Info ==="
173+
echo "--- Cluster nodes ---"
174+
kubectl get nodes -o wide || true
175+
echo "--- All namespaces ---"
176+
kubectl get namespaces || true
177+
echo "--- Helm releases ---"
178+
helm list -A || true
179+
echo "--- Helm release status (if exists) ---"
180+
helm status loki -n loki || echo "Helm release 'loki' not found or failed"
181+
echo "--- All resources in loki namespace ---"
182+
kubectl get all -n loki || true
183+
echo "--- Pods in loki namespace ---"
184+
kubectl get pods -n loki -o wide || true
185+
echo "--- Pod status details ---"
186+
kubectl get pods -n loki -o json | jq -r '.items[] | "\(.metadata.name): phase=\(.status.phase), reason=\(.status.reason // "none"), message=\(.status.message // "none")"' || true
187+
echo "--- Events in loki namespace (last 100) ---"
188+
kubectl get events -n loki --sort-by='.lastTimestamp' | tail -100 || true
189+
echo "--- Failed/Error pods details ---"
190+
kubectl get pods -n loki -o json | jq -r '.items[] | select(.status.phase != "Running" and .status.phase != "Succeeded") | "\(.metadata.name): \(.status.phase) - \(.status.reason // "no reason")"' || true
191+
echo "--- Describe failed pods ---"
192+
for pod in $(kubectl get pods -n loki -o json | jq -r '.items[] | select(.status.phase != "Running" and .status.phase != "Succeeded") | .metadata.name'); do
193+
echo "=== Describe pod: $pod ==="
194+
kubectl describe pod -n loki "$pod" || true
195+
done
196+
echo "--- Pod logs for failed pods ---"
197+
for pod in $(kubectl get pods -n loki -o json | jq -r '.items[] | select(.status.phase != "Running" and .status.phase != "Succeeded") | .metadata.name'); do
198+
echo "=== Logs for pod: $pod ==="
199+
kubectl logs -n loki "$pod" --tail=200 || true
200+
echo "=== Previous logs for pod: $pod ==="
201+
kubectl logs -n loki "$pod" --previous --tail=200 || true
202+
done
203+
204+
# Only show all pod logs if debug mode is enabled (can be very verbose)
205+
if [ "${{ runner.debug }}" == "1" ]; then
206+
echo "--- All pod logs (last 50 lines each) ---"
207+
for pod in $(kubectl get pods -n loki -o json | jq -r '.items[] | .metadata.name'); do
208+
echo "=== Logs for pod: $pod ==="
209+
kubectl logs -n loki "$pod" --tail=50 || true
210+
done
211+
fi
212+
fi
213+
214+
exit $EXIT_CODE
215+
}
157216
env:
158-
TEST_DIRECTORY: "source/${{ env.INTEGRARION_TESTS_DIR }}/${{ matrix.test }}"
217+
TEST_DIRECTORY: "source/${{ env.INTEGRATION_TESTS_DIR }}/${{ matrix.test }}"
159218
DELETE_CLUSTER: true
219+
# Enable verbose output for helm-test only if runner debug mode is enabled
220+
DEBUG: ${{ runner.debug == '1' && 'true' || 'false' }}
221+
VERBOSE: ${{ runner.debug == '1' && 'true' || 'false' }}

.github/workflows/minor-release-pr.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- "loki-canary"
3838
- "loki-canary-boringcrypto"
3939
- "loki-docker-driver"
40+
- "loki-helm-test"
4041
- "promtail"
4142
- "querytee"
4243
permissions:
@@ -831,6 +832,86 @@ jobs:
831832
- arch: "linux/arm64"
832833
runs_on:
833834
- "github-hosted-ubuntu-arm64-small"
835+
loki-helm-test:
836+
needs:
837+
- "version"
838+
permissions:
839+
contents: "write"
840+
id-token: "write"
841+
pull-requests: "write"
842+
runs-on: "${{ matrix.runs_on }}"
843+
steps:
844+
- name: "pull release library code"
845+
uses: "actions/checkout@v4"
846+
with:
847+
path: "lib"
848+
persist-credentials: false
849+
ref: "${{ env.RELEASE_LIB_REF }}"
850+
repository: "grafana/loki-release"
851+
- name: "pull code to release"
852+
uses: "actions/checkout@v4"
853+
with:
854+
path: "release"
855+
persist-credentials: false
856+
repository: "${{ env.RELEASE_REPO }}"
857+
- name: "setup node"
858+
uses: "actions/setup-node@v4"
859+
with:
860+
node-version: 20
861+
package-manager-cache: false
862+
- id: "fetch_gcs_credentials"
863+
name: "fetch gcs credentials from vault"
864+
uses: "grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760"
865+
with:
866+
repo_secrets: "GCS_SERVICE_ACCOUNT_KEY=gcs:service-account-key"
867+
- name: "auth gcs"
868+
uses: "google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f"
869+
with:
870+
credentials_json: "${{ env.GCS_SERVICE_ACCOUNT_KEY }}"
871+
- name: "Set up Docker buildx"
872+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"
873+
- id: "platform"
874+
name: "Parse image platform"
875+
run: |
876+
mkdir -p images
877+
878+
platform="$(echo "${{ matrix.arch }}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
879+
echo "platform=${platform}" >> $GITHUB_OUTPUT
880+
echo "platform_short=$(echo ${{ matrix.arch }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
881+
working-directory: "release"
882+
- env:
883+
IMAGE_TAG: "${{ needs.version.outputs.version }}"
884+
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
885+
name: "Build and export"
886+
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
887+
uses: "docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1"
888+
with:
889+
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
890+
context: "release"
891+
file: "release/production/helm/loki/src/helm-test/Dockerfile"
892+
outputs: "type=docker,dest=release/images/loki-helm-test-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
893+
platforms: "${{ matrix.arch }}"
894+
tags: "${{ env.IMAGE_PREFIX }}/loki-helm-test:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
895+
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
896+
name: "Upload artifacts"
897+
uses: "google-github-actions/upload-cloud-storage@386ab77f37fdf51c0e38b3d229fad286861cc0d0"
898+
with:
899+
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
900+
path: "release/images/loki-helm-test-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
901+
process_gcloudignore: false
902+
strategy:
903+
fail-fast: true
904+
matrix:
905+
include:
906+
- arch: "linux/amd64"
907+
runs_on:
908+
- "github-hosted-ubuntu-x64-small"
909+
- arch: "linux/arm64"
910+
runs_on:
911+
- "github-hosted-ubuntu-arm64-small"
912+
- arch: "linux/arm"
913+
runs_on:
914+
- "github-hosted-ubuntu-arm64-small"
834915
promtail:
835916
needs:
836917
- "version"

.github/workflows/patch-release-pr.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
- "loki-canary"
3838
- "loki-canary-boringcrypto"
3939
- "loki-docker-driver"
40+
- "loki-helm-test"
4041
- "promtail"
4142
- "querytee"
4243
permissions:
@@ -831,6 +832,86 @@ jobs:
831832
- arch: "linux/arm64"
832833
runs_on:
833834
- "github-hosted-ubuntu-arm64-small"
835+
loki-helm-test:
836+
needs:
837+
- "version"
838+
permissions:
839+
contents: "write"
840+
id-token: "write"
841+
pull-requests: "write"
842+
runs-on: "${{ matrix.runs_on }}"
843+
steps:
844+
- name: "pull release library code"
845+
uses: "actions/checkout@v4"
846+
with:
847+
path: "lib"
848+
persist-credentials: false
849+
ref: "${{ env.RELEASE_LIB_REF }}"
850+
repository: "grafana/loki-release"
851+
- name: "pull code to release"
852+
uses: "actions/checkout@v4"
853+
with:
854+
path: "release"
855+
persist-credentials: false
856+
repository: "${{ env.RELEASE_REPO }}"
857+
- name: "setup node"
858+
uses: "actions/setup-node@v4"
859+
with:
860+
node-version: 20
861+
package-manager-cache: false
862+
- id: "fetch_gcs_credentials"
863+
name: "fetch gcs credentials from vault"
864+
uses: "grafana/shared-workflows/actions/get-vault-secrets@28361cdb22223e5f1e34358c86c20908e7248760"
865+
with:
866+
repo_secrets: "GCS_SERVICE_ACCOUNT_KEY=gcs:service-account-key"
867+
- name: "auth gcs"
868+
uses: "google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f"
869+
with:
870+
credentials_json: "${{ env.GCS_SERVICE_ACCOUNT_KEY }}"
871+
- name: "Set up Docker buildx"
872+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"
873+
- id: "platform"
874+
name: "Parse image platform"
875+
run: |
876+
mkdir -p images
877+
878+
platform="$(echo "${{ matrix.arch }}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
879+
echo "platform=${platform}" >> $GITHUB_OUTPUT
880+
echo "platform_short=$(echo ${{ matrix.arch }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
881+
working-directory: "release"
882+
- env:
883+
IMAGE_TAG: "${{ needs.version.outputs.version }}"
884+
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
885+
name: "Build and export"
886+
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
887+
uses: "docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1"
888+
with:
889+
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
890+
context: "release"
891+
file: "release/production/helm/loki/src/helm-test/Dockerfile"
892+
outputs: "type=docker,dest=release/images/loki-helm-test-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
893+
platforms: "${{ matrix.arch }}"
894+
tags: "${{ env.IMAGE_PREFIX }}/loki-helm-test:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
895+
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
896+
name: "Upload artifacts"
897+
uses: "google-github-actions/upload-cloud-storage@386ab77f37fdf51c0e38b3d229fad286861cc0d0"
898+
with:
899+
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
900+
path: "release/images/loki-helm-test-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
901+
process_gcloudignore: false
902+
strategy:
903+
fail-fast: true
904+
matrix:
905+
include:
906+
- arch: "linux/amd64"
907+
runs_on:
908+
- "github-hosted-ubuntu-x64-small"
909+
- arch: "linux/arm64"
910+
runs_on:
911+
- "github-hosted-ubuntu-arm64-small"
912+
- arch: "linux/arm"
913+
runs_on:
914+
- "github-hosted-ubuntu-arm64-small"
834915
promtail:
835916
needs:
836917
- "version"

0 commit comments

Comments
 (0)