Skip to content

Commit

Permalink
use cache?
Browse files Browse the repository at this point in the history
  • Loading branch information
bigabig committed Nov 6, 2024
1 parent 4b575aa commit b2969cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/backend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache models
id: cache-models
uses: actions/cache@v3
with:
path: |
docker/spacy_models
docker/models_cache
key: models-${{ hashFiles('backend/src/app/preprocessing/ray_model_worker/config_*') }}
- name: Build & Start Docker Containers (1)
working-directory: docker
run: |
Expand All @@ -38,6 +30,10 @@ jobs:
sed -i 's/\(DATS_BACKEND_DOCKER_VERSION=[0-9.]*\)/\1-test/' .env
sed -i 's/\(DATS_RAY_DOCKER_VERSION=[0-9.]*\)/\1-test/' .env
export GID=$(id -g)
export SPACY_CACHE_DIR=$HOME/spacy_models
export MODELS_CACHE_DIR=$HOME/models_cache
mkdir -p $SPACY_CACHE_DIR
mkdir -p $MODELS_CACHE_DIR
COMPOSE_PROFILES="ray,background" docker compose up --wait --build --quiet-pull
- name: Check 1 - pytest runs without errors
working-directory: docker
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/frontend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Cache models
id: cache-models
uses: actions/cache@v3
with:
path: |
docker/spacy_models
docker/models_cache
key: models-${{ hashFiles('backend/src/app/preprocessing/ray_model_worker/config_*') }}
- name: Check 0 - Build & Start Docker Containers
working-directory: docker
run: |
Expand All @@ -42,6 +34,10 @@ jobs:
sed -i 's/COMPOSE_PROJECT_NAME=demo/COMPOSE_PROJECT_NAME=action-runner/' .env
sed -i 's/\(DATS_FRONTEND_DOCKER_VERSION=[0-9.]*\)/\1-test/' .env
export GID=$(id -g)
export SPACY_CACHE_DIR=$HOME/spacy_models
export MODELS_CACHE_DIR=$HOME/models_cache
mkdir -p $SPACY_CACHE_DIR
mkdir -p $MODELS_CACHE_DIR
docker compose build dats-frontend
docker compose up --wait --quiet-pull
- name: Setup node
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ services:
NUMBA_CACHE_DIR: /numba_cache
volumes:
- ../backend/src/app/preprocessing/ray_model_worker:/dats_code_ray
- ./spacy_models:/spacy_models
- ${SPACY_CACHE_DIR:-./spacy_models}:/spacy_models
- ./backend_repo:/tmp/dats
- ./models_cache:/models_cache
- ${MODELS_CACHE_DIR:-./models_cache}:/models_cache
- ./numba_cache:/numba_cache
ports:
- "${RAY_API_EXPOSED:-13130}:8000"
Expand Down Expand Up @@ -227,7 +227,7 @@ services:
volumes:
- ../backend/src:/dats_code/src
- ./backend_repo:/tmp/dats
- ./models_cache:/models_cache
- ${MODELS_CACHE_DIR:-./models_cache}:/models_cache
- ./numba_cache:/numba_cache
depends_on:
postgres:
Expand Down

0 comments on commit b2969cc

Please sign in to comment.