imbajin commented on code in PR #3171: URL: https://github.com/apache/hugegraph/pull/3171#discussion_r3887384164
########## docker-bake.hcl: ########## @@ -0,0 +1,116 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +variable "MAVEN_ARGS" { + default = "" +} + +variable "SOURCE_REVISION" { + default = "local" +} + +variable "IMAGE_TAG" { + default = "local" +} + +variable "CACHE_CHANNEL" { + default = "latest" +} + +variable "EXPORT_CACHE" { + default = false +} + +target "_common" { + context = "." + args = { + MAVEN_ARGS = MAVEN_ARGS + SOURCE_REVISION = SOURCE_REVISION + } + platforms = [ + "linux/amd64", + "linux/arm64", + ] +} + +target "build-cache" { + inherits = ["_common"] + dockerfile = "hugegraph-pd/Dockerfile" + target = "build" + output = ["type=cacheonly"] + cache-from = [ + "type=registry,ref=hugegraph/hugegraph:shared-${CACHE_CHANNEL}", + "type=registry,ref=hugegraph/pd:buildcache-${CACHE_CHANNEL}", + ] + cache-to = EXPORT_CACHE ? [ + "type=registry,ref=hugegraph/hugegraph:shared-${CACHE_CHANNEL},mode=max", + ] : [] +} + +target "pd" { + inherits = ["_common"] + dockerfile = "hugegraph-pd/Dockerfile" + tags = ["hugegraph/pd:${IMAGE_TAG}"] + output = ["type=docker"] Review Comment: Verified on the final heads with Docker\u0027s containerd image store. `type=docker` loaded both linux/amd64 and linux/arm64 variants for each final tag, the workflow tested those exact local tags, and only then pushed them. Run/job: https://github.com/hugegraph/actions/actions/runs/33268703532/job/99143223821. Post-push inspection confirms both platforms in all four indexes. ########## .github/workflows/docker-build-ci.yml: ########## @@ -25,11 +25,71 @@ on: pull_request: paths: - '**/Dockerfile*' + - 'docker-bake.hcl' - '.dockerignore' - 'hugegraph-server/hugegraph-dist/docker/**' - 'hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh' jobs: + docker-bake-check: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Verify shared Maven stages stay identical + shell: bash + run: | + set -euo pipefail + + extract_build_stage() { + awk ' + /^FROM .* AS build$/ { + in_build = 1 + } + in_build && seen && /^FROM / { + exit + } + in_build { + print + seen = 1 + } + ' "$1" + } + + reference="hugegraph-pd/Dockerfile" Review Comment: Fixed in 9fd092a: the CI now fails when the reference build-stage extraction is empty. The mutation check also confirms that changing all headers to `as build` no longer passes vacuously. The final-head `docker-bake-check` passed: https://github.com/apache/hugegraph/actions/runs/33267786454/job/99140828935 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
