Skip to content
Closed
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
76 changes: 74 additions & 2 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ local clients_docker(arch, app) = {
local lambda_promtail_ecr(app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: 'cstyan/ecr',
platform: {
os: 'linux',
arch: 'amd64',
},
privileged: true,
settings: {
repo: 'public.ecr.aws/grafana/lambda-promtail',
Expand All @@ -96,6 +100,44 @@ local lambda_promtail_ecr(app) = {
},
};

local lambda_promtail_ecr_arm64(app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: 'cstyan/ecr',
platform: {
os: 'linux',
arch: 'amd64',
},
privileged: true,
settings: {
repo: 'public.ecr.aws/grafana/lambda-promtail',
registry: 'public.ecr.aws/grafana',
dockerfile: 'tools/%s/Dockerfile.arm64' % app,
access_key: { from_secret: ecr_key.name },
secret_key: { from_secret: ecr_secret_key.name },
dry_run: false,
region: 'us-east-1',
},
};

// local lambda_promtail_ecr_arm64(app) = {
// name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
// image: 'cstyan/ecr:arm64',
// platform: {
// os: 'linux',
// arch: 'arm64',
// },
// privileged: true,
// settings: {
// repo: 'public.ecr.aws/grafana/lambda-promtail',
// registry: 'public.ecr.aws/grafana',
// dockerfile: 'tools/%s/Dockerfile' % app,
// access_key: { from_secret: ecr_key.name },
// secret_key: { from_secret: ecr_secret_key.name },
// dry_run: false,
// region: 'us-east-1',
// },
// };

local arch_image(arch, tags='') = {
platform: {
os: 'linux',
Expand Down Expand Up @@ -229,7 +271,7 @@ local promtail(arch) = pipeline('promtail-' + arch) + arch_image(arch) {
depends_on: ['check'],
};

local lambda_promtail(tags='') = pipeline('lambda-promtail') {
local lambda_promtail_amd64(tags='') = pipeline('lambda-promtail-amd64') {
steps+: [
{
name: 'image-tag',
Expand Down Expand Up @@ -258,6 +300,35 @@ local lambda_promtail(tags='') = pipeline('lambda-promtail') {
depends_on: ['check'],
};

local lambda_promtail_arm64(tags='') = pipeline('lambda-promtail-arm64') {
steps+: [
{
name: 'image-tag',
image: 'alpine',
commands: [
'apk add --no-cache bash git',
'git fetch origin --tags',
'echo $(./tools/image-tag)-arm64 > .tags',
] + if tags != '' then ['echo ",%s" >> .tags' % tags] else [],
},
lambda_promtail_ecr_arm64('lambda-promtail') {
depends_on: ['image-tag'],
when: condition('exclude').tagMain,
settings+: {
dry_run: true,
},
},
] + [
// publish for tag or main
lambda_promtail_ecr_arm64('lambda-promtail') {
depends_on: ['image-tag'],
when: condition('include').tagMain,
settings+: {},
},
],
depends_on: ['check'],
};

local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
steps+: [
// dry run for everything that is not tag or main
Expand Down Expand Up @@ -459,5 +530,6 @@ local manifest(apps) = pipeline('manifest') {
],
},
] + [promtail_win()]
+ [lambda_promtail('main')]
+ [lambda_promtail_amd64('main')]
+ [lambda_promtail_arm64('main')]
+ [github_secret, pull_secret, docker_username_secret, docker_password_secret, ecr_key, ecr_secret_key, deploy_configuration]
75 changes: 73 additions & 2 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ trigger:
depends_on:
- check
kind: pipeline
name: lambda-promtail
name: lambda-promtail-amd64
steps:
- commands:
- apk add --no-cache bash git
Expand All @@ -978,6 +978,9 @@ steps:
- image-tag
image: cstyan/ecr
name: build-lambda-promtail-image
platform:
arch: amd64
os: linux
privileged: true
settings:
access_key:
Expand All @@ -999,6 +1002,9 @@ steps:
- image-tag
image: cstyan/ecr
name: publish-lambda-promtail-image
platform:
arch: amd64
os: linux
privileged: true
settings:
access_key:
Expand All @@ -1021,6 +1027,71 @@ trigger:
- push
- pull_request
---
depends_on:
- check
kind: pipeline
name: lambda-promtail-arm64
steps:
- commands:
- apk add --no-cache bash git
- git fetch origin --tags
- echo $(./tools/image-tag)-arm64 > .tags
- echo ",main" >> .tags
image: alpine
name: image-tag
- depends_on:
- image-tag
image: cstyan/ecr
name: build-lambda-promtail-image
platform:
arch: amd64
os: linux
privileged: true
settings:
access_key:
from_secret: ecr_key
dockerfile: tools/lambda-promtail/Dockerfile.arm64
dry_run: true
region: us-east-1
registry: public.ecr.aws/grafana
repo: public.ecr.aws/grafana/lambda-promtail
secret_key:
from_secret: ecr_secret_key
when:
ref:
exclude:
- refs/heads/main
- refs/heads/k??
- refs/tags/v*
- depends_on:
- image-tag
image: cstyan/ecr
name: publish-lambda-promtail-image
platform:
arch: amd64
os: linux
privileged: true
settings:
access_key:
from_secret: ecr_key
dockerfile: tools/lambda-promtail/Dockerfile.arm64
dry_run: false
region: us-east-1
registry: public.ecr.aws/grafana
repo: public.ecr.aws/grafana/lambda-promtail
secret_key:
from_secret: ecr_secret_key
when:
ref:
include:
- refs/heads/main
- refs/heads/k??
- refs/tags/v*
trigger:
event:
- push
- pull_request
---
get:
name: pat
path: infra/data/ci/github/grafanabot
Expand Down Expand Up @@ -1064,6 +1135,6 @@ kind: secret
name: deploy_config
---
kind: signature
hmac: 8b3b13c0697e37fe9e39c422c375bb95c250ca3614bed5bb4697328ab89d1e68
hmac: 278bcda31d5ffb54849fc0cc766d893b4e1afaceea13d7383f8e473260180f9a

...
2 changes: 1 addition & 1 deletion tools/lambda-promtail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1-alpine3.14 AS build-image
FROM golang:alpine3.15 AS build-image

COPY tools/lambda-promtail /src/lambda-promtail
WORKDIR /src/lambda-promtail
Expand Down
23 changes: 23 additions & 0 deletions tools/lambda-promtail/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:alpine3.15 AS build-image

ENV GOARCH=arm64

COPY tools/lambda-promtail /src/lambda-promtail
WORKDIR /src/lambda-promtail

RUN go version

RUN apk update && apk upgrade && \
apk add --no-cache bash git

RUN go mod download
RUN go build -o ./main -tags lambda.norpc -ldflags="-s -w" lambda-promtail/*.go


FROM alpine:3.14

WORKDIR /app

COPY --from=build-image /src/lambda-promtail/main ./

ENTRYPOINT ["/app/main"]
Empty file added wal/00000033
Empty file.
Empty file added wal/00000034
Empty file.
Empty file added wal/00000035
Empty file.
Empty file added wal/00000036
Empty file.
Empty file added wal/00000037
Empty file.
Empty file added wal/00000038
Empty file.
Empty file added wal/00000039
Empty file.
Empty file.