diff --git a/.github/jsonnetfile.json b/.github/jsonnetfile.json index d1326c3c3f8a4..c9c6fe806c5b3 100644 --- a/.github/jsonnetfile.json +++ b/.github/jsonnetfile.json @@ -8,7 +8,7 @@ "subdir": "" } }, - "version": "main" + "version": "release-1.9.x" } ], "legacyImports": true diff --git a/.github/jsonnetfile.lock.json b/.github/jsonnetfile.lock.json index 5ad705a7d5e10..2b767d4e5786b 100644 --- a/.github/jsonnetfile.lock.json +++ b/.github/jsonnetfile.lock.json @@ -8,8 +8,8 @@ "subdir": "" } }, - "version": "5b0f7c1a81ba4c28804d11f755148f7bdb7bf7b9", - "sum": "lF6fC3Lz5jXrTq7JdRdUDe3rSHFfLKZVuru4K1jZzl0=" + "version": "cdff54a3f3fddb9bb5aa725143f6d95a95af00a4", + "sum": "/AsDqe0lxLj3izpkqm1jGWSuCr3SpsjTg+6fVB72+sU=" } ], "legacyImports": false diff --git a/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml b/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml index 4e39d4e779b75..dd5087551c852 100644 --- a/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml +++ b/.github/vendor/github.com/grafana/loki-release/.github/workflows/release-pr.yml @@ -8,6 +8,8 @@ env: VERSIONING_STRATEGY: "always-bump-patch" jobs: check: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -20,102 +22,46 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check generated files" - run: "make BUILD_IN_CONTAINER=false check-generated-files" + run: "make check-generated-files" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check mod" - run: "make BUILD_IN_CONTAINER=false check-mod" + run: "make check-mod" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "shellcheck" - run: "make BUILD_IN_CONTAINER=false lint-scripts" + run: "make lint-scripts" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check docs" - run: "make BUILD_IN_CONTAINER=false check-doc" + run: "make check-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "validate example configs" - run: "make BUILD_IN_CONTAINER=false check-example-config-doc" + run: "make check-example-config-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check helm reference doc" - run: "make BUILD_IN_CONTAINER=false documentation-helm-reference-check" + run: "make documentation-helm-reference-check" shell: "bash" working-directory: "release" create-release-pr: @@ -162,6 +108,8 @@ jobs: shell: "bash" working-directory: "lib" dist: + container: + image: "grafana/loki-build-image:0.33.0" needs: - "test" - "lint" @@ -173,30 +121,15 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "auth gcs" uses: "google-github-actions/auth@v2" with: credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}" - - name: "install dependencies" - run: | - go install github.com/mitchellh/gox@9f71238 - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "build artifacts" - run: "make BUILD_IN_CONTAINER=false SKIP_ARM=true dist" + - env: + BUILD_IN_CONTAINER: false + SKIP_ARM: true + name: "build artifacts" + run: "make SKIP_ARM=true dist" shell: "bash" working-directory: "release" - name: "upload build artifacts" @@ -206,6 +139,8 @@ jobs: path: "release/dist" process_gcloudignore: false lint: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -218,82 +153,18 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint" - run: "make BUILD_IN_CONTAINER=false lint" + run: "make lint" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint jsonnet" - run: "make BUILD_IN_CONTAINER=false lint-jsonnet" + run: "make lint-jsonnet" shell: "bash" working-directory: "release" loki: @@ -313,11 +184,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -400,6 +266,8 @@ jobs: - "linux/arm64" - "linux/arm" test: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -412,77 +280,11 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "test" - run: "make BUILD_IN_CONTAINER=false test" + run: "make test" shell: "bash" working-directory: "release" name: "create release PR" diff --git a/.github/vendor/github.com/grafana/loki-release/main.jsonnet b/.github/vendor/github.com/grafana/loki-release/main.jsonnet index a688455436c54..e8dcf2fd15213 100644 --- a/.github/vendor/github.com/grafana/loki-release/main.jsonnet +++ b/.github/vendor/github.com/grafana/loki-release/main.jsonnet @@ -4,13 +4,14 @@ release: import './workflows/release.libsonnet', validate: import './workflows/validate.libsonnet', releasePRWorkflow: function( + branches=['release-[0-9].[0-9].x', 'k[0-9]*'], + buildImage='grafana/loki-build-image:0.33.0', + dockerUsername='grafana', imageJobs={}, + imagePrefix='grafana', + releaseRepo='grafana/loki-release', skipValidation=false, versioningStrategy='always-bump-patch', - releaseRepo='grafana/loki-release', - dockerUsername='grafana', - imagePrefix='grafana', - branches=['release-[0-9].[0-9].x', 'k[0-9]*'] ) { name: 'create release PR', on: { @@ -33,8 +34,8 @@ VERSIONING_STRATEGY: versioningStrategy, }, local validationSteps = ['test', 'lint', 'check'], - jobs: $.validate { - dist: $.build.dist + $.common.job.withNeeds(validationSteps), + jobs: $.validate(buildImage) { + dist: $.build.dist(buildImage) + $.common.job.withNeeds(validationSteps), } + std.mapWithKey(function(name, job) job + $.common.job.withNeeds(validationSteps), imageJobs) + { local buildImageSteps = ['dist'] + std.objectFields(imageJobs), 'create-release-pr': $.release.createReleasePR + $.common.job.withNeeds(buildImageSteps), diff --git a/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet b/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet index ba2ebdebf354d..2162db51d18e7 100644 --- a/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet +++ b/.github/vendor/github.com/grafana/loki-release/workflows/build.libsonnet @@ -25,7 +25,7 @@ local releaseLibStep = common.releaseLibStep; + job.withSteps([ common.fetchReleaseLib, common.fetchReleaseRepo, - common.setupGo, + // common.setupGo, common.setupNode, common.googleAuth, @@ -91,34 +91,41 @@ local releaseLibStep = common.releaseLibStep; }), ]), - dist: job.new() - + job.withSteps([ - common.fetchReleaseRepo, - common.setupGo, - common.googleAuth, + dist: function(buildImage) + job.new() + + job.withContainer({ + image: buildImage, + }) + + job.withSteps([ + common.fetchReleaseRepo, + common.googleAuth, - step.new('install dependencies') + - step.withRun(||| - go install github.com/mitchellh/gox@9f71238 - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 + // step.new('install dependencies') + + // step.withRun(||| + // go install github.com/mitchellh/gox@9f71238 + // go install github.com/bufbuild/buf/cmd/buf@v1.4.0 + // go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 + // go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - |||), + // sudo apt update + // sudo apt install -qy musl gnupg ragel \ + // file zip unzip jq gettext \ + // protobuf-compiler libprotobuf-dev \ + // libsystemd-dev jq + // |||), - releaseStep('build artifacts') - + step.withRun('make BUILD_IN_CONTAINER=false SKIP_ARM=true dist'), + releaseStep('build artifacts') + + step.withEnv({ + BUILD_IN_CONTAINER: false, + SKIP_ARM: true, + }) + + step.withRun('make SKIP_ARM=true dist'), - step.new('upload build artifacts', 'google-github-actions/upload-cloud-storage@v2') - + step.with({ - path: 'release/dist', - destination: 'loki-build-artifacts/${{ github.sha }}', //TODO: make bucket configurable - process_gcloudignore: false, - }), - ]), + step.new('upload build artifacts', 'google-github-actions/upload-cloud-storage@v2') + + step.with({ + path: 'release/dist', + destination: 'loki-build-artifacts/${{ github.sha }}', //TODO: make bucket configurable + process_gcloudignore: false, + }), + ]), } diff --git a/.github/vendor/github.com/grafana/loki-release/workflows/common.libsonnet b/.github/vendor/github.com/grafana/loki-release/workflows/common.libsonnet index 1da9bbf3c768e..eefbf9fd33e05 100644 --- a/.github/vendor/github.com/grafana/loki-release/workflows/common.libsonnet +++ b/.github/vendor/github.com/grafana/loki-release/workflows/common.libsonnet @@ -44,6 +44,12 @@ withOutputs: function(outputs) { outputs: outputs, }, + withContainer: function(container) { + container: container, + }, + withEnv: function(env) { + env: env, + }, }, releaseStep: function(name, uses=null) $.step.new(name, uses) + @@ -64,18 +70,18 @@ repository: 'grafana/loki-release', path: 'lib', }), - setupGo: $.step.new('setup go', 'actions/setup-go@v5') - + $.step.with({ - 'go-version-file': 'release/go.mod', - 'cache-dependency-path': 'release/go.sum', - }), + // setupGo: $.step.new('setup go', 'actions/setup-go@v5') + // + $.step.with({ + // 'go-version-file': 'release/go.mod', + // 'cache-dependency-path': 'release/go.sum', + // }), setupNode: $.step.new('setup node', 'actions/setup-node@v4') + $.step.with({ 'node-version': 20, }), - makeTarget: function(target) 'make BUILD_IN_CONTAINER=false %s' % target, + makeTarget: function(target) 'make %s' % target, alwaysGreen: { steps: [ diff --git a/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet b/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet index df114b1fae72e..3ec9485f53486 100644 --- a/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet +++ b/.github/vendor/github.com/grafana/loki-release/workflows/validate.libsonnet @@ -7,79 +7,85 @@ local setupValidationDeps = function(job) job { steps: [ common.fetchReleaseRepo, common.fetchReleaseLib, - common.setupGo, - common.setupNode, - step.new('install dependencies') + - step.withRun(||| - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 + // common.setupGo, + // common.setupNode, + // step.new('install dependencies') + + // step.withRun(||| + // go install github.com/bufbuild/buf/cmd/buf@v1.4.0 + // go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 + // go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 + // go install github.com/fatih/faillint@v1.11.0 + // go install golang.org/x/tools/cmd/goimports@v0.7.0 + // go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 + // go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 + // go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 + // go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - |||), - step.new('install golangci-lint', './lib/actions/install-binary') - + step.with({ - binary: 'golangci-lint', - version: '1.55.1', - download_url: 'https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz', - tarball_binary_path: '*/${binary}', - smoke_test: '${binary} version', - }), - step.new('install shellcheck', './lib/actions/install-binary') - + step.with({ - binary: 'shellcheck', - version: '0.9.0', - download_url: 'https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz', - tarball_binary_path: '*/${binary}', - smoke_test: '${binary} --version', - tar_args: 'xvf', - }), - step.new('install helm', './lib/actions/install-binary') - + step.with({ - binary: 'helm', - version: '3.2.3', - download_url: 'https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz', - tarball_binary_path: '*/${binary}', - smoke_test: '${binary} version', - }), - step.new('install helm-docs', './lib/actions/install-binary') - + step.with({ - binary: 'helm-docs', - version: '1.11.2', - download_url: 'https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz', - tarball_binary_path: '${binary}', - smoke_test: '${binary} --version', - }), - step.new('install jsonnetfmt', './lib/actions/install-binary') - + step.with({ - binary: 'jsonnetfmt', - version: '0.18.0', - download_url: 'https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz', - tarball_binary_path: '${binary}', - smoke_test: '${binary} --version', - }), + // sudo apt update + // sudo apt install -qy musl gnupg ragel \ + // file zip unzip jq gettext \ + // protobuf-compiler libprotobuf-dev \ + // libsystemd-dev jq + // |||), + // step.new('install golangci-lint', './lib/actions/install-binary') + // + step.with({ + // binary: 'golangci-lint', + // version: '1.55.1', + // download_url: 'https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz', + // tarball_binary_path: '*/${binary}', + // smoke_test: '${binary} version', + // }), + // step.new('install shellcheck', './lib/actions/install-binary') + // + step.with({ + // binary: 'shellcheck', + // version: '0.9.0', + // download_url: 'https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz', + // tarball_binary_path: '*/${binary}', + // smoke_test: '${binary} --version', + // tar_args: 'xvf', + // }), + // step.new('install helm', './lib/actions/install-binary') + // + step.with({ + // binary: 'helm', + // version: '3.2.3', + // download_url: 'https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz', + // tarball_binary_path: '*/${binary}', + // smoke_test: '${binary} version', + // }), + // step.new('install helm-docs', './lib/actions/install-binary') + // + step.with({ + // binary: 'helm-docs', + // version: '1.11.2', + // download_url: 'https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz', + // tarball_binary_path: '${binary}', + // smoke_test: '${binary} --version', + // }), + // step.new('install jsonnetfmt', './lib/actions/install-binary') + // + step.with({ + // binary: 'jsonnetfmt', + // version: '0.18.0', + // download_url: 'https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz', + // tarball_binary_path: '${binary}', + // smoke_test: '${binary} --version', + // }), ] + job.steps, }; -{ +function(buildImage) { local validationMakeStep = function(name, target) releaseStep(name) + step.withIf('${{ !fromJSON(env.SKIP_VALIDATION) }}') + + step.withEnv({ + BUILD_IN_CONTAINER: false, + }) + step.withRun(common.makeTarget(target)), test: setupValidationDeps( job.new() + + job.withContainer({ + image: buildImage, + }) + job.withSteps([ validationMakeStep('test', 'test'), ]) @@ -87,6 +93,9 @@ local setupValidationDeps = function(job) job { lint: setupValidationDeps( job.new() + + job.withContainer({ + image: buildImage, + }) + job.withSteps([ validationMakeStep('lint', 'lint'), validationMakeStep('lint jsonnet', 'lint-jsonnet'), @@ -95,6 +104,9 @@ local setupValidationDeps = function(job) job { check: setupValidationDeps( job.new() + + job.withContainer({ + image: buildImage, + }) + job.withSteps([ validationMakeStep('check generated files', 'check-generated-files'), validationMakeStep('check mod', 'check-mod'), diff --git a/.github/workflows/minor-release-pr.yml b/.github/workflows/minor-release-pr.yml index 71f5e2de32d1d..e10c20737ccd9 100644 --- a/.github/workflows/minor-release-pr.yml +++ b/.github/workflows/minor-release-pr.yml @@ -8,6 +8,8 @@ env: VERSIONING_STRATEGY: "always-bump-minor" jobs: check: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -20,102 +22,46 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check generated files" - run: "make BUILD_IN_CONTAINER=false check-generated-files" + run: "make check-generated-files" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check mod" - run: "make BUILD_IN_CONTAINER=false check-mod" + run: "make check-mod" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "shellcheck" - run: "make BUILD_IN_CONTAINER=false lint-scripts" + run: "make lint-scripts" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check docs" - run: "make BUILD_IN_CONTAINER=false check-doc" + run: "make check-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "validate example configs" - run: "make BUILD_IN_CONTAINER=false check-example-config-doc" + run: "make check-example-config-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check helm reference doc" - run: "make BUILD_IN_CONTAINER=false documentation-helm-reference-check" + run: "make documentation-helm-reference-check" shell: "bash" working-directory: "release" create-release-pr: @@ -171,6 +117,8 @@ jobs: shell: "bash" working-directory: "lib" dist: + container: + image: "grafana/loki-build-image:0.33.0" needs: - "test" - "lint" @@ -182,30 +130,15 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "auth gcs" uses: "google-github-actions/auth@v2" with: credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}" - - name: "install dependencies" - run: | - go install github.com/mitchellh/gox@9f71238 - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "build artifacts" - run: "make BUILD_IN_CONTAINER=false SKIP_ARM=true dist" + - env: + BUILD_IN_CONTAINER: false + SKIP_ARM: true + name: "build artifacts" + run: "make SKIP_ARM=true dist" shell: "bash" working-directory: "release" - name: "upload build artifacts" @@ -231,11 +164,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -332,11 +260,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -417,6 +340,8 @@ jobs: platform: - "linux/amd64" lint: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -429,82 +354,18 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint" - run: "make BUILD_IN_CONTAINER=false lint" + run: "make lint" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint jsonnet" - run: "make BUILD_IN_CONTAINER=false lint-jsonnet" + run: "make lint-jsonnet" shell: "bash" working-directory: "release" logcli: @@ -524,11 +385,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -627,11 +483,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -728,11 +579,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -831,11 +677,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -934,11 +775,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1037,11 +873,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1138,11 +969,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1241,11 +1067,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1326,6 +1147,8 @@ jobs: platform: - "linux/amd64" test: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -1338,77 +1161,11 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "test" - run: "make BUILD_IN_CONTAINER=false test" + run: "make test" shell: "bash" working-directory: "release" name: "create release PR" diff --git a/.github/workflows/patch-release-pr.yml b/.github/workflows/patch-release-pr.yml index af02152bbb33e..456e39f4272a6 100644 --- a/.github/workflows/patch-release-pr.yml +++ b/.github/workflows/patch-release-pr.yml @@ -8,6 +8,8 @@ env: VERSIONING_STRATEGY: "always-bump-patch" jobs: check: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -20,102 +22,46 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check generated files" - run: "make BUILD_IN_CONTAINER=false check-generated-files" + run: "make check-generated-files" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check mod" - run: "make BUILD_IN_CONTAINER=false check-mod" + run: "make check-mod" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "shellcheck" - run: "make BUILD_IN_CONTAINER=false lint-scripts" + run: "make lint-scripts" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check docs" - run: "make BUILD_IN_CONTAINER=false check-doc" + run: "make check-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "validate example configs" - run: "make BUILD_IN_CONTAINER=false check-example-config-doc" + run: "make check-example-config-doc" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "check helm reference doc" - run: "make BUILD_IN_CONTAINER=false documentation-helm-reference-check" + run: "make documentation-helm-reference-check" shell: "bash" working-directory: "release" create-release-pr: @@ -171,6 +117,8 @@ jobs: shell: "bash" working-directory: "lib" dist: + container: + image: "grafana/loki-build-image:0.33.0" needs: - "test" - "lint" @@ -182,30 +130,15 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "auth gcs" uses: "google-github-actions/auth@v2" with: credentials_json: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}" - - name: "install dependencies" - run: | - go install github.com/mitchellh/gox@9f71238 - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "build artifacts" - run: "make BUILD_IN_CONTAINER=false SKIP_ARM=true dist" + - env: + BUILD_IN_CONTAINER: false + SKIP_ARM: true + name: "build artifacts" + run: "make SKIP_ARM=true dist" shell: "bash" working-directory: "release" - name: "upload build artifacts" @@ -231,11 +164,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -332,11 +260,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -417,6 +340,8 @@ jobs: platform: - "linux/amd64" lint: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -429,82 +354,18 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint" - run: "make BUILD_IN_CONTAINER=false lint" + run: "make lint" shell: "bash" working-directory: "release" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "lint jsonnet" - run: "make BUILD_IN_CONTAINER=false lint-jsonnet" + run: "make lint-jsonnet" shell: "bash" working-directory: "release" logcli: @@ -524,11 +385,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -627,11 +483,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -728,11 +579,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -831,11 +677,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -934,11 +775,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1037,11 +873,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1138,11 +969,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1241,11 +1067,6 @@ jobs: with: path: "release" repository: "${{ env.RELEASE_REPO }}" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - name: "setup node" uses: "actions/setup-node@v4" with: @@ -1326,6 +1147,8 @@ jobs: platform: - "linux/amd64" test: + container: + image: "grafana/loki-build-image:0.33.0" runs-on: "ubuntu-latest" steps: - name: "pull code to release" @@ -1338,77 +1161,11 @@ jobs: with: path: "lib" repository: "grafana/loki-release" - - name: "setup go" - uses: "actions/setup-go@v5" - with: - cache-dependency-path: "release/go.sum" - go-version-file: "release/go.mod" - - name: "setup node" - uses: "actions/setup-node@v4" - with: - node-version: 20 - - name: "install dependencies" - run: | - go install github.com/bufbuild/buf/cmd/buf@v1.4.0 - go install github.com/golang/protobuf/protoc-gen-go@v1.3.1 - go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.3.0 - go install github.com/fatih/faillint@v1.11.0 - go install golang.org/x/tools/cmd/goimports@v0.7.0 - go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 - go install github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 - go install github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0 - go install github.com/google/go-jsonnet/cmd/jsonnet-lint@v0.18.0 - - sudo apt update - sudo apt install -qy musl gnupg ragel \ - file zip unzip jq gettext \ - protobuf-compiler libprotobuf-dev \ - libsystemd-dev jq - shell: "bash" - - name: "install golangci-lint" - uses: "./lib/actions/install-binary" - with: - binary: "golangci-lint" - download_url: "https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "1.55.1" - - name: "install shellcheck" - uses: "./lib/actions/install-binary" - with: - binary: "shellcheck" - download_url: "https://github.com/koalaman/shellcheck/releases/download/v${version}/shellcheck-v${version}.linux.x86_64.tar.xz" - smoke_test: "${binary} --version" - tar_args: "xvf" - tarball_binary_path: "*/${binary}" - version: "0.9.0" - - name: "install helm" - uses: "./lib/actions/install-binary" - with: - binary: "helm" - download_url: "https://get.helm.sh/helm-v${version}-linux-amd64.tar.gz" - smoke_test: "${binary} version" - tarball_binary_path: "*/${binary}" - version: "3.2.3" - - name: "install helm-docs" - uses: "./lib/actions/install-binary" - with: - binary: "helm-docs" - download_url: "https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "1.11.2" - - name: "install jsonnetfmt" - uses: "./lib/actions/install-binary" - with: - binary: "jsonnetfmt" - download_url: "https://github.com/google/go-jsonnet/releases/download/v${version}/go-jsonnet_${version}_Linux_x86_64.tar.gz" - smoke_test: "${binary} --version" - tarball_binary_path: "${binary}" - version: "0.18.0" - - if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" + - env: + BUILD_IN_CONTAINER: false + if: "${{ !fromJSON(env.SKIP_VALIDATION) }}" name: "test" - run: "make BUILD_IN_CONTAINER=false test" + run: "make test" shell: "bash" working-directory: "release" name: "create release PR" @@ -1416,7 +1173,6 @@ name: "create release PR" push: branches: - "release-[0-9].[0-9].x" - - "fix-action-names-in-main" permissions: contents: "write" pull-requests: "write"