Skip to content

Commit

Permalink
ci: 🎡 test only build and cache
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Jan 27, 2023
1 parent c57b877 commit ac4168c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 64 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/_e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# -
# name: Build and push
# uses: docker/bake-action@v2
Expand All @@ -35,24 +35,35 @@ jobs:
# *.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:
WORKER_SLEEP_TIME: "1"
# hard coded, see e2e/tests/fixtures/hub.py
COMMON_HF_ENDPOINT: "https://hub-ci.huggingface.co"
COMMON_HF_TOKEN: "hf_app_datasets-server_token"
PARQUET_AND_DATASET_INFO_COMMITTER_HF_TOKEN: "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"
FIRST_ROWS_MAX_NUMBER: "4"
PORT_REVERSE_PROXY: "8000"
PROMETHEUS_MULTIPROC_DIR: "/tmp"
API_UVICORN_NUM_WORKERS: "2"
API_UVICORN_PORT: "8080"
ADMIN_UVICORN_NUM_WORKERS: "2"
ADMIN_UVICORN_PORT: "8081"
COMMON_LOG_LEVEL: "DEBUG"
run: docker compose -f docker-compose-datasets-server.yml up -d
working-directory: ./tools
-
name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./services/admin/Dockerfile
push: false
load: true
# see https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#registry-cache
cache-from: type=gha
cache-to: type=gha,mode=max
# -
# name: Launch the services (the images should have been build in the previous step)
# env:
# WORKER_SLEEP_TIME: "1"
# # hard coded, see e2e/tests/fixtures/hub.py
# COMMON_HF_ENDPOINT: "https://hub-ci.huggingface.co"
# COMMON_HF_TOKEN: "hf_app_datasets-server_token"
# PARQUET_AND_DATASET_INFO_COMMITTER_HF_TOKEN: "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"
# FIRST_ROWS_MAX_NUMBER: "4"
# PORT_REVERSE_PROXY: "8000"
# PROMETHEUS_MULTIPROC_DIR: "/tmp"
# API_UVICORN_NUM_WORKERS: "2"
# API_UVICORN_PORT: "8080"
# ADMIN_UVICORN_NUM_WORKERS: "2"
# ADMIN_UVICORN_PORT: "8081"
# COMMON_LOG_LEVEL: "DEBUG"
# run: docker compose -f docker-compose-datasets-server.yml up -d
# working-directory: ./tools
# -
# name: Install poetry
# run: pipx install poetry==${{ env.poetry-version }}
Expand Down
86 changes: 43 additions & 43 deletions tools/docker-compose-datasets-server.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
version: "3.9"
services:
reverse-proxy:
image: docker.io/nginx:1.20
# image: ${IMAGE_REVERSE_PROXY?IMAGE_REVERSE_PROXY env var must be provided}
volumes:
- ../chart/nginx-templates/:/etc/nginx/templates:ro
- assets:${ASSETS_STORAGE_DIRECTORY-/assets}:ro
- ../chart/static-files/openapi.json:/static-files/openapi.json:ro
ports:
- "${PORT_REVERSE_PROXY-8000}:80"
environment:
ASSETS_DIRECTORY: ${ASSETS_STORAGE_DIRECTORY-/assets}
HOST: localhost
PORT: 80
URL_ADMIN: http://admin:${ADMIN_UVICORN_PORT-8081}
URL_API: http://api:${API_UVICORN_PORT-8080}
depends_on:
# - api
- admin
# reverse-proxy:
# image: docker.io/nginx:1.20
# # image: ${IMAGE_REVERSE_PROXY?IMAGE_REVERSE_PROXY env var must be provided}
# volumes:
# - ../chart/nginx-templates/:/etc/nginx/templates:ro
# - assets:${ASSETS_STORAGE_DIRECTORY-/assets}:ro
# - ../chart/static-files/openapi.json:/static-files/openapi.json:ro
# ports:
# - "${PORT_REVERSE_PROXY-8000}:80"
# environment:
# ASSETS_DIRECTORY: ${ASSETS_STORAGE_DIRECTORY-/assets}
# HOST: localhost
# PORT: 80
# URL_ADMIN: http://admin:${ADMIN_UVICORN_PORT-8081}
# URL_API: http://api:${API_UVICORN_PORT-8080}
# depends_on:
# - api
# - admin
admin:
build:
context: ..
dockerfile: services/admin/Dockerfile
cache_from:
- type=gha
cache_to:
- type=gha
# 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 All @@ -43,8 +43,8 @@ services:
ADMIN_UVICORN_HOSTNAME: 0.0.0.0 # required for docker compose
ADMIN_UVICORN_NUM_WORKERS: ${ADMIN_UVICORN_NUM_WORKERS-2}
ADMIN_UVICORN_PORT: ${ADMIN_UVICORN_PORT-8081}
depends_on:
- mongodb
# depends_on:
# - mongodb
restart: always
ports:
# for debug
Expand Down Expand Up @@ -252,22 +252,22 @@ services:
# depends_on:
# - mongodb
# restart: always
mongodb:
image: docker.io/mongo
volumes:
- mongo:/data/db:rw
ports:
# for debug
- "${MONGO_PORT-27017}:27017"
volumes:
assets:
mongo:
splits-datasets-cache:
splits-modules-cache:
splits-numba-cache:
first-rows-datasets-cache:
first-rows-modules-cache:
first-rows-numba-cache:
parquet-datasets-cache:
parquet-modules-cache:
parquet-numba-cache:
# mongodb:
# image: docker.io/mongo
# volumes:
# - mongo:/data/db:rw
# ports:
# # for debug
# - "${MONGO_PORT-27017}:27017"
# volumes:
# assets:
# mongo:
# splits-datasets-cache:
# splits-modules-cache:
# splits-numba-cache:
# first-rows-datasets-cache:
# first-rows-modules-cache:
# first-rows-numba-cache:
# parquet-datasets-cache:
# parquet-modules-cache:
# parquet-numba-cache:

0 comments on commit ac4168c

Please sign in to comment.