fix: fix the docker driver build (backport release-3.3.x) (#15478)

pull/15326/head v3.3.2
Trevor Whitney 5 months ago committed by GitHub
parent bc1794e972
commit 23b5fc2c9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .github/jsonnetfile.json
  2. 4
      .github/jsonnetfile.lock.json
  3. 19
      .github/release-workflows.jsonnet
  4. 104
      .github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet
  5. 5
      .github/vendor/github.com/grafana/loki-release/workflows/main.jsonnet
  6. 68
      .github/vendor/github.com/grafana/loki-release/workflows/release.libsonnet
  7. 21
      .github/vendor/github.com/grafana/loki-release/workflows/workflows.jsonnet
  8. 2
      .github/workflows/check.yml
  9. 2
      .github/workflows/images.yml
  10. 36
      .github/workflows/minor-release-pr.yml
  11. 36
      .github/workflows/patch-release-pr.yml
  12. 43
      .github/workflows/release.yml
  13. 2
      Makefile

@ -8,7 +8,7 @@
"subdir": "workflows"
}
},
"version": "21f1189544e3976070cbdb6463f64c7a32dcc176"
"version": "cfa24256090828f566f1ba59292ce65d8db4a4ae"
}
],
"legacyImports": true

@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "21f1189544e3976070cbdb6463f64c7a32dcc176",
"sum": "IPS1oGR8k7jk6J2snciTycWFgtISCwXSPhJ3A+nEGvY="
"version": "cfa24256090828f566f1ba59292ce65d8db4a4ae",
"sum": "tml1dcFlo15kEE6JvN/nPY2xkhfeF3ERZjAyFbnguHA="
}
],
"legacyImports": false

@ -1,9 +1,14 @@
local lokiRelease = import 'workflows/main.jsonnet';
local build = lokiRelease.build;
local build = lokiRelease.build;
local releaseLibRef = 'main';
local checkTemplate = 'grafana/loki-release/.github/workflows/check.yml@%s' % releaseLibRef;
local buildImageVersion = std.extVar('BUILD_IMAGE_VERSION');
local buildImage = 'grafana/loki-build-image:%s' % buildImageVersion;
local golangCiLintVersion = 'v1.60.3';
local imageBuildTimeoutMin = 60;
local imagePrefix = 'grafana';
local dockerPluginDir = 'clients/cmd/docker-driver';
local imageJobs = {
loki: build.image('loki', 'cmd/loki'),
@ -15,7 +20,7 @@ local imageJobs = {
'loki-canary-boringcrypto': build.image('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto'),
promtail: build.image('promtail', 'clients/cmd/promtail'),
querytee: build.image('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', 'clients/cmd/docker-driver'),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=['linux/amd64', 'linux/arm64']),
};
local weeklyImageJobs = {
@ -25,13 +30,6 @@ local weeklyImageJobs = {
promtail: build.weeklyImage('promtail', 'clients/cmd/promtail'),
};
local buildImageVersion = std.extVar('BUILD_IMAGE_VERSION');
local buildImage = 'grafana/loki-build-image:%s' % buildImageVersion;
local golangCiLintVersion = 'v1.60.3';
local imageBuildTimeoutMin = 60;
local imagePrefix = 'grafana';
{
'patch-release-pr.yml': std.manifestYamlDoc(
lokiRelease.releasePRWorkflow(
@ -77,6 +75,7 @@ local imagePrefix = 'grafana';
getDockerCredsFromVault=true,
imagePrefix='grafana',
releaseLibRef=releaseLibRef,
pluginBuildDir=dockerPluginDir,
releaseRepo='grafana/loki',
useGitHubAppToken=true,
), false, false

@ -108,14 +108,14 @@ local releaseLibStep = common.releaseLibStep;
dockerPlugin: function(
name,
path,
buildImage,
dockerfile='Dockerfile',
context='release',
platform=[
'linux/amd64',
'linux/arm64',
'linux/arm',
]
)
)
job.new()
+ job.withStrategy({
'fail-fast': true,
@ -136,6 +136,7 @@ local releaseLibStep = common.releaseLibStep;
+ step.withId('platform')
+ step.withRun(|||
mkdir -p images
mkdir -p plugins
platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
@ -150,108 +151,39 @@ local releaseLibStep = common.releaseLibStep;
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({
IMAGE_TAG: '${{ needs.version.outputs.version }}',
})
+ step.with({
context: context,
file: 'release/%s/%s' % [path, dockerfile],
platforms: '${{ matrix.platform }}',
push: false,
tags: '${{ env.IMAGE_PREFIX }}/%s:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}' % [name],
outputs: 'type=docker,dest=release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name,
'build-args': 'IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}',
outputs: 'type=local,dest=release/plugins/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}' % name,
'build-args': |||
%s
||| % std.rstripChars(std.lines([
'IMAGE_TAG=${{ needs.version.outputs.version }}',
'GOARCH=${{ steps.platform.outputs.platform_short }}',
('BUILD_IMAGE=%s' % buildImage),
]), '\n'),
}),
releaseStep('Package as Docker plugin')
step.new('compress rootfs')
+ step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}')
+ step.withEnv({
IMAGE_TAG: '${{ needs.version.outputs.version }}',
BUILD_DIR: 'release/%s' % [path],
})
+ step.withRun(|||
rm -rf "${{ env.BUILD_DIR }}/rootfs" || true
mkdir "${{ env.BUILD_DIR }}/rootfs"
tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}"
|||),
tar -cf release/plugins/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar \
-C release/plugins/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }} \
.
||| % [name, name]),
step.new('upload artifacts', 'google-github-actions/upload-cloud-storage@v2')
+ step.withIf('${{ fromJSON(needs.version.outputs.pr_created) }}')
+ step.with({
path: 'release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name,
destination: '${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images', //TODO: make bucket configurable
path: 'release/plugins/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name,
destination: '${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/plugins',
process_gcloudignore: false,
}),
]),
weeklyDockerPlugin: function(
name,
path,
dockerfile='Dockerfile',
context='release',
platform=[
'linux/amd64',
'linux/arm64',
'linux/arm',
]
)
job.new()
+ job.withStrategy({
matrix: {
platform: platform,
},
})
+ job.withSteps([
common.fetchReleaseLib,
common.fetchReleaseRepo,
common.setupNode,
step.new('Set up QEMU', 'docker/setup-qemu-action@v3'),
step.new('set up docker buildx', 'docker/setup-buildx-action@v3'),
step.new('Login to DockerHub (from vault)', 'grafana/shared-workflows/actions/dockerhub-login@main'),
releaseStep('Get weekly version')
+ step.withId('weekly-version')
+ step.withRun(|||
echo "version=$(./tools/image-tag)" >> $GITHUB_OUTPUT
platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
echo "platform_short=$(echo ${{ matrix.platform }} | cut -d / -f 2)" >> $GITHUB_OUTPUT
if [[ "${platform}" == "linux/arm64" ]]; then
echo "plugin_arch=-arm64" >> $GITHUB_OUTPUT
else
echo "plugin_arch=" >> $GITHUB_OUTPUT
fi
|||),
step.new('Build and export', 'docker/build-push-action@v6')
+ step.withTimeoutMinutes('${{ fromJSON(env.BUILD_TIMEOUT) }}')
+ step.with({
context: context,
file: 'release/%s/%s' % [path, dockerfile],
platforms: '${{ matrix.platform }}',
push: false,
tags: '${{ env.IMAGE_PREFIX }}/%s:${{ steps.weekly-version.outputs.version }}' % [name],
outputs: 'type=docker,dest=release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar' % name,
'build-args': 'IMAGE_TAG=${{ steps.weekly-version.outputs.version }},GOARCH=${{ steps.weekly-version.outputs.platform_short }}',
}),
releaseStep('Package and push as Docker plugin')
+ step.withEnv({
IMAGE_TAG: '${{ steps.weekly-version.outputs.version }}',
BUILD_DIR: 'release/%s' % [path],
})
+ step.withRun(|||
rm -rf "${{ env.BUILD_DIR }}/rootfs" || true
mkdir "${{ env.BUILD_DIR }}/rootfs"
tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}"
docker plugin push "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}"
|||),
]),
version:
job.new()
+ job.withSteps([

@ -83,11 +83,13 @@
dockerUsername='grafanabot',
getDockerCredsFromVault=false,
imagePrefix='grafana',
pluginBuildDir='release/plugin-tmp-dir',
publishBucket='',
publishToGCS=false,
releaseLibRef='main',
releaseRepo='grafana/loki-release',
useGitHubAppToken=true,
dockerPluginPath='clients/cmd/docker-driver',
) {
name: 'create release',
on: {
@ -119,7 +121,8 @@
shouldRelease: $.release.shouldRelease,
createRelease: $.release.createRelease,
publishImages: $.release.publishImages(getDockerCredsFromVault, dockerUsername),
publishRelease: $.release.publishRelease,
publishDockerPlugins: $.release.publishDockerPlugins(pluginBuildDir, getDockerCredsFromVault, dockerUsername),
publishRelease: $.release.publishRelease(['createRelease', 'publishImages', 'publishDockerPlugins']),
},
},
check: {

@ -186,19 +186,57 @@ local pullRequestFooter = 'Merging this PR will release the [artifacts](https://
]
),
publishRelease: job.new()
+ job.withNeeds(['createRelease', 'publishImages'])
+ job.withSteps([
common.fetchReleaseRepo,
common.githubAppToken,
common.setToken,
releaseStep('publish release')
+ step.withIf('${{ !fromJSON(needs.createRelease.outputs.exists) || (needs.createRelease.outputs.draft && fromJSON(needs.createRelease.outputs.draft)) }}')
+ step.withEnv({
GH_TOKEN: '${{ steps.github_app_token.outputs.token }}',
})
+ step.withRun(|||
gh release edit ${{ needs.createRelease.outputs.name }} --draft=false --latest=${{ needs.createRelease.outputs.isLatest }}
|||),
]),
publishDockerPlugins: function(path, getDockerCredsFromVault=false, dockerUsername='grafanabot')
job.new()
+ job.withNeeds(['createRelease'])
+ job.withSteps(
[
common.fetchReleaseLib,
common.fetchReleaseRepo,
common.googleAuth,
common.setupGoogleCloudSdk,
step.new('Set up QEMU', 'docker/setup-qemu-action@v3'),
step.new('set up docker buildx', 'docker/setup-buildx-action@v3'),
] + (if getDockerCredsFromVault then [
step.new('Login to DockerHub (from vault)', 'grafana/shared-workflows/actions/dockerhub-login@main'),
] else [
step.new('Login to DockerHub (from secrets)', 'docker/login-action@v3')
+ step.with({
username: dockerUsername,
password: '${{ secrets.DOCKER_PASSWORD }}',
}),
]) +
[
step.new('download and prepare plugins')
+ step.withRun(|||
echo "downloading images to $(pwd)/plugins"
gsutil cp -r gs://${BUILD_ARTIFACTS_BUCKET}/${{ needs.createRelease.outputs.sha }}/plugins .
mkdir -p "release/%s"
||| % path),
step.new('publish docker driver', './lib/actions/push-images')
+ step.with({
imageDir: 'plugins',
imagePrefix: '${{ env.IMAGE_PREFIX }}',
isPlugin: true,
buildDir: 'release/%s' % path,
}),
]
),
publishRelease: function(dependencies=['createRelease'])
job.new()
+ job.withNeeds(dependencies)
+ job.withSteps([
common.fetchReleaseRepo,
common.githubAppToken,
common.setToken,
releaseStep('publish release')
+ step.withIf('${{ !fromJSON(needs.createRelease.outputs.exists) || (needs.createRelease.outputs.draft && fromJSON(needs.createRelease.outputs.draft)) }}')
+ step.withEnv({
GH_TOKEN: '${{ steps.github_app_token.outputs.token }}',
})
+ step.withRun(|||
gh release edit ${{ needs.createRelease.outputs.name }} --draft=false --latest=${{ needs.createRelease.outputs.isLatest }}
|||),
]),
}

@ -1,15 +1,22 @@
local lokiRelease = import 'main.jsonnet';
local build = lokiRelease.build;
local buildImage = 'grafana/loki-build-image:0.34.3';
local dockerPluginDir = 'clients/cmd/docker-driver';
{
'.github/workflows/release-pr.yml': std.manifestYamlDoc(
lokiRelease.releasePRWorkflow(
imageJobs={
loki: build.image('fake-loki', 'cmd/loki'),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=['linux/amd64', 'linux/arm64']),
},
buildImage=buildImage,
buildArtifactsBucket='loki-build-artifacts',
branches=['release-[0-9]+.[0-9]+.x'],
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
releaseLibRef='release-1.14.x',
releaseRepo='grafana/loki-release',
skipValidation=false,
versioningStrategy='always-bump-patch',
@ -21,12 +28,14 @@ local build = lokiRelease.build;
lokiRelease.releasePRWorkflow(
imageJobs={
loki: build.image('fake-loki', 'cmd/loki'),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=['linux/amd64', 'linux/arm64']),
},
buildImage=buildImage,
buildArtifactsBucket='loki-build-artifacts',
branches=['release-[0-9]+.[0-9]+.x'],
dryRun=true,
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
releaseLibRef='release-1.14.x',
releaseRepo='grafana/loki-release',
skipValidation=false,
versioningStrategy='always-bump-patch',
@ -41,11 +50,13 @@ local build = lokiRelease.build;
lokiRelease.releaseWorkflow(
branches=['release-[0-9]+.[0-9]+.x'],
buildArtifactsBucket='loki-build-artifacts',
getDockerCredsFromVault=true,
dockerUsername='trevorwhitney075',
getDockerCredsFromVault=false,
imagePrefix='trevorwhitney075',
releaseLibRef='release-1.12.x',
pluginBuildDir=dockerPluginDir,
releaseLibRef='release-1.14.x',
releaseRepo='grafana/loki-release',
useGitHubAppToken=false,
useGitHubAppToken=true,
) + {
name: 'Create Release',
on+: {

@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.1"
"build_image": "grafana/loki-build-image:0.34.3"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false

@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.1"
"build_image": "grafana/loki-build-image:0.34.3"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false

@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.1"
build_image: "grafana/loki-build-image:0.34.3"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
@ -144,7 +144,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.3"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
@ -631,6 +631,7 @@ jobs:
name: "parse image platform"
run: |
mkdir -p images
mkdir -p plugins
platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
@ -641,37 +642,33 @@ jobs:
echo "plugin_arch=" >> $GITHUB_OUTPUT
fi
working-directory: "release"
- env:
IMAGE_TAG: "${{ needs.version.outputs.version }}"
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}"
build-args: |
IMAGE_TAG=${{ needs.version.outputs.version }}
GOARCH=${{ steps.platform.outputs.platform_short }}
BUILD_IMAGE=grafana/loki-build-image:0.34.3
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
outputs: "type=local,dest=release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}"
platforms: "${{ matrix.platform }}"
push: false
tags: "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- env:
BUILD_DIR: "release/clients/cmd/docker-driver"
IMAGE_TAG: "${{ needs.version.outputs.version }}"
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Package as Docker plugin"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "compress rootfs"
run: |
rm -rf "${{ env.BUILD_DIR }}/rootfs" || true
mkdir "${{ env.BUILD_DIR }}/rootfs"
tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}"
working-directory: "release"
tar -cf release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar \
-C release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }} \
.
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/plugins"
path: "release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
fail-fast: true
@ -679,7 +676,6 @@ jobs:
platform:
- "linux/amd64"
- "linux/arm64"
- "linux/arm"
promtail:
needs:
- "version"

@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.1"
build_image: "grafana/loki-build-image:0.34.3"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
@ -144,7 +144,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.3"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
@ -631,6 +631,7 @@ jobs:
name: "parse image platform"
run: |
mkdir -p images
mkdir -p plugins
platform="$(echo "${{ matrix.platform}}" | sed "s/\(.*\)\/\(.*\)/\1-\2/")"
echo "platform=${platform}" >> $GITHUB_OUTPUT
@ -641,37 +642,33 @@ jobs:
echo "plugin_arch=" >> $GITHUB_OUTPUT
fi
working-directory: "release"
- env:
IMAGE_TAG: "${{ needs.version.outputs.version }}"
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Build and export"
timeout-minutes: "${{ fromJSON(env.BUILD_TIMEOUT) }}"
uses: "docker/build-push-action@v6"
with:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}"
build-args: |
IMAGE_TAG=${{ needs.version.outputs.version }}
GOARCH=${{ steps.platform.outputs.platform_short }}
BUILD_IMAGE=grafana/loki-build-image:0.34.3
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
outputs: "type=local,dest=release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}"
platforms: "${{ matrix.platform }}"
push: false
tags: "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- env:
BUILD_DIR: "release/clients/cmd/docker-driver"
IMAGE_TAG: "${{ needs.version.outputs.version }}"
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Package as Docker plugin"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "compress rootfs"
run: |
rm -rf "${{ env.BUILD_DIR }}/rootfs" || true
mkdir "${{ env.BUILD_DIR }}/rootfs"
tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "release/images/%s-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
docker plugin create "${{ env.IMAGE_TAG }}${{ steps.platform.outputs.plugin_arch }}" "${{ env.BUILD_DIR }}"
working-directory: "release"
tar -cf release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar \
-C release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }} \
.
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "upload artifacts"
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/plugins"
path: "release/plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
fail-fast: true
@ -679,7 +676,6 @@ jobs:
platform:
- "linux/amd64"
- "linux/arm64"
- "linux/arm"
promtail:
needs:
- "version"

@ -110,6 +110,48 @@ jobs:
parent: false
path: "release/dist"
process_gcloudignore: false
publishDockerPlugins:
needs:
- "createRelease"
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: "auth gcs"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 452.0.0"
- 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"
- name: "download and prepare plugins"
run: |
echo "downloading images to $(pwd)/plugins"
gsutil cp -r gs://${BUILD_ARTIFACTS_BUCKET}/${{ needs.createRelease.outputs.sha }}/plugins .
mkdir -p "release/clients/cmd/docker-driver"
- name: "publish docker driver"
uses: "./lib/actions/push-images"
with:
buildDir: "release/clients/cmd/docker-driver"
imageDir: "plugins"
imagePrefix: "${{ env.IMAGE_PREFIX }}"
isPlugin: true
publishImages:
needs:
- "createRelease"
@ -148,6 +190,7 @@ jobs:
needs:
- "createRelease"
- "publishImages"
- "publishDockerPlugins"
runs-on: "ubuntu-latest"
steps:
- name: "pull code to release"

@ -37,7 +37,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true
# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.34.1
BUILD_IMAGE_VERSION ?= 0.34.3
GO_VERSION := 1.23.1
# Docker image info

Loading…
Cancel
Save