From c08c9bcb2007eba6823f7cd5df2b2c4f753f49a4 Mon Sep 17 00:00:00 2001 From: endline Date: Thu, 21 Nov 2024 13:01:12 -0700 Subject: [PATCH 1/2] Disable buildkit in CI so docker layer caching actually works See https://github.com/docker/compose/issues/11804 --- .circleci/src/jobs/push-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/src/jobs/push-docker-image.yml b/.circleci/src/jobs/push-docker-image.yml index 70e20ebb628..f42fa11472c 100644 --- a/.circleci/src/jobs/push-docker-image.yml +++ b/.circleci/src/jobs/push-docker-image.yml @@ -13,7 +13,7 @@ steps: path: '~/audius-protocol' - run: AUDIUS_DEV=false bash ~/audius-protocol/dev-tools/setup.sh - docker-login - - run: . ~/.profile; audius-compose push --prod "<< parameters.service >>" + - run: . ~/.profile; DOCKER_BUILDKIT=0 audius-compose push --prod "<< parameters.service >>" - docker-logout - docker-prune - run: From a113e4e2d071eda044f0418b321020808ceb77ce Mon Sep 17 00:00:00 2001 From: endline Date: Thu, 21 Nov 2024 13:41:53 -0700 Subject: [PATCH 2/2] Set BUILDKIT=0 in def build --- .circleci/src/jobs/push-docker-image.yml | 2 +- dev-tools/audius-compose | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/src/jobs/push-docker-image.yml b/.circleci/src/jobs/push-docker-image.yml index f42fa11472c..70e20ebb628 100644 --- a/.circleci/src/jobs/push-docker-image.yml +++ b/.circleci/src/jobs/push-docker-image.yml @@ -13,7 +13,7 @@ steps: path: '~/audius-protocol' - run: AUDIUS_DEV=false bash ~/audius-protocol/dev-tools/setup.sh - docker-login - - run: . ~/.profile; DOCKER_BUILDKIT=0 audius-compose push --prod "<< parameters.service >>" + - run: . ~/.profile; audius-compose push --prod "<< parameters.service >>" - docker-logout - docker-prune - run: diff --git a/dev-tools/audius-compose b/dev-tools/audius-compose index dc9e9d30130..bd6387c8b83 100755 --- a/dev-tools/audius-compose +++ b/dev-tools/audius-compose @@ -215,6 +215,12 @@ def build( protocol_dir, discovery_provider_replicas, elasticsearch_replicas, prod ) + # Include DOCKER_BUILDKIT=0 in the environment + # see bug with buildkit failing to cache docker layers + # https://github.com/docker/compose/issues/11804 + env = os.environ.copy() + env["DOCKER_BUILDKIT"] = "0" + proc = subprocess.run( [ "docker", @@ -243,6 +249,7 @@ def build( *args, *services, ], + env=env, ) if proc.returncode != 0: