From 4775f2f719b9d86d2e662c795f6c613e95e5ac60 Mon Sep 17 00:00:00 2001 From: Stefan Van Dyck Date: Tue, 17 Dec 2024 14:18:29 +0100 Subject: [PATCH] Try fixing remote docker build cache --- .github/workflows/release.yml | 4 ---- docker/docker-bake.hcl | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e551ff8..7a923f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -239,13 +239,9 @@ jobs: --set="${docker_name}.labels.git_tag=${GIT_TAG}" \ --set="${docker_name}.labels.git_hash=${{ github.sha }}" \ --set="custom-gradle.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:${CACHE_TAG},image-manifest=true,mode=max" \ - --set="custom-gradle.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:${CACHE_TAG},image-manifest=true" \ --set="custom-maven.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:${CACHE_TAG},image-manifest=true,mode=max" \ - --set="custom-maven.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:${CACHE_TAG},image-manifest=true" \ --set="tomcat-base.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:${CACHE_TAG},image-manifest=true,mode=max" \ - --set="tomcat-base.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:${CACHE_TAG},image-manifest=true" \ --set="${docker_name}.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/${docker_name}:${CACHE_TAG},image-manifest=true,mode=max" \ - --set="${docker_name}.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/${docker_name}:${CACHE_TAG},image-manifest=true" # Create Git Tag echo "Creating Git Tag: ${GIT_TAG}" diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index cebe8b0..a739abb 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -4,17 +4,20 @@ variable "TAG" { target "custom-gradle" { context = "./gradle" + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:cache-github"] tags = ["custom-gradle:${TAG}"] } target "custom-maven" { context = "./maven" + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:cache-github"] tags = ["custom-maven:${TAG}"] } target "tomcat-base" { context = "./tomcat" + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:cache-github"] tags = ["tomcat:${TAG}"] target = "base" } @@ -49,6 +52,7 @@ target "alerts" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/alerts:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/alerts:${TAG}"] } @@ -58,6 +62,7 @@ target "apikey" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/apikey:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/apikey:${TAG}"] } @@ -67,6 +72,7 @@ target "bie-hub" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-hub:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-hub:${TAG}"] } @@ -76,6 +82,7 @@ target "bie-index" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-index:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-index:${TAG}"] } @@ -85,6 +92,7 @@ target "biocache-hub" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-hub:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-hub:${TAG}"] } @@ -94,6 +102,7 @@ target "biocache-service" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-service:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-service:${TAG}"] } @@ -103,6 +112,7 @@ target "collectory" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/collectory:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/collectory:${TAG}"] } @@ -112,6 +122,7 @@ target "doi-service" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/doi-service:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/doi-service:${TAG}"] } @@ -121,6 +132,7 @@ target "image-service" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/image-service:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/image-service:${TAG}"] } @@ -130,6 +142,7 @@ target "logger" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/logger:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/logger:${TAG}"] } @@ -138,6 +151,7 @@ target "namematching-service" { contexts = { "custom-maven" = "target:custom-maven" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/namematching-service:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/namematching-service:${TAG}"] } @@ -146,6 +160,7 @@ target "pipelines" { contexts = { "custom-maven" = "target:custom-maven" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/la-pipelines:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/la-pipelines:${TAG}"] } @@ -155,6 +170,7 @@ target "regions" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/regions:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/regions:${TAG}"] } @@ -172,6 +188,7 @@ target "spatial-hub" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-hub:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-hub:${TAG}"] } @@ -181,6 +198,7 @@ target "spatial-service" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-service:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-service:${TAG}"] } @@ -190,6 +208,7 @@ target "species-list" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/species-list:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/species-list:${TAG}"] } @@ -199,6 +218,7 @@ target "userdetails" { "custom-gradle" = "target:custom-gradle" "tomcat-base" = "target:tomcat-base" } + cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/userdetails:cache-github"] tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/userdetails:${TAG}"] }