Skip to content

Commit 53629eb

Browse files
authored
Use ghcr.io for build images (#1482)
Summary: This switches to using ghcr.io for our build images. We will continue to maintain a copy on gcr.io for now and also sync historic images to ghcr.io. Type of change: /kind cleanup Test Plan: All github actions on this PR should work. --------- Signed-off-by: Vihang Mehta <vihang@pixielabs.ai>
1 parent 2babdb0 commit 53629eb

File tree

6 files changed

+61
-7
lines changed

6 files changed

+61
-7
lines changed

.github/workflows/get_image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
ref: ${{ inputs.ref }}
2828
- id: get-version
2929
run: >-
30-
IMAGE_NAME="gcr.io/pixie-oss/pixie-dev-public/${{ inputs.image-base-name }}";
30+
IMAGE_NAME="ghcr.io/pixie-io/${{ inputs.image-base-name }}";
3131
IMAGE_TAG="$(grep DOCKER_IMAGE_TAG docker.properties | cut -d'=' -f2)";
3232
echo "image=${IMAGE_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT

docker.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DOCKER_IMAGE_TAG=202306071557
2-
LINTER_IMAGE_DIGEST=66c784bb0b1bc7ead721d8d45e3bd4a85a771ead79f3056de4c74c886cdeecef
3-
DEV_IMAGE_DIGEST=cc755b0afa75f3e1601c9e51ebe0dea81fdd611bebbdc8469bf0da69f9deefa1
4-
DEV_IMAGE_WITH_EXTRAS_DIGEST=b5b855b17072d76446b7a3bcf733339b44343baa82d5253b4a3fd60ba6c4e7d8
1+
DOCKER_IMAGE_TAG=202306140051
2+
LINTER_IMAGE_DIGEST=45fec24993780e6c2226642b098fc62e775733bd51ca738df33d1594add419a2
3+
DEV_IMAGE_DIGEST=5850a28fe3352b9b0753be2570fdd48e4e735af7b0949af9ce99736cf5f3bd53
4+
DEV_IMAGE_WITH_EXTRAS_DIGEST=79ff03b395485efdb1b3c231930dca41ee4dcc68c2be64588a0035538494815f

scripts/run_docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bold="\e[1m"
2929
resetcolor="\e[0m"
3030

3131
# Docker image information.
32-
docker_image_base=gcr.io/pixie-oss/pixie-dev-public/dev_image_with_extras
32+
docker_image_base=ghcr.io/pixie-io/dev_image_with_extras
3333
os="$(uname)"
3434
version=$(grep DOCKER_IMAGE_TAG "${workspace_root}/docker.properties" | cut -d= -f2)
3535
digest=$(grep DEV_IMAGE_WITH_EXTRAS_DIGEST "${workspace_root}/docker.properties" | cut -d= -f2)

tools/chef/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DOCKER_PROPERTIES_FILE := $(TOT)/docker.properties
2020
# Commands.
2121
DOCKER := docker
2222
PACKER := packer
23+
REGSYNC := regsync
2324

2425
BASE_IMAGE_VERSION := $(shell date "+%Y%m%d%H%M")
2526
BASE_IMAGE_VERSION_FILE := base_image_version.txt
@@ -48,6 +49,7 @@ build_and_push_base_image:
4849
-var "generated_image_tag=$(BASE_IMAGE_VERSION)" \
4950
packer_docker_base.json
5051
echo $(BASE_IMAGE_VERSION) > $(BASE_IMAGE_VERSION_FILE)
52+
$(MAKE) sync_images
5153

5254
.PHONY: build_and_push_dev_images
5355
build_and_push_dev_images:
@@ -70,7 +72,11 @@ build_and_push_dev_images:
7072
packer_docker_dev_extras.json
7173

7274
echo "DOCKER_IMAGE_TAG=$(DEV_IMAGE_VERSION)" > $(DOCKER_PROPERTIES_FILE)
73-
7475
echo "LINTER_IMAGE_DIGEST=$(LINTER_IMAGE_DIGEST)" >> $(DOCKER_PROPERTIES_FILE)
7576
echo "DEV_IMAGE_DIGEST=$(DEV_IMAGE_DIGEST)" >> $(DOCKER_PROPERTIES_FILE)
7677
echo "DEV_IMAGE_WITH_EXTRAS_DIGEST=$(DEV_IMAGE_WITH_EXTRAS_DIGEST)" >> $(DOCKER_PROPERTIES_FILE)
78+
$(MAKE) sync_images
79+
80+
.PHONY: sync_images
81+
sync_images:
82+
$(REGSYNC) once --config image_sync.yaml

tools/chef/cookbooks/px_dev/recipes/golang.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
go install github.com/go-bindata/go-bindata/go-bindata@v3.1.2+incompatible && \
4949
go install github.com/google/go-containerregistry/cmd/crane@v0.15.2 && \
5050
go install github.com/sigstore/cosign/v2/cmd/cosign@v2.0.2 && \
51+
go install github.com/regclient/regclient/cmd/regctl@v0.4.8 && \
52+
go install github.com/regclient/regclient/cmd/regsync@v0.4.8 && \
5153
go clean -modcache && \
5254
go clean -cache)
5355
end

tools/chef/image_sync.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
version: 1
3+
creds:
4+
- registry: gcr.io
5+
- registry: ghcr.io
6+
# These env vars may be left unset if the user running
7+
# the sync has credentials for ghcr.io already in their
8+
# active docker config.
9+
user: "{{env \"GHCR_USER\"}}"
10+
pass: "{{env \"GHCR_PASS\"}}"
11+
defaults:
12+
ratelimit:
13+
retry: 15m
14+
parallel: 8
15+
sync:
16+
# The deny tags aren't strictly necessary since these are
17+
# supposed to be complete mirrors, but they just speed up
18+
# the sync by ignoring older images that are already copied.
19+
- source: gcr.io/pixie-oss/pixie-dev-public/base_image
20+
target: ghcr.io/pixie-io/base_image
21+
type: repository
22+
tags:
23+
deny:
24+
- "202[0-2].*"
25+
- "20230[1-5].*"
26+
- source: gcr.io/pixie-oss/pixie-dev-public/dev_image
27+
target: ghcr.io/pixie-io/dev_image
28+
type: repository
29+
tags:
30+
deny:
31+
- "202[0-2].*"
32+
- "20230[1-5].*"
33+
- source: gcr.io/pixie-oss/pixie-dev-public/dev_image_with_extras
34+
target: ghcr.io/pixie-io/dev_image_with_extras
35+
type: repository
36+
tags:
37+
deny:
38+
- "202[0-2].*"
39+
- "20230[1-5].*"
40+
- source: gcr.io/pixie-oss/pixie-dev-public/linter_image
41+
target: ghcr.io/pixie-io/linter_image
42+
type: repository
43+
tags:
44+
deny:
45+
- "202[0-2].*"
46+
- "20230[1-5].*"

0 commit comments

Comments
 (0)