Skip to content

Commit

Permalink
SPEED!
Browse files Browse the repository at this point in the history
  • Loading branch information
bigabig committed Nov 6, 2024
1 parent 4fe2fcc commit 0d31393
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/backend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build & Start Docker Containers
- name: Prepare environment
working-directory: docker
run: |
./setup-folders.sh
cp .env.example .env
sed -i 's/COMPOSE_PROJECT_NAME=demo/COMPOSE_PROJECT_NAME=action-runner/' .env
sed -i 's/\(DATS_BACKEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.event.head_commit.id }}/' .env
sed -i 's/\(DATS_RAY_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.event.head_commit.id }}/' .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
sed -i 's/\(DATS_BACKEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' .env
sed -i 's/\(DATS_RAY_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' .env
sed -i "s/GID=126/GID=$(id -g)/" .env
echo "SPACY_CACHE_DIR=$HOME/spacy_models" >> .env
echo "MODELS_CACHE_DIR=$HOME/models_cache" >> .env
mkdir -p $HOME/spacy_models
mkdir -p $HOME/models_cache
- name: Build & Start Docker Containers
working-directory: docker
run: |
COMPOSE_PROFILES="ray,background,backend" docker compose build
COMPOSE_PROFILES="ray,background" docker compose up --wait --quiet-pull
- name: Check 1 - pytest runs without errors
Expand Down Expand Up @@ -74,3 +77,6 @@ jobs:
run: |
docker compose down -v --remove-orphans
micromamba env remove -n dats --yes
BACKEND_IMAGE=uhhlt/dats_backend:$(grep -oP 'DATS_BACKEND_DOCKER_VERSION=\K.*' .env)
RAY_IMAGE=uhhlt/dats_ray:$(grep -oP 'DATS_RAY_DOCKER_VERSION=\K.*' .env)
docker rmi $BACKEND_IMAGE $RAY_IMAGE
19 changes: 12 additions & 7 deletions .github/workflows/frontend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}
- name: Check 0 - Build & Start Docker Containers
- name: Prepare environment
working-directory: docker
run: |
./setup-folders.sh
cp .env.example .env
sed -i 's/COMPOSE_PROJECT_NAME=demo/COMPOSE_PROJECT_NAME=action-runner/' .env
sed -i 's/\(DATS_FRONTEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.event.head_commit.id }}/' .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
sed -i 's/\(DATS_FRONTEND_DOCKER_VERSION=[0-9.]*\)/\1-${{ github.run_id }}/' .env
sed -i "s/GID=126/GID=$(id -g)/" .env
echo "SPACY_CACHE_DIR=$HOME/spacy_models" >> .env
echo "MODELS_CACHE_DIR=$HOME/models_cache" >> .env
mkdir -p $HOME/spacy_models
mkdir -p $HOME/models_cache
- name: Build & Start Docker Containers
working-directory: docker
run: |
docker compose build dats-frontend
docker compose up --wait --quiet-pull
- name: Setup node
Expand Down Expand Up @@ -67,3 +70,5 @@ jobs:
if: always()
run: |
docker compose down -v
FRONTEND_IMAGE=uhhlt/dats_frontend:$(grep -oP 'DATS_FRONTEND_DOCKER_VERSION=\K.*' .env)
docker rmi $FRONTEND_IMAGE

0 comments on commit 0d31393

Please sign in to comment.