Skip to content

Commit

Permalink
ci: pull latest release code to fix docker driver
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Dec 17, 2024
1 parent f333413 commit b251d59
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subdir": "workflows"
}
},
"version": "186e3449678a196bf08d9d55355e3b22d8e20ebf"
"version": "cfa24256090828f566f1ba59292ce65d8db4a4ae"
}
],
"legacyImports": true
Expand Down
4 changes: 2 additions & 2 deletions .github/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "186e3449678a196bf08d9d55355e3b22d8e20ebf",
"sum": "T9x+84EmTZEkrcxzsQYZI5HffdnnIJs6q1tCfe7VVes="
"version": "cfa24256090828f566f1ba59292ce65d8db4a4ae",
"sum": "tml1dcFlo15kEE6JvN/nPY2xkhfeF3ERZjAyFbnguHA="
}
],
"legacyImports": false
Expand Down
4 changes: 3 additions & 1 deletion .github/release-workflows.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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'),
Expand All @@ -19,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', buildImage=buildImage, platform=['linux/amd64', 'linux/arm64']),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', dockerPluginDir, buildImage=buildImage, platform=['linux/amd64', 'linux/arm64']),
};

local weeklyImageJobs = {
Expand Down Expand Up @@ -74,6 +75,7 @@ local weeklyImageJobs = {
getDockerCredsFromVault=true,
imagePrefix='grafana',
releaseLibRef=releaseLibRef,
pluginBuildDir=dockerPluginDir,
releaseRepo='grafana/loki',
useGitHubAppToken=true,
), false, false
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,16 @@ jobs:
BUILD_IMAGE=grafana/loki-build-image:0.34.3
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/plugins/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 }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "compress rootfs"
run: |
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"
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,16 @@ jobs:
BUILD_IMAGE=grafana/loki-build-image:0.34.3
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/plugins/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 }}"
- if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "compress rootfs"
run: |
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"
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
parent: false
path: "release/dist"
process_gcloudignore: false
publishDockerDriver:
publishDockerPlugins:
needs:
- "createRelease"
runs-on: "ubuntu-latest"
Expand All @@ -121,6 +121,11 @@ jobs:
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:
Expand All @@ -135,21 +140,18 @@ jobs:
uses: "docker/setup-buildx-action@v3"
- name: "Login to DockerHub (from vault)"
uses: "grafana/shared-workflows/actions/dockerhub-login@main"
- name: "download plugins"
- name: "download and prepare plugins"
run: |
echo "downloading images to $(pwd)/plugins"
gsutil cp -r gs://${BUILD_ARTIFACTS_BUCKET}/${{ needs.createRelease.outputs.sha }}/plugins .
- env:
BUILD_DIR: "clients/cmd/docker-driver"
IMAGE_TAG: "${{ needs.version.outputs.version }}"
if: "${{ fromJSON(needs.version.outputs.pr_created) }}"
name: "Package as Docker plugin"
run: |
rm -rf "${{ env.BUILD_DIR }}/rootfs" || true
mkdir "${{ env.BUILD_DIR }}/rootfs"
tar -x -C "${{ env.BUILD_DIR }}/rootfs" -f "plugins/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
docker plugin create "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}" "${{ env.BUILD_DIR }}"
docker plugin push "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
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"
Expand Down Expand Up @@ -188,6 +190,7 @@ jobs:
needs:
- "createRelease"
- "publishImages"
- "publishDockerPlugins"
runs-on: "ubuntu-latest"
steps:
- name: "pull code to release"
Expand Down

0 comments on commit b251d59

Please sign in to comment.