ci: remove drone, add GH action to build images (#14273)

pull/13999/head
Trevor Whitney 8 months ago committed by GitHub
parent cf1d4a31af
commit f74b44c0e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      .drone/docker-manifest-build-image.tmpl
  2. 21
      .drone/docker-manifest-ecr.tmpl
  3. 26
      .drone/docker-manifest-operator.tmpl
  4. 26
      .drone/docker-manifest.tmpl
  5. 669
      .drone/drone.jsonnet
  6. 1313
      .drone/drone.yml
  7. 2
      .github/jsonnetfile.json
  8. 4
      .github/jsonnetfile.lock.json
  9. 52
      .github/release-workflows.jsonnet
  10. 4
      .github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet
  11. 1
      .github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet
  12. 433
      .github/workflows/images.yml
  13. 20
      .github/workflows/minor-release-pr.yml
  14. 20
      .github/workflows/patch-release-pr.yml
  15. 25
      Makefile

@ -1,17 +0,0 @@
image: grafana/{{config.target}}
tags:
{{#if build.tags}}
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: grafana/{{config.target}}-amd64
platform:
architecture: amd64
os: linux
- image: grafana/{{config.target}}-arm64
platform:
architecture: arm64
os: linux
variant: v8

@ -1,21 +0,0 @@
image: public.ecr.aws/grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}
tags:
- main
{{#if build.tag}}
- latest
{{/if}}
{{#if build.tags}}
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: public.ecr.aws/grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-amd64
platform:
architecture: amd64
os: linux
- image: public.ecr.aws/grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-arm64
platform:
architecture: arm64
os: linux
variant: v8

@ -1,26 +0,0 @@
image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "operator/v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}
tags:
- main
{{#if build.tag}}
- latest
{{/if}}
{{#if build.tags}}
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "operator/v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-amd64
platform:
architecture: amd64
os: linux
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "operator/v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "operator/v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-arm
platform:
architecture: arm
os: linux
variant: v7

@ -1,26 +0,0 @@
image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}
tags:
- main
{{#if build.tag}}
- latest
{{/if}}
{{#if build.tags}}
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-amd64
platform:
architecture: amd64
os: linux
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-arm64
platform:
architecture: arm64
os: linux
variant: v8
- image: grafana/{{config.target}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{build.branch}}-{{substr 0 7 build.commit}}{{/if}}-arm
platform:
architecture: arm
os: linux
variant: v7

@ -1,669 +0,0 @@
local apps = ['loki', 'loki-canary', 'loki-canary-boringcrypto', 'logcli'];
local archs = ['amd64', 'arm64', 'arm'];
local build_image_version = std.extVar('__build-image-version');
local drone_updater_plugin_image = 'us.gcr.io/kubernetes-dev/drone/plugins/updater@sha256:cbcb09c74f96a34c528f52bf9b4815a036b11fed65f685be216e0c8b8e84285b';
local onPRs = {
event: ['pull_request'],
};
local onTagOrMain = {
event: ['push', 'tag'],
};
local onTag = {
event: ['tag'],
};
local onPath(path) = {
paths+: [path],
};
local pipeline(name) = {
kind: 'pipeline',
name: name,
steps: [],
trigger: {
// Only trigger pipelines for PRs, tags (v*), or pushes to "main". Excluding runs on grafana/loki (non fork) branches
ref: ['refs/heads/main', 'refs/heads/k???', 'refs/tags/v*', 'refs/pull/*/head'],
},
};
local secret(name, vault_path, vault_key) = {
kind: 'secret',
name: name,
get: {
path: vault_path,
name: 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 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');
local github_secret = secret('github_token', 'infra/data/ci/github/grafanabot', 'pat');
local gpg_passphrase = secret('gpg_passphrase', 'infra/data/ci/packages-publish/gpg', 'passphrase');
local gpg_private_key = secret('gpg_private_key', 'infra/data/ci/packages-publish/gpg', 'private-key');
// Injected in a secret because this is a public repository and having the config here would leak our environment names
local updater_config_template = secret('updater_config_template', 'secret/data/common/loki_ci_autodeploy', 'updater-config-template.json');
local helm_chart_auto_update_config_template = secret('helm-chart-update-config-template', 'secret/data/common/loki-helm-chart-auto-update', 'on-loki-release-config.json');
local run(name, commands, env={}, image='grafana/loki-build-image:%s' % build_image_version) = {
name: name,
image: image,
commands: commands,
environment: env,
};
local make(target, container=true, args=[]) = run(target, [
std.join(' ', [
'make',
'BUILD_IN_CONTAINER=' + container,
target,
] + args),
]);
// The only indication we have that we're running in a fork is the presence of a secret.
// If a secret is blank, it means we're running in a fork.
local skipMissingSecretPipelineStep(secretName) = run(
'skip pipeline if missing secret',
[
'if [ "$${#TEST_SECRET}" -eq 0 ]; then',
' echo "Missing a secret to run this pipeline. This branch needs to be re-pushed as a branch in main grafana/loki repository in order to run." && exit 78',
'fi',
],
image='alpine',
env={
TEST_SECRET: { from_secret: secretName },
},
);
local docker(arch, app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: if arch == 'arm' then 'plugins/docker:linux-arm' else 'plugins/docker',
settings: {
repo: 'grafana/%s' % app,
dockerfile: 'cmd/%s/Dockerfile' % app,
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
dry_run: false,
},
};
local clients_docker(arch, app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: if arch == 'arm' then 'plugins/docker:linux-arm' else 'plugins/docker',
settings: {
repo: 'grafana/%s' % app,
dockerfile: 'clients/cmd/%s/Dockerfile' % app,
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
dry_run: false,
},
};
local docker_operator(arch, operator) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + operator else 'publish-' + operator,
image: if arch == 'arm' then 'plugins/docker:linux-arm' else 'plugins/docker',
settings: {
repo: 'grafana/%s' % operator,
context: 'operator',
dockerfile: 'operator/Dockerfile',
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
dry_run: false,
},
};
local lambda_promtail_ecr(app) = {
name: '%s-image' % if $.settings.dry_run then 'build-' + app else 'publish-' + app,
image: 'cstyan/ecr',
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',
arch: arch,
},
steps: [{
name: 'image-tag',
image: 'alpine',
commands: [
'apk add --no-cache bash git',
'git fetch origin --tags',
'echo $(./tools/image-tag)-%s > .tags' % arch,
] + if tags != '' then ['echo ",%s" >> .tags' % tags] else [],
}],
};
local querytee() = pipeline('querytee-amd64') + arch_image('amd64', 'main') {
steps+: [
// publish for tag or main
docker('amd64', 'querytee') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
repo: 'grafana/loki-query-tee',
},
},
],
};
local fluentbit(arch) = pipeline('fluent-bit-' + arch) + arch_image(arch) {
steps+: [
// publish for tag or main
clients_docker(arch, 'fluent-bit') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
repo: 'grafana/fluent-bit-plugin-loki',
},
},
],
};
local fluentd() = pipeline('fluentd-amd64') + arch_image('amd64', 'main') {
steps+: [
// publish for tag or main
clients_docker('amd64', 'fluentd') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
repo: 'grafana/fluent-plugin-loki',
},
},
],
};
local logstash() = pipeline('logstash-amd64') + arch_image('amd64', 'main') {
steps+: [
// publish for tag or main
clients_docker('amd64', 'logstash') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
repo: 'grafana/logstash-output-loki',
},
},
],
};
local promtail(arch) = pipeline('promtail-' + arch) + arch_image(arch) {
steps+: [
// publish for tag or main
clients_docker(arch, 'promtail') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {},
},
],
};
local lambda_promtail(arch) = pipeline('lambda-promtail-' + arch) + arch_image(arch) {
local skipStep = skipMissingSecretPipelineStep(ecr_key.name), // Needs ECR secrets to run
steps+: [
skipStep,
// publish for tag or main
lambda_promtail_ecr('lambda-promtail') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {},
},
],
};
local lokioperator(arch) = pipeline('lokioperator-' + arch) + arch_image(arch) {
steps+: [
// publish for tag or main
docker_operator(arch, 'loki-operator') {
depends_on: ['image-tag'],
when: onTagOrMain {
ref: ['refs/heads/main', 'refs/tags/operator/v*'],
},
settings+: {},
},
],
};
local logql_analyzer() = pipeline('logql-analyzer') + arch_image('amd64') {
steps+: [
// publish for tag or main
docker('amd64', 'logql-analyzer') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
repo: 'grafana/logql-analyzer',
},
},
],
};
local multiarch_image(arch) = pipeline('docker-' + arch) + arch_image(arch) {
steps+: [
// publish for tag or main
docker(arch, app) {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {},
}
for app in apps
],
};
local manifest(apps) = pipeline('manifest') {
steps: std.foldl(
function(acc, app) acc + [{
name: 'manifest-' + app,
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.tmpl
target: app,
spec: '.drone/docker-manifest.tmpl',
ignore_missing: false,
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
},
depends_on: ['clone'] + (
// Depend on the previous app, if any.
if std.length(acc) > 0
then [acc[std.length(acc) - 1].name]
else []
),
}],
apps,
[],
),
depends_on: [
'docker-%s' % arch
for arch in archs
] + [
'promtail-%s' % arch
for arch in archs
] + [
'fluent-bit-%s' % arch
for arch in archs
],
};
local manifest_operator(app) = pipeline('manifest-operator') {
steps: [{
name: 'manifest-' + app,
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: app,
spec: '.drone/docker-manifest-operator.tmpl',
ignore_missing: false,
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
},
depends_on: ['clone'],
}],
depends_on: [
'lokioperator-%s' % arch
for arch in archs
],
};
local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
steps: std.foldl(
function(acc, app) acc + [{
name: 'manifest-' + app,
image: 'plugins/manifest:1.4.0',
volumes: [{
name: 'dockerconf',
path: '/.docker',
}],
settings: {
// the target parameter is abused for the app's name,
// as it is unused in spec mode. See docker-manifest-ecr.tmpl
target: app,
spec: '.drone/docker-manifest-ecr.tmpl',
ignore_missing: true,
},
depends_on: ['clone'] + (
// Depend on the previous app, if any.
if std.length(acc) > 0
then [acc[std.length(acc) - 1].name]
else []
),
}],
apps,
[{
name: 'ecr-login',
image: 'docker:dind',
volumes: [{
name: 'dockerconf',
path: '/root/.docker',
}],
environment: {
AWS_ACCESS_KEY_ID: { from_secret: ecr_key.name },
AWS_SECRET_ACCESS_KEY: { from_secret: ecr_secret_key.name },
},
commands: [
'apk add --no-cache aws-cli',
'docker login --username AWS --password $(aws ecr-public get-login-password --region us-east-1) public.ecr.aws',
],
depends_on: ['clone'],
}],
),
volumes: [{
name: 'dockerconf',
temp: {},
}],
depends_on: [
'lambda-promtail-%s' % arch
for arch in archs
],
};
local build_image_tag = '0.33.2';
[
pipeline('loki-build-image-' + arch) {
workspace: {
base: '/src',
path: 'loki',
},
platform: {
os: 'linux',
arch: arch,
},
steps: [
{
name: 'push',
image: 'plugins/docker',
when: onTagOrMain + onPath('loki-build-image/**'),
environment: {
DOCKER_BUILDKIT: 1,
},
settings: {
repo: 'grafana/loki-build-image',
context: 'loki-build-image',
dockerfile: 'loki-build-image/Dockerfile',
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
tags: [build_image_tag + '-' + arch],
dry_run: false,
},
},
],
}
for arch in ['amd64', 'arm64']
] + [
pipeline('loki-build-image-publish') {
steps: [
{
name: 'manifest',
image: 'plugins/manifest:1.4.0',
when: onTagOrMain + onPath('loki-build-image/**'),
settings: {
// the target parameter is abused for the app's name, as it is unused in spec mode.
target: 'loki-build-image:' + build_image_tag,
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', 'arm64']
],
},
pipeline('helm-test-image') {
workspace: {
base: '/src',
path: 'loki',
},
steps: [
{
name: 'push-image',
image: 'plugins/docker',
when: onTagOrMain + onPath('production/helm/loki/src/helm-test/**'),
settings: {
repo: 'grafana/loki-helm-test',
dockerfile: 'production/helm/loki/src/helm-test/Dockerfile',
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
dry_run: false,
},
},
],
},
pipeline('documentation-checks') {
workspace: {
base: '/src',
path: 'loki',
},
steps: [
make('documentation-helm-reference-check', container=false) {
depends_on: ['clone'],
},
],
},
] + [
multiarch_image(arch)
for arch in archs
] + [
promtail(arch) + (
// When we're building Promtail for ARM, we want to use Dockerfile.arm32 to fix
// a problem with the published Drone image. See Dockerfile.arm32 for more
// information.
//
// This is really really hacky and a better more permanent solution will be to use
// buildkit.
if arch == 'arm'
then {
steps: [
step + (
if std.objectHas(step, 'settings') && step.settings.dockerfile == 'clients/cmd/promtail/Dockerfile'
then {
settings+: {
dockerfile: 'clients/cmd/promtail/Dockerfile.arm32',
},
}
else {}
)
for step in super.steps
],
}
else {}
)
for arch in archs
] + [
lokioperator(arch) {
trigger+: {
ref: [
'refs/heads/main',
'refs/tags/operator/v*',
'refs/pull/*/head',
],
},
}
for arch in archs
] + [
fluentbit(arch)
for arch in archs
] + [
fluentd(),
logstash(),
querytee(),
manifest(['promtail', 'loki', 'loki-canary', 'loki-canary-boringcrypto', 'fluent-bit-plugin-loki']) {
trigger+: onTagOrMain,
},
manifest_operator('loki-operator') {
trigger+: onTagOrMain {
ref: [
'refs/heads/main',
'refs/tags/operator/v*',
],
},
},
pipeline('deploy') {
local configFileName = 'updater-config.json',
trigger: onTagOrMain {
ref: ['refs/heads/main', 'refs/tags/v*'],
},
depends_on: ['manifest'],
image_pull_secrets: [pull_secret.name],
steps: [
{
name: 'prepare-updater-config',
image: 'alpine',
environment: {
MAJOR_MINOR_VERSION_REGEXP: '([0-9]+\\.[0-9]+)',
RELEASE_TAG_REGEXP: '^([0-9]+\\.[0-9]+\\.[0-9]+)$',
},
commands: [
'apk add --no-cache bash git',
'git fetch origin --tags',
'echo $(./tools/image-tag) > .tag',
'export RELEASE_TAG=$(cat .tag)',
// if the tag matches the pattern `D.D.D` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next"
'export RELEASE_NAME=$([[ $RELEASE_TAG =~ $RELEASE_TAG_REGEXP ]] && echo $RELEASE_TAG | grep -oE $MAJOR_MINOR_VERSION_REGEXP | sed "s/\\./-/g" | sed "s/$/-x/" || echo "next")',
'echo $RELEASE_NAME',
'echo $PLUGIN_CONFIG_TEMPLATE > %s' % configFileName,
// replace placeholders with RELEASE_NAME and RELEASE TAG
'sed -i "s/\\"{{release}}\\"/\\"$RELEASE_NAME\\"/g" %s' % configFileName,
'sed -i "s/{{version}}/$RELEASE_TAG/g" %s' % configFileName,
],
settings: {
config_template: { from_secret: updater_config_template.name },
},
depends_on: ['clone'],
},
{
name: 'trigger',
image: drone_updater_plugin_image,
settings: {
github_token: { from_secret: github_secret.name },
config_file: configFileName,
},
depends_on: ['prepare-updater-config'],
},
],
},
pipeline('update-loki-helm-chart-on-loki-release') {
local configFileName = 'updater-config.json',
depends_on: ['manifest'],
image_pull_secrets: [pull_secret.name],
trigger: {
// we need to run it only on Loki tags that starts with `v`.
ref: ['refs/tags/v*'],
},
steps: [
{
name: 'check-version-is-latest',
image: 'alpine',
when: onTag,
commands: [
'apk add --no-cache bash git',
'git fetch --tags',
"latest_version=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1 | sed 's/v//g')",
'RELEASE_TAG=$(./tools/image-tag)',
'if [ "$RELEASE_TAG" != "$latest_version" ]; then echo "Current version $RELEASE_TAG is not the latest version of Loki. The latest version is $latest_version" && exit 78; fi',
],
},
{
name: 'prepare-helm-chart-update-config',
image: 'alpine',
depends_on: ['check-version-is-latest'],
commands: [
'apk add --no-cache bash git',
'git fetch origin --tags',
'RELEASE_TAG=$(./tools/image-tag)',
'echo $PLUGIN_CONFIG_TEMPLATE > %s' % configFileName,
// replace placeholders with RELEASE TAG
'sed -i -E "s/\\{\\{release\\}\\}/$RELEASE_TAG/g" %s' % configFileName,
],
settings: {
config_template: { from_secret: helm_chart_auto_update_config_template.name },
},
},
{
name: 'trigger-helm-chart-update',
image: drone_updater_plugin_image,
settings: {
github_token: {
from_secret: github_secret.name,
},
config_file: configFileName,
},
depends_on: ['prepare-helm-chart-update-config'],
},
],
},
logql_analyzer(),
pipeline('docker-driver') {
trigger+: onTagOrMain,
steps: [
{
name: 'build and push',
image: 'grafana/loki-build-image:%s' % build_image_version,
depends_on: ['clone'],
environment: {
DOCKER_USERNAME: { from_secret: docker_username_secret.name },
DOCKER_PASSWORD: { from_secret: docker_password_secret.name },
},
commands: [
'git fetch origin --tags',
'make docker-driver-push',
],
volumes: [
{
name: 'docker',
path: '/var/run/docker.sock',
},
],
privileged: true,
},
],
volumes: [
{
name: 'docker',
host: {
path: '/var/run/docker.sock',
},
},
],
},
]
+ [
lambda_promtail(arch)
for arch in ['amd64', 'arm64']
] + [
manifest_ecr(['lambda-promtail'], ['amd64', 'arm64']) {
trigger+: { event: ['push'] },
},
] + [
github_secret,
pull_secret,
docker_username_secret,
docker_password_secret,
ecr_key,
ecr_secret_key,
updater_config_template,
helm_chart_auto_update_config_template,
gpg_passphrase,
gpg_private_key,
]

File diff suppressed because it is too large Load Diff

@ -8,7 +8,7 @@
"subdir": "workflows"
}
},
"version": "87cb5090c36b5332e7f21b5c59e136962d5f4f56"
"version": "98ce96e408db867d64fb95b59a99c24440ddf441"
}
],
"legacyImports": true

@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "87cb5090c36b5332e7f21b5c59e136962d5f4f56",
"sum": "kVlVZPpPz8d/D6UGK9Hto+NeGy7z8NvGygcB1QboxWw="
"version": "98ce96e408db867d64fb95b59a99c24440ddf441",
"sum": "pqEiutdl50ghtCY0wReq+Xa3AymHEyMa1OJQvRQXINI="
}
],
"legacyImports": false

@ -17,11 +17,23 @@ local imageJobs = {
querytee: build.image('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']),
};
local weeklyImageJobs = {
loki: build.weeklyImage('loki', 'cmd/loki'),
fluentd: build.weeklyImage('fluent-plugin-loki', 'clients/cmd/fluentd', platform=['linux/amd64']),
'fluent-bit': build.weeklyImage('fluent-bit-plugin-loki', 'clients/cmd/fluent-bit', platform=['linux/amd64']),
logstash: build.weeklyImage('logstash-output-loki', 'clients/cmd/logstash', platform=['linux/amd64']),
logcli: build.weeklyImage('logcli', 'cmd/logcli'),
'loki-canary': build.weeklyImage('loki-canary', 'cmd/loki-canary'),
'loki-canary-boringcrypto': build.weeklyImage('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto'),
promtail: build.weeklyImage('promtail', 'clients/cmd/promtail'),
querytee: build.weeklyImage('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']),
};
local buildImageVersion = std.extVar('BUILD_IMAGE_VERSION');
local buildImage = 'grafana/loki-build-image:%s' % buildImageVersion;
local golangCiLintVersion = 'v1.55.1';
local imageBuildTimeoutMin = 40;
local imageBuildTimeoutMin = 60;
local imagePrefix = 'grafana';
{
@ -94,4 +106,42 @@ local imagePrefix = 'grafana';
},
},
}),
'images.yml': std.manifestYamlDoc({
name: 'publish images',
on: {
push: {
branches: [
'k[0-9]+*', // This is a weird glob pattern, not a regexp, do not use ".*", see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
'main',
],
},
},
permissions: {
'id-token': 'write',
contents: 'write',
'pull-requests': 'write',
},
jobs: {
check: {
uses: checkTemplate,
with: {
build_image: buildImage,
golang_ci_lint_version: golangCiLintVersion,
release_lib_ref: releaseLibRef,
skip_validation: false,
use_github_app_token: true,
},
},
} + std.mapWithKey(function(name, job)
job
+ lokiRelease.job.withNeeds(['check'])
+ {
env: {
BUILD_TIMEOUT: imageBuildTimeoutMin,
RELEASE_REPO: 'grafana/loki',
RELEASE_LIB_REF: releaseLibRef,
IMAGE_PREFIX: imagePrefix,
},
}, weeklyImageJobs),
}),
}

@ -42,7 +42,7 @@ local releaseLibStep = common.releaseLibStep;
echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
|||),
step.new('Build and export', 'docker/build-push-action@v5')
step.new('Build and export', 'docker/build-push-action@v6')
+ step.withTimeoutMinutes('${{ fromJSON(env.BUILD_TIMEOUT) }}')
+ step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}')
+ step.withEnv({
@ -93,7 +93,7 @@ local releaseLibStep = common.releaseLibStep;
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
|||),
step.new('Build and push', 'docker/build-push-action@v5')
step.new('Build and push', 'docker/build-push-action@v6')
+ step.withTimeoutMinutes('${{ fromJSON(env.BUILD_TIMEOUT) }}')
+ step.with({
context: context,

@ -115,7 +115,6 @@ local validationJob = _validationJob(false);
validationMakeStep('validate dev cluster config', 'validate-dev-cluster-config'),
validationMakeStep('check example config docs', 'check-example-config-doc'),
validationMakeStep('check helm reference doc', 'documentation-helm-reference-check'),
validationMakeStep('check drone drift', 'check-drone-drift'),
]) + {
steps+: [
step.new('build docs website')

@ -0,0 +1,433 @@
"jobs":
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.33.6"
"golang_ci_lint_version": "v1.55.1"
"release_lib_ref": "main"
"skip_validation": false
"use_github_app_token": true
"fluent-bit":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/clients/cmd/fluent-bit/Dockerfile"
"platforms": "linux/amd64"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/fluent-bit-plugin-loki:${{ steps.weekly-version.outputs.version }}"
"fluentd":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/clients/cmd/fluentd/Dockerfile"
"platforms": "linux/amd64"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/fluent-plugin-loki:${{ steps.weekly-version.outputs.version }}"
"logcli":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/cmd/logcli/Dockerfile"
"platforms": "linux/amd64,linux/arm64,linux/arm"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/logcli:${{ steps.weekly-version.outputs.version }}"
"logstash":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/clients/cmd/logstash/Dockerfile"
"platforms": "linux/amd64"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/logstash-output-loki:${{ steps.weekly-version.outputs.version }}"
"loki":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/cmd/loki/Dockerfile"
"platforms": "linux/amd64,linux/arm64,linux/arm"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/loki:${{ steps.weekly-version.outputs.version }}"
"loki-canary":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/cmd/loki-canary/Dockerfile"
"platforms": "linux/amd64,linux/arm64,linux/arm"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/loki-canary:${{ steps.weekly-version.outputs.version }}"
"loki-canary-boringcrypto":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/cmd/loki-canary-boringcrypto/Dockerfile"
"platforms": "linux/amd64,linux/arm64,linux/arm"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/loki-canary-boringcrypto:${{ steps.weekly-version.outputs.version }}"
"promtail":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/clients/cmd/promtail/Dockerfile"
"platforms": "linux/amd64,linux/arm64,linux/arm"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/promtail:${{ steps.weekly-version.outputs.version }}"
"querytee":
"env":
"BUILD_TIMEOUT": 60
"IMAGE_PREFIX": "grafana"
"RELEASE_LIB_REF": "main"
"RELEASE_REPO": "grafana/loki"
"needs":
- "check"
"runs-on": "ubuntu-latest"
"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": "Set up QEMU"
"uses": "docker/setup-qemu-action@v3"
- "name": "set up docker buildx"
"uses": "docker/setup-buildx-action@v3"
- "name": "Login to DockerHub (from vault)"
"uses": "grafana/shared-workflows/actions/dockerhub-login@main"
- "id": "weekly-version"
"name": "Get weekly version"
"run": |
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
"working-directory": "release"
- "name": "Build and push"
"timeout-minutes": "${{ fromJSON(env.BUILD_TIMEOUT) }}"
"uses": "docker/build-push-action@v6"
"with":
"build-args": "IMAGE_TAG=${{ steps.weekly-version.outputs.version }}"
"context": "release"
"file": "release/cmd/querytee/Dockerfile"
"platforms": "linux/amd64"
"push": true
"tags": "${{ env.IMAGE_PREFIX }}/loki-query-tee:${{ steps.weekly-version.outputs.version }}"
"name": "publish images"
"on":
"push":
"branches":
- "k[0-9]+*"
- "main"
"permissions":
"contents": "write"
"id-token": "write"
"pull-requests": "write"

@ -2,7 +2,7 @@ concurrency:
group: "create-release-pr-${{ github.sha }}"
env:
BUILD_ARTIFACTS_BUCKET: "loki-build-artifacts"
BUILD_TIMEOUT: 40
BUILD_TIMEOUT: 60
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
DRY_RUN: false
@ -198,7 +198,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -260,7 +260,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -322,7 +322,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -386,7 +386,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -448,7 +448,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -512,7 +512,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -576,7 +576,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -640,7 +640,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -704,7 +704,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"

@ -2,7 +2,7 @@ concurrency:
group: "create-release-pr-${{ github.sha }}"
env:
BUILD_ARTIFACTS_BUCKET: "loki-build-artifacts"
BUILD_TIMEOUT: 40
BUILD_TIMEOUT: 60
CHANGELOG_PATH: "CHANGELOG.md"
DOCKER_USERNAME: "grafana"
DRY_RUN: false
@ -198,7 +198,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -260,7 +260,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -322,7 +322,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -386,7 +386,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -448,7 +448,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -512,7 +512,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -576,7 +576,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -640,7 +640,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"
@ -704,7 +704,7 @@ jobs:
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v5"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }}"
context: "release"

@ -12,7 +12,7 @@ help:
.PHONY: fluentd-image, fluentd-push, fluentd-test
.PHONY: push-images push-latest save-images load-images promtail-image loki-image build-image build-image-push
.PHONY: bigtable-backup, push-bigtable-backup
.PHONY: benchmark-store, drone, check-drone-drift, check-mod
.PHONY: benchmark-store, check-mod
.PHONY: migrate migrate-image lint-markdown ragel
.PHONY: doc check-doc
.PHONY: validate-example-configs generate-example-config-doc check-example-config-doc
@ -36,7 +36,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
# or you can override this with an environment variable
BUILD_IN_CONTAINER ?= true
# ensure you run `make drone` and `make release-workflows` after changing this
# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.33.6
GO_VERSION := 1.22.6
@ -699,27 +699,6 @@ benchmark-store:
go run ./pkg/storage/hack/main.go
$(GOTEST) ./pkg/storage/ -bench=. -benchmem -memprofile memprofile.out -cpuprofile cpuprofile.out -trace trace.out
# regenerate drone yaml
drone:
ifeq ($(BUILD_IN_CONTAINER),true)
@mkdir -p $(shell pwd)/.pkg
@mkdir -p $(shell pwd)/.cache
$(SUDO) docker run $(RM) $(TTY) -i \
-e DRONE_SERVER -e DRONE_TOKEN \
-v $(shell pwd)/.cache:/go/cache$(MOUNT_FLAGS) \
-v $(shell pwd)/.pkg:/go/pkg$(MOUNT_FLAGS) \
-v $(shell pwd):/src/loki$(MOUNT_FLAGS) \
$(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) $@;
else
drone jsonnet --stream --format -V __build-image-version=$(BUILD_IMAGE_VERSION) --source .drone/drone.jsonnet --target .drone/drone.yml
drone lint .drone/drone.yml --trusted
drone sign --save grafana/loki .drone/drone.yml || echo "You must set DRONE_SERVER and DRONE_TOKEN. These values can be found on your [drone account](http://drone.grafana.net/account) page."
endif
check-drone-drift:
./tools/check-drone-drift.sh $(BUILD_IMAGE_VERSION)
# support go modules
check-mod:
ifeq ($(BUILD_IN_CONTAINER),true)

Loading…
Cancel
Save