Migrate more celery tasks (#4743) #20159
This file contains hidden or 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: CI | |
| on: [push, pull_request] | |
| env: | |
| PYTHON_VERSION: "3.13" | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| precommit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - uses: actions/checkout@v4 | |
| - name: Install pre-commit | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pre-commit virtualenv!=20.0.6 | |
| pre-commit install | |
| - name: Run static code inspections | |
| run: pre-commit run --all-files | |
| django-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - uses: actions/checkout@v4 | |
| - name: Build the test container | |
| run: | | |
| make build_web_test | |
| - name: Check migrations have been made | |
| run: make check_migrations | |
| - name: Run the django tests | |
| run: | | |
| make local_s3 | |
| docker compose run --rm celery_worker pytest --durations 10 | |
| forge-integration-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install pycurl dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcurl4-openssl-dev libssl-dev | |
| - name: Pull the algorithm-example base container | |
| run: | | |
| docker pull --platform=linux/amd64 \ | |
| pytorch/pytorch:2.9.1-cuda12.6-cudnn9-runtime | |
| - name: Run the forge integration tests | |
| run: | | |
| cd app | |
| uv run pytest -n 1 -m "forge_integration" | |
| javascript-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the test container | |
| run: | | |
| make build_web_test | |
| - name: Build the docs | |
| run: | | |
| make docs | |
| - name: Deploy the documentation on main | |
| if: github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./app/docs/_build/html | |
| deploy: | |
| needs: [django-tests, javascript-tests] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # These permissions are needed to interact with GitHub's OIDC Token endpoint. | |
| id-token: write | |
| contents: read | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build the distributable containers | |
| # The redis cache is required for compressing the files | |
| run: | | |
| docker compose up -d redis | |
| make build | |
| - name: Configure AWS credentials for ECR | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_ROLE_ARN }} | |
| aws-region: ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_REGION }} | |
| - name: Push to ECR | |
| run: | | |
| aws ecr get-login-password --region ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_REGION }} | docker login --username AWS --password-stdin ${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_HOST }} | |
| GRAND_CHALLENGE_PRIVATE_REPOSITORY_WEB_URI=${{ secrets.GRAND_CHALLENGE_PRIVATE_REPOSITORY_WEB_URI }} make push_web_private | |
| - name: Configure AWS credentials for ECR Public | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| aws-region: us-east-1 | |
| - name: Push to ECR Public | |
| run: | | |
| aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/diag-nijmegen | |
| make push_web_base | |
| make push_web_test_base | |
| - name: Create Summary | |
| run: | | |
| echo "## Container Tag" >> $GITHUB_STEP_SUMMARY | |
| echo "\`$(make container_tag)\`" >> $GITHUB_STEP_SUMMARY |