-
Notifications
You must be signed in to change notification settings - Fork 203
chore: add dependabot for auto update base image. #1716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Makefile
Outdated
OSNAME = $(shell uname -o) | ||
ARCHNAME = $(shell uname -m) | ||
GO_VERSION = $(shell awk '/^go /{print $$2}' go.mod|head -n1) | ||
BUILDER_IMAGE = golang:$(GO_VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid the builder image being updated automatically, obtain the go version from go.mod
e4cdadc
to
373c79b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1716 +/- ##
==========================================
- Coverage 84.73% 84.69% -0.04%
==========================================
Files 127 127
Lines 5718 5718
==========================================
- Hits 4845 4843 -2
- Misses 620 622 +2
Partials 253 253 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
with: | ||
go-version-file: go.mod | ||
- name: Build image | ||
run: make image-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A CI build container image has been added, which will increase the CI time, but I think it can enhance the confidence in building the container image.
.PHONY: image-push | ||
image-push: PUSH=--push | ||
image-push: image-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future work, we can use this to replace this step in the workflow.
oras/.github/workflows/release-ghcr.yml
Line 44 in e8bca4d
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/s390x,linux/ppc64le -t ${{ steps.prepare.outputs.ref }} --push . |
PLATFORMS ?= linux/amd64,linux/arm64 | ||
DOCKER_BUILDX_CMD ?= docker buildx | ||
IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build | ||
IMAGE_GIT_TAG ?= $(shell git describe --tags --dirty --always) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no too much history, in here
Line 18 in e8bca4d
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null) |
IMAGE_REGISTRY ?= ghcr.io/oras-project | ||
IMAGE_NAME := oras | ||
IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(IMAGE_NAME) | ||
IMAGE_TAG ?= $(IMAGE_REPO):$(IMAGE_GIT_TAG) | ||
|
||
ifdef EXTRA_TAG | ||
IMAGE_EXTRA_TAG ?= $(IMAGE_REPO):$(EXTRA_TAG) | ||
endif | ||
ifdef IMAGE_EXTRA_TAG | ||
IMAGE_BUILD_EXTRA_OPTS += -t $(IMAGE_EXTRA_TAG) | ||
endif | ||
|
||
# Build the multiplatform container image locally and push to repo. | ||
.PHONY: image-local-push | ||
image-local-push: PUSH=--push | ||
image-local-push: image-local-build | ||
|
||
# Build the multiplatform container image locally. | ||
.PHONY: image-local-build | ||
image-local-build: | ||
BUILDER=$(shell $(DOCKER_BUILDX_CMD) create --use) | ||
$(MAKE) image-build PUSH=$(PUSH) | ||
$(DOCKER_BUILDX_CMD) rm $$BUILDER | ||
|
||
.PHONY: image-push | ||
image-push: PUSH=--push | ||
image-push: image-build | ||
|
||
image-build: | ||
$(IMAGE_BUILD_CMD) -t $(IMAGE_TAG) \ | ||
--platform=$(PLATFORMS) \ | ||
--build-arg BASE_IMAGE=$(BASE_IMAGE) \ | ||
--build-arg BUILDER_IMAGE=$(BUILDER_IMAGE) \ | ||
--build-arg CGO_ENABLED=$(CGO_ENABLED) \ | ||
$(PUSH) \ | ||
$(IMAGE_BUILD_EXTRA_OPTS) ./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, it's copied from https://github.com/kubernetes-sigs/kueue/blob/main/Makefile
* add dependabot for auto update base image Signed-off-by: Lan <[email protected]>
47638fb
to
d038c4e
Compare
Thanks @liangyuanpeng for contributing. Can you help look into the CI failure? |
If this is just for CI purposes, wouldn't it be better to skip the FWIW, Go projects often adopt GoReleaser to automate builds, some also use the Docker build support from GoReleaser, but I'd say the GH workflow is simpler to maintain. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Co-authored-by: Billy Zha <[email protected]> Signed-off-by: Terry Howe <[email protected]>
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1710
Please check the following list: