@@ -107,8 +107,8 @@ frontend/build:
107107
108108.PHONY : frontend/shell
109109frontend/shell :
110- docker build -f cmd/pyroscope/frontend.Dockerfile --iidfile .docker-image-id -frontend --target builder .
111- docker run -t -i $$(cat .docker-image-id -frontend ) /bin/bash
110+ docker build -f cmd/pyroscope/frontend.Dockerfile --iidfile .docker-image-digest -frontend --target builder .
111+ docker run -t -i $$(cat .docker-image-digest -frontend ) /bin/bash
112112
113113.PHONY : profilecli/build
114114profilecli/build : go/bin-profilecli # # Build the profilecli binary
@@ -224,7 +224,7 @@ define deploy
224224 $(BIN ) /helm upgrade --install $(1 ) ./operations/pyroscope/helm/pyroscope $(2 ) $(HELM_ARGS ) \
225225 --set pyroscope.image.tag=$(IMAGE_TAG ) \
226226 --set pyroscope.image.repository=$(IMAGE_PREFIX ) pyroscope \
227- --set pyroscope.podAnnotations.image-id =$(shell cat .docker-image-id -pyroscope) \
227+ --set pyroscope.podAnnotations.image-digest =$(shell cat .docker-image-digest -pyroscope) \
228228 --set pyroscope.service.port_name=http-metrics \
229229 --set pyroscope.podAnnotations."profiles\.grafana\.com\/memory\.port_name"=http-metrics \
230230 --set pyroscope.podAnnotations."profiles\.grafana\.com\/cpu\.port_name"=http-metrics \
@@ -249,6 +249,8 @@ define multiarch_build
249249 GOOS=linux GOARCH=amd64 IMAGE_TAG="$(IMAGE_TAG ) -amd64" $(MAKE ) $(build_cmd ) IMAGE_PLATFORM=linux/amd64
250250
251251 $(if $(push_image ) , docker buildx imagetools create --tag "$(image_name ) " "$(image_name ) -amd64" "$(image_name ) -arm64")
252+ $(if $(push_image ) , docker buildx imagetools inspect "$(image_name ) " --format "{{json .Manifest.Digest}}" | tr -d '"' > .docker-image-digest-pyroscope)
253+ $(if $(push_image ) , echo "$(image_name ) " > .docker-image-name-pyroscope)
252254endef
253255
254256.PHONY : docker-image/pyroscope/build-multiarch
@@ -277,7 +279,7 @@ docker-image/pyroscope/push-debug: frontend/build go/bin-debug docker-image/pyro
277279
278280.PHONY : docker-image/pyroscope/build
279281docker-image/pyroscope/build : frontend/build go/bin
280- $(call docker_buildx,--load --iidfile .docker-image-id -pyroscope,)
282+ $(call docker_buildx,--load --iidfile .docker-image-digest -pyroscope,)
281283
282284.PHONY : docker-image/pyroscope/push
283285docker-image/pyroscope/push : frontend/build go/bin
@@ -291,46 +293,6 @@ docker-image/pyroscope/dlv:
291293 GOPATH=
$(CURDIR ) /.tmp GOAMD64=v2 CGO_ENABLED=0
$(GO ) install -ldflags
" -s -w -extldflags '-static'" github.com/go-delve/delve/cmd/
[email protected] 292294 mv $(CURDIR ) /.tmp/bin/$(GOOS ) _$(GOARCH ) /dlv $(CURDIR ) /.tmp/bin/dlv
293295
294- define UPDATER_CONFIG_JSON
295- {
296- "git_author_name": "grafana-pyroscope-bot[bot]",
297- "git_author_email": "140177480+grafana-pyroscope-bot[bot]@users.noreply.github.com",
298- "git_committer_name": "grafana-pyroscope-bot[bot]",
299- "git_committer_email": "140177480+grafana-pyroscope-bot[bot]@users.noreply.github.com",
300- "pull_request_enabled": true,
301- "pull_request_branch_prefix": "auto-merge/grafana-pyroscope-bot",
302- "repo_name": "deployment_tools",
303- "destination_branch": "master",
304- "update_jsonnet_attribute_configs": [
305- {
306- "file_path": "ksonnet/lib/pyroscope/releases/dev/images.libsonnet",
307- "jsonnet_key": "pyroscope",
308- "jsonnet_value": "$(IMAGE_PREFIX ) pyroscope:$(IMAGE_TAG ) "
309- }
310- ],
311- "update_jsonnet_lib_configs": [
312- {
313- "jsonnet_dir": "ksonnet/lib/pyroscope/releases/dev",
314- "dependencies": [
315- {
316- "owner": "grafana",
317- "name": "pyroscope",
318- "version": "$(GIT_REVISION ) ",
319- "sub_dirs": [
320- "operations/pyroscope"
321- ]
322- }
323- ]
324- }
325- ]
326- }
327- endef
328-
329- .PHONY : docker-image/pyroscope/deploy-dev-001
330- docker-image/pyroscope/deploy-dev-001 : export CONFIG_JSON:=$(call UPDATER_CONFIG_JSON)
331- docker-image/pyroscope/deploy-dev-001 : $(BIN ) /updater $(BIN ) /jb
332- PATH=$(BIN ) :$(PATH ) $(BIN ) /updater
333-
334296.PHONY : clean
335297clean : # # Delete intermediate build artifacts
336298 @# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs
@@ -406,10 +368,6 @@ $(BIN)/mockery: Makefile go.mod
406368 @mkdir -p $(@D )
407369 GOBIN=
$(abspath $(@D ) ) $(GO ) install github.com/vektra/mockery/
[email protected] 408370
409- $(BIN ) /updater : Makefile
410- @mkdir -p $(@D )
411- GOBIN=$(abspath $(@D ) ) GOPRIVATE=github.com/grafana/deployment_tools $(GO ) install github.com/grafana/deployment_tools/docker/updater/cmd/updater@bd5794b4e488
412-
413371# Note: When updating the goreleaser version also update .github/workflow/release.yml and .git/workflow/weekly-release.yaml
414372$(BIN ) /goreleaser : Makefile go.mod
415373 @mkdir -p $(@D )
0 commit comments