Skip to content

Commit

Permalink
ci: 🎡 setup cache in docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Jan 27, 2023
1 parent 1f662d3 commit c73cc06
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/_e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and push
uses: docker/bake-action@v2
with:
load: true
files: |
docker-compose-datasets-server.yml
set: |
*.cache-from=type=gha
*.cache-to=type=gha
workdir: ./tools
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# -
# name: Build and push
# uses: docker/bake-action@v2
# with:
# load: true
# files: |
# docker-compose-datasets-server.yml
# set: |
# *.cache-from=type=gha
# *.cache-to=type=gha
# workdir: ./tools
-
name: Launch the services (the images should have been build in the previous step)
env:
Expand Down
40 changes: 40 additions & 0 deletions tools/docker-compose-datasets-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ services:
build:
context: ..
dockerfile: services/admin/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_SERVICE_ADMIN?IMAGE_SERVICE_ADMIN env var must be provided}
extends:
file: docker-compose-base.yml
Expand Down Expand Up @@ -49,6 +53,10 @@ services:
build:
context: ..
dockerfile: services/api/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_SERVICE_API?IMAGE_SERVICE_API env var must be provided}
extends:
file: docker-compose-base.yml
Expand All @@ -74,6 +82,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
volumes:
- splits-datasets-cache:${HF_DATASETS_CACHE-/datasets-cache}:rw
Expand All @@ -91,6 +103,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
volumes:
- splits-datasets-cache:${HF_DATASETS_CACHE-/datasets-cache}:rw
Expand All @@ -108,6 +124,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
volumes:
- splits-datasets-cache:${HF_DATASETS_CACHE-/datasets-cache}:rw
Expand All @@ -125,6 +145,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
volumes:
- assets:${ASSETS_STORAGE_DIRECTORY-/assets}:rw
Expand Down Expand Up @@ -152,6 +176,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
volumes:
- parquet-datasets-cache:${HF_DATASETS_CACHE-/datasets-cache}:rw
Expand All @@ -177,6 +205,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
extends:
file: docker-compose-base.yml
Expand All @@ -190,6 +222,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
extends:
file: docker-compose-base.yml
Expand All @@ -203,6 +239,10 @@ services:
build:
context: ..
dockerfile: workers/datasets_based/Dockerfile
cache-from:
- type=gha
cache-to:
- type=gha
# image: ${IMAGE_WORKER_DATASETS_BASED?IMAGE_WORKER_DATASETS_BASED env var must be provided}
extends:
file: docker-compose-base.yml
Expand Down

0 comments on commit c73cc06

Please sign in to comment.