Skip to content

Commit

Permalink
FIrst pass of publishing lambda promtail
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r committed Feb 3, 2025
1 parent cdb8569 commit 2e5bc90
Show file tree
Hide file tree
Showing 10 changed files with 281 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subdir": "workflows"
}
},
"version": "5343bc71d96dc4247021a66c3da8fd5cd4c957dd"
"version": "d1fcf2eb7208d00380428bb68621501297bd8d42"
}
],
"legacyImports": true
Expand Down
4 changes: 2 additions & 2 deletions .github/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "5343bc71d96dc4247021a66c3da8fd5cd4c957dd",
"sum": "/+ozeV2rndtz8N3cZmrWxbNJFI7fkwoDzhECMHG1RoA="
"version": "d1fcf2eb7208d00380428bb68621501297bd8d42",
"sum": "MFWVc797B5o9/0TJluNaxDDENTDGKz13tOX7qn0vzSQ="
}
],
"legacyImports": false
Expand Down
2 changes: 2 additions & 0 deletions .github/release-workflows.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local imagePrefix = 'grafana';
local dockerPluginDir = 'clients/cmd/docker-driver';
local runner = import 'workflows/runner.libsonnet',
r = runner.withDefaultMapping(); // Do we need a different mapping?
local ecrBuild = import 'workflows/ecr.libsonnet';

local platforms = {
amd: [r.forPlatform('linux/amd64')],
Expand All @@ -30,6 +31,7 @@ local imageJobs = {
'loki-canary-boringcrypto': build.image('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto', platform=platforms.all),
promtail: build.image('promtail', 'clients/cmd/promtail', platform=platforms.all),
querytee: build.image('loki-query-tee', 'cmd/querytee', platform=platforms.amd),
'lambda-promtail': ecrBuild.ecrImage('lambda-promtail', 'tools/lambda-promtail', platform=platforms.all),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=platforms.all),
};

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 87 additions & 5 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- "dist"
- "fluent-bit"
- "fluentd"
- "lambda-promtail"
- "logcli"
- "logstash"
- "loki"
Expand Down Expand Up @@ -281,6 +282,87 @@ jobs:
- arch: "linux/amd64"
runs_on:
- "github-hosted-ubuntu-x64-small"
lambda-promtail:
env:
BUILD_TIMEOUT: 60
GO_VERSION: "1.23.5"
IMAGE_PREFIX: "public.ecr.aws/grafana"
RELEASE_LIB_REF: "main"
RELEASE_REPO: "grafana/loki"
needs:
- "version"
runs-on: "${{ matrix.runs_on }}"
steps:
- name: "pull release library code"
uses: "actions/checkout@v4"
with:
path: "lib"
ref: "${{ env.RELEASE_LIB_REF }}"
repository: "grafana/loki-release"
- name: "pull code to release"
uses: "actions/checkout@v4"
with:
path: "release"
repository: "${{ env.RELEASE_REPO }}"
- name: "setup node"
uses: "actions/setup-node@v4"
with:
node-version: 20
- name: "auth gcs"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}"
- name: "Set up Docker buildx"
uses: "docker/setup-buildx-action@v3"
- name: "Configure AWS credentials"
uses: "aws-actions/configure-aws-credentials@v4"
with:
aws-access-key-id: "${{ secrets.ECR_ACCESS_KEY }}"
aws-region: "us-east-1"
aws-secret-access-key: "${{ secrets.ECR_SECRET_KEY }}"
- name: "Login to Amazon ECR Public"
uses: "aws-actions/amazon-ecr-login@v2"
with:
registry-type: "public"
- id: "platform"
name: "Parse image platform"
run: |
mkdir -p images
platform="$(echo "${{ matrix.arch }}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
echo "platform_short=$(echo ${{ matrix.arch }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
- id: "build-push"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
with:
build-args: |
IMAGE_TAG=${{ needs.version.outputs.version }}
GO_VERSION=${{ env.GO_VERSION }}
context: "release"
file: "release/tools/lambda-promtail/Dockerfile"
outputs: "type=docker,dest=release/images/lambda-promtail-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
platforms: "${{ matrix.arch }}"
provenance: true
tags: "${{ env.IMAGE_PREFIX }}/lambda-promtail:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/lambda-promtail-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
fail-fast: true
matrix:
include:
- arch: "linux/amd64"
runs_on:
- "github-hosted-ubuntu-x64-small"
- arch: "linux/arm64"
runs_on:
- "github-hosted-ubuntu-arm64-small"
- arch: "linux/arm"
runs_on:
- "github-hosted-ubuntu-arm64-small"
logcli:
needs:
- "version"
Expand Down Expand Up @@ -618,7 +700,7 @@ jobs:
loki-docker-driver:
needs:
- "version"
runs-on: "ubuntu-latest"
runs-on: "${{ matrix.runs_on }}"
steps:
- name: "pull release library code"
uses: "actions/checkout@v4"
Expand Down Expand Up @@ -649,9 +731,9 @@ jobs:
mkdir -p images
mkdir -p plugins
platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
platform="$(echo "${{ matrix.arch}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
echo "platform_short=$(echo ${{ matrix.arch }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
if [[ "${platform}" == "linux/arm64" ]]; then
echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT
else
Expand All @@ -670,7 +752,7 @@ jobs:
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=local,dest=release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}"
platforms: "${{ matrix.platform }}"
platforms: "${{ matrix.arch }}"
push: false
tags: "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
Expand All @@ -689,7 +771,7 @@ jobs:
strategy:
fail-fast: true
matrix:
platform:
include:
- arch: "linux/amd64"
runs_on:
- "github-hosted-ubuntu-x64-small"
Expand Down
Loading

0 comments on commit 2e5bc90

Please sign in to comment.