From 26e40f01d2c926b963cbc9fcd2aae249e54cfb93 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Tue, 27 Oct 2020 14:37:13 -0400 Subject: [PATCH 1/4] Switch digitial ocean to github docker registry --- .github/workflows/workflow.yml | 4 ++-- k8/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 59a097f..be1db0f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -74,8 +74,8 @@ jobs: with: token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - - name: Login DigitalOcean container registry - run: doctl registry login + - name: Login to Github Container Registry + run: docker login ghcr.io -u saulshanabrook -p "${{ secrets.CR_PAT }}" - name: Save DigitalOcean kubeconfig run: doctl kubernetes cluster kubeconfig save python-record-api diff --git a/k8/Makefile b/k8/Makefile index 0782009..d3cc5f8 100644 --- a/k8/Makefile +++ b/k8/Makefile @@ -4,7 +4,7 @@ PYTHON_PACKAGE_VERSION := $(shell python -c 'import record_api; print(record_api $(info Python package version = ${PYTHON_PACKAGE_VERSION}) -IMAGE := registry.digitalocean.com/python-record-api +IMAGE := ghcr.io/data-apis # The tag for base image is base-{python version}-{version-increment} # The tag for other versions are {name}-{python version}-{base version increment}-{version increment} From dafb8d1994496ea5ebcb96ba9a6b76a9799d1ab6 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Tue, 27 Oct 2020 14:46:47 -0400 Subject: [PATCH 2/4] Add source repo label to images https://github.community/t/container-registry-package-description/130640/5?u=saulshanabrook --- k8/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/k8/Makefile b/k8/Makefile index d3cc5f8..34e6917 100644 --- a/k8/Makefile +++ b/k8/Makefile @@ -144,6 +144,9 @@ define JQ_DOCKER_BAKE { "base-base": { dockerfile: "Dockerfile", + labels: { + "org.opencontainers.image.source": "https://github.com/data-apis/python-record-api" + } }, base: { context: "images/base", From ea9437d1ef77376aa0c7b787aa3fef022128dd8c Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Tue, 27 Oct 2020 15:06:06 -0400 Subject: [PATCH 3/4] Try removing cache images --- k8/Makefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/k8/Makefile b/k8/Makefile index 34e6917..e806971 100644 --- a/k8/Makefile +++ b/k8/Makefile @@ -15,13 +15,10 @@ version = $(shell cat images/$(1)/version) BASE_IMAGE := ${IMAGE}/base:${PYTHON_PACKAGE_VERSION}-$(call version,base) -BASE_CACHE_IMAGE := ${IMAGE}/base:cache - $(info Base image = ${BASE_IMAGE}) sub_tag = $(1):${PYTHON_PACKAGE_VERSION}-$(call version,base)-$(call version,$(1)) sub_image = ${IMAGE}/$(call sub_tag,$(1)) -sub_cache_image = ${IMAGE}/$(1):cache WORKFLOW_VERSION := $(shell cat argo/version) $(info Workflow version = ${WORKFLOW_VERSION}) @@ -151,8 +148,6 @@ define JQ_DOCKER_BAKE base: { context: "images/base", inherits: ["base-base"], - "cache-to": ["type=registry,ref=${BASE_CACHE_IMAGE},mode=max"], - "cache-from": ["type=registry,ref=${BASE_CACHE_IMAGE}"], args: { PYTHON_PACKAGE_VERSION: "${PYTHON_PACKAGE_VERSION}" }, @@ -171,8 +166,6 @@ define JQ_DOCKER_BAKE args: { FROM: "${BASE_IMAGE}" }, - "cache-to": ["type=registry,ref=" + ($$ARGS.named[(. + "-cache")]) + ",mode=max"], - "cache-from": ["type=registry,ref=" + ($$ARGS.named[(. + "-cache")])], tags: [ ($$ARGS.named[(.)]) ] @@ -191,7 +184,6 @@ docker-bake.json: Makefile images/ jq "$$JQ_DOCKER_BAKE" \ --null-input \ $(foreach name,$(IMAGES),--arg $(name) $(call sub_image,$(name))) \ - $(foreach name,$(IMAGES),--arg $(name)-cache $(call sub_cache_image,$(name))) \ --args $(IMAGES) \ > $@ From 74569828c502578eebebfbd291c95a0c4d40e468 Mon Sep 17 00:00:00 2001 From: Saul Shanabrook Date: Tue, 27 Oct 2020 16:17:04 -0400 Subject: [PATCH 4/4] test commit