Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build loki-build-image for multiple architectures. #11130

Merged
merged 53 commits into from
Nov 6, 2023
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8afc9f3
Build loki-build-image for multiple architectures.
jeschkies Oct 9, 2023
ac6632f
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Oct 9, 2023
435b489
Mount Docker socket.
jeschkies Oct 9, 2023
b0507b7
Provide docker sock volume.
jeschkies Oct 9, 2023
81b4c41
Use buildx
jeschkies Oct 9, 2023
ffd82a2
Ensure buildx is setup.
jeschkies Oct 9, 2023
9f8340c
Checking buildx builder script.
jeschkies Oct 9, 2023
381a128
Only build image when there are changes.
jeschkies Oct 9, 2023
963089b
Install arm packages where required.
jeschkies Oct 9, 2023
07decbf
Install the correct Helm and Helm Docs arch.
jeschkies Oct 9, 2023
ab5ccf3
Use make target to push build image.
jeschkies Oct 9, 2023
6923a52
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Oct 9, 2023
c0dd62a
Login Docker CLI.
jeschkies Oct 9, 2023
a011576
update drone.yml
jeschkies Oct 9, 2023
a881707
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Oct 10, 2023
ab49503
Use new build image.
jeschkies Oct 10, 2023
7669335
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Oct 10, 2023
a456e7a
Test image push.
jeschkies Oct 10, 2023
006e831
Migrate to two step.
jeschkies Oct 11, 2023
1f3843c
Correct Docker builds.
jeschkies Oct 11, 2023
1746ed0
Pass platform parameter
jeschkies Oct 11, 2023
2492df8
Use buildkit to get target architecture.
jeschkies Oct 11, 2023
3dbf3d2
Format jsonnet
jeschkies Oct 11, 2023
50200ae
Add todo
jeschkies Oct 11, 2023
31e4129
Add manifest for build image.
jeschkies Oct 11, 2023
2ec99de
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Nov 2, 2023
1de5317
Try with env var.
jeschkies Nov 2, 2023
c9fff01
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Nov 2, 2023
ae9d5c0
Only run on amd64
jeschkies Nov 2, 2023
1923d10
Reduce further.
jeschkies Nov 2, 2023
879159f
Use Docker config instead of user and password.
jeschkies Nov 3, 2023
6dc1dea
Remove buildkit
jeschkies Nov 3, 2023
509f2cd
Use 'args'
jeschkies Nov 3, 2023
cafdd65
try other format
jeschkies Nov 3, 2023
82cbe25
Use secrets
jeschkies Nov 3, 2023
fb81a16
Back to square one
jeschkies Nov 3, 2023
3e5b926
Use buildkit
jeschkies Nov 3, 2023
546e099
Build for arm as well
jeschkies Nov 3, 2023
e9a31cb
publish manifest
jeschkies Nov 3, 2023
58e2711
set tag
jeschkies Nov 3, 2023
37e8053
Format jsonnet
jeschkies Nov 3, 2023
b0324b6
Try different tagging
jeschkies Nov 3, 2023
d52b186
Set version manually for now
jeschkies Nov 3, 2023
6d66011
make manifest version dynamic
jeschkies Nov 3, 2023
b2b1e33
Remove unused script
jeschkies Nov 3, 2023
a0e6a92
add test stage
jeschkies Nov 3, 2023
b5796d5
Merge remote-tracking branch 'grafana/main' into karsten/multi-arch-b…
jeschkies Nov 3, 2023
ee26621
fix jsonnet format
jeschkies Nov 3, 2023
e6c4ee4
Make complete pipeline conditional
jeschkies Nov 3, 2023
6196073
Revert previous change
jeschkies Nov 3, 2023
b552ad1
Generate drone yaml
jeschkies Nov 3, 2023
4ff6892
Fun back and forth with condition
jeschkies Nov 3, 2023
4a96bf4
Update patch Go version documentation.
jeschkies Nov 6, 2023
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
Prev Previous commit
Next Next commit
Back to square one
  • Loading branch information
jeschkies committed Nov 3, 2023
commit fb81a16dbca9250e6c464f124ce8b9f314ef6019
41 changes: 4 additions & 37 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
@@ -41,7 +41,6 @@ local secret(name, vault_path, vault_key) = {
};
local docker_username_secret = secret('docker_username', 'infra/data/ci/docker_hub', 'username');
local docker_password_secret = secret('docker_password', 'infra/data/ci/docker_hub', 'password');
local docker_config = secret('docker_hub_config', 'infra/data/ci/docker_hub', 'config.json');
local ecr_key = secret('ecr_key', 'infra/data/ci/loki/aws-credentials', 'access_key_id');
local ecr_secret_key = secret('ecr_secret_key', 'infra/data/ci/loki/aws-credentials', 'secret_access_key');
local pull_secret = secret('dockerconfigjson', 'secret/data/common/gcr', '.dockerconfigjson');
@@ -498,8 +497,8 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
};

[
pipeline('loki-build-image-amd64') {
local build_image_tag = '0.32.0-amd64',
pipeline('loki-build-image') {
local build_image_tag = '0.31.2-amd64',
workspace: {
base: '/src',
path: 'loki',
@@ -508,11 +507,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
{
name: 'push-image',
image: 'plugins/docker',
when: onPRs + onPath('loki-build-image/**'),
//environment: {
//DOCKER_BUILDKIT: 1,
//DOCKER_PLUGIN_CONFIG: { from_secret: docker_config.name },
//},
// when: onTagOrMain + onPath('loki-build-image/**'),
settings: {
repo: 'grafana/loki-build-image',
context: 'loki-build-image',
@@ -521,38 +516,11 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
password: { from_secret: docker_password_secret.name },
tags: [build_image_tag],
dry_run: false,
build_args: [
"TARGETARCH=amd64",
"TARGETOS=linux",
],
build_args: [ "TARGETARCH=amd64", "TARGETOS=linux" ],
},
},
],
},
pipeline('loki-build-image-publish') {
local build_image_tag = '0.32.0-test',
steps: [
{
name: 'manifest',
// TODO: only onTagOrMain
when: onPRs + onPath('loki-build-image/**'),
image: 'plugins/manifest:1.4.0',
settings: {
// the target parameter is abused for the app's name,
// as it is unused in spec mode. See docker-manifest-operator.tmpl
target: 'loki-build-image',
spec: '.drone/docker-manifest-build-image.tmpl',
ignore_missing: false,
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
},
},
],
depends_on: [
'loki-build-image-%s' % arch
for arch in ['amd64']
],
},
pipeline('helm-test-image') {
workspace: {
base: '/src',
@@ -971,7 +939,6 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
pull_secret,
docker_username_secret,
docker_password_secret,
docker_config,
ecr_key,
ecr_secret_key,
updater_config_template,
44 changes: 3 additions & 41 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
kind: pipeline
name: loki-build-image-amd64
name: loki-build-image
steps:
- image: plugins/docker
name: push-image
@@ -15,14 +15,9 @@ steps:
from_secret: docker_password
repo: grafana/loki-build-image
tags:
- 0.32.0-amd64
- 0.31.2-amd64
username:
from_secret: docker_username
when:
event:
- pull_request
paths:
- loki-build-image/**
trigger:
ref:
- refs/heads/main
@@ -33,33 +28,6 @@ workspace:
base: /src
path: loki
---
depends_on:
- loki-build-image-amd64
kind: pipeline
name: loki-build-image-publish
steps:
- image: plugins/manifest:1.4.0
name: manifest
settings:
ignore_missing: false
password:
from_secret: docker_password
spec: .drone/docker-manifest-build-image.tmpl
target: loki-build-image
username:
from_secret: docker_username
when:
event:
- pull_request
paths:
- loki-build-image/**
trigger:
ref:
- refs/heads/main
- refs/heads/k???
- refs/tags/v*
- refs/pull/*/head
---
kind: pipeline
name: helm-test-image
steps:
@@ -1995,12 +1963,6 @@ get:
kind: secret
name: docker_password
---
get:
name: config.json
path: infra/data/ci/docker_hub
kind: secret
name: docker_hub_config
---
get:
name: access_key_id
path: infra/data/ci/loki/aws-credentials
@@ -2038,6 +2000,6 @@ kind: secret
name: gpg_private_key
---
kind: signature
hmac: 0a90a3fd52f69ee0dc0c0e3065b1cfdf4bdd8d36d91cb1b805a50c405f5d1a63
hmac: efafca1c5bbc909076218039a1941afb94699b7055b440040f19d3306b5a2a5e

...