Skip to content

Commit

Permalink
Merge branch 'main' into karsten/helm-checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies authored Nov 2, 2023
2 parents 21d7462 + 66b36cb commit 120586f
Show file tree
Hide file tree
Showing 4,000 changed files with 679,433 additions and 171,977 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "grafana/loki-build-image:0.28.3",
"image": "grafana/loki-build-image:0.29.0",
"containerEnv": {
"BUILD_IN_CONTAINER": "false"
},
Expand Down
26 changes: 26 additions & 0 deletions .drone/docker-manifest-operator.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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
69 changes: 57 additions & 12 deletions .drone/drone.jsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local apps = ['loki', 'loki-canary', 'logcli'];
local apps = ['loki', 'loki-canary', 'loki-canary-boringcrypto', 'logcli'];
local archs = ['amd64', 'arm64', 'arm'];

local build_image_version = std.extVar('__build-image-version');
Expand Down Expand Up @@ -199,10 +199,10 @@ local querytee() = pipeline('querytee-amd64') + arch_image('amd64', 'main') {
depends_on: ['check'],
};

local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'main') {
local fluentbit(arch) = pipeline('fluent-bit-' + arch) + arch_image(arch) {
steps+: [
// dry run for everything that is not tag or main
clients_docker('amd64', 'fluent-bit') {
clients_docker(arch, 'fluent-bit') {
depends_on: ['image-tag'],
when: onPRs,
settings+: {
Expand All @@ -212,7 +212,7 @@ local fluentbit() = pipeline('fluent-bit-amd64') + arch_image('amd64', 'main') {
},
] + [
// publish for tag or main
clients_docker('amd64', 'fluent-bit') {
clients_docker(arch, 'fluent-bit') {
depends_on: ['image-tag'],
when: onTagOrMain,
settings+: {
Expand Down Expand Up @@ -330,7 +330,9 @@ local lokioperator(arch) = pipeline('lokioperator-' + arch) + arch_image(arch) {
// publish for tag or main
docker_operator(arch, 'loki-operator') {
depends_on: ['image-tag'],
when: onTagOrMain,
when: onTagOrMain {
ref: ['refs/heads/main', 'refs/tags/operator/v*'],
},
settings+: {},
},
],
Expand Down Expand Up @@ -361,7 +363,6 @@ local logql_analyzer() = pipeline('logql-analyzer') + arch_image('amd64') {
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 @@ -415,9 +416,34 @@ local manifest(apps) = pipeline('manifest') {
] + [
'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 + [{
Expand Down Expand Up @@ -472,7 +498,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {

[
pipeline('loki-build-image') {
local build_image_tag = '0.28.3',
local build_image_tag = '0.31.2',
workspace: {
base: '/src',
path: 'loki',
Expand Down Expand Up @@ -551,7 +577,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
'cd -',
]) { depends_on: ['clone'], when: onPRs },
make('test', container=false) { depends_on: ['clone-target-branch', 'check-generated-files'] },
run('test-target-branch', commands=['cd ../loki-target-branch', 'BUILD_IN_CONTAINER=false make test']) { depends_on: ['clone-target-branch'], when: onPRs },
run('test-target-branch', commands=['cd ../loki-target-branch && BUILD_IN_CONTAINER=false make test']) { depends_on: ['clone-target-branch'], when: onPRs },
make('compare-coverage', container=false, args=[
'old=../loki-target-branch/test_results.txt',
'new=test_results.txt',
Expand Down Expand Up @@ -584,7 +610,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
make('check-example-config-doc', container=false) { depends_on: ['clone'] },
{
name: 'build-docs-website',
image: 'grafana/docs-base:latest',
image: 'grafana/docs-base:e6ef023f8b8',
commands: [
'mkdir -p /hugo/content/docs/loki/latest',
'cp -r docs/sources/* /hugo/content/docs/loki/latest/',
Expand Down Expand Up @@ -651,16 +677,34 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
)
for arch in archs
] + [
lokioperator(arch)
lokioperator(arch) {
trigger+: {
ref: [
'refs/heads/main',
'refs/tags/operator/v*',
'refs/pull/*/head',
],
},
}
for arch in archs
] + [
fluentbit(arch)
for arch in archs
] + [
fluentbit(),
fluentd(),
logstash(),
querytee(),
manifest(['promtail', 'loki', 'loki-canary', 'loki-operator']) {
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 {
Expand Down Expand Up @@ -872,6 +916,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
DOCKER_PASSWORD: { from_secret: docker_password_secret.name },
},
commands: [
'git fetch origin --tags',
'make docker-driver-push',
],
volumes: [
Expand Down
Loading

0 comments on commit 120586f

Please sign in to comment.