Add devcontainer (#142) #568
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Docker | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
# override default shell for mamba activation | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
test-docker: | |
name: Build and test Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install environment | |
uses: prefix-dev/setup-pixi@v0.8.1 | |
with: | |
pixi-version: v0.29.0 | |
cache: true | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
environments: data | |
activate-environment: true | |
- name: Show DVC config | |
run: dvc config --list | |
- name: Cache model data | |
uses: actions/cache@v4 | |
with: | |
path: .dvc/cache | |
key: docker-dvc-cache-${{ hashFiles('models/**.dvc') }} | |
- name: Fetch model data | |
run: | | |
dvc pull -vr public -R models | |
- name: Build Docker image | |
run: | | |
docker build -t poprox-recommender:ci --build-arg LOG_LEVEL=DEBUG . | |
- name: Start Docker container | |
run: | | |
docker run -d -p 9000:8080 --name=poprox-recommender poprox-recommender:ci | |
- name: Submit test request | |
run: | | |
python ./tests/integration/test-docker-lambda.py | |
- name: Dump Docker logs | |
if: always() | |
run: | | |
docker logs poprox-recommender | |
- name: Tear down Docker | |
if: always() | |
run: | | |
docker stop poprox-recommender | |
docker rm poprox-recommender | |
docker image rm poprox-recommender:ci |