Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
max-line-length = 120
extend-ignore = E203, W503, E266
exclude = .git,__pycache__,build,dist,src/cpp,cmake-build-debug,cmake-build-release,cmake-build-relwithdebinfo
18 changes: 9 additions & 9 deletions .github/workflows/build_and_publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ name: Build and Publish Docs
on:
push:
branches: [ main ]
# pull_request:
# branches: [ main ]

jobs:
setup-container:
uses: ./.github/workflows/container_setup.yaml

build_docs:
needs: setup-container
runs-on: ubuntu-latest
container:
image: ghcr.io/marius-team/quake/ubuntu-latest:latest
image: ${{ needs.setup-container.outputs.container_image }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Quake
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
conda activate quake-env
pip install .
pip install --no-use-pep517 .

- name: Build Sphinx Documentation
working-directory: docs
run: |
run: |
conda run -n quake-env sphinx-build -b html . _build/html

- name: Deploy Documentation to GitHub Pages
Expand Down
50 changes: 17 additions & 33 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ name: Build and Test

on:
push:
branches:
- main
branches: [ main ]
pull_request:
branches:
- main

env:
BUILD_TYPE: Debug
branches: [ main ]

jobs:
test:
setup-container:
uses: ./.github/workflows/container_setup.yaml

build_and_test:
needs: setup-container
runs-on: ubuntu-latest
container:
image: ghcr.io/marius-team/quake/ubuntu-latest:latest
image: ${{ needs.setup-container.outputs.container_image }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build project
- name: Build C++
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
Expand All @@ -38,30 +35,17 @@ jobs:
make bindings -j2
make quake_tests -j2

- name: Run tests
run: |
cd build
test/cpp/quake_tests

python_build:
runs-on: ubuntu-latest
container:
image: ghcr.io/marius-team/quake/ubuntu-latest:latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Debug Checkout
- name: Run C++ Tests
shell: bash
run: |
ls -R
./build/test/cpp/quake_tests

- name: Build project
- name: Run Python Tests
shell: bash
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
conda activate quake-env
pip install .
pip install --no-use-pep517 .
pip install pytest
python -m pytest test/python
106 changes: 106 additions & 0 deletions .github/workflows/container_setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Container Setup

on:
workflow_call:
outputs:
container_image:
description: "Container image determined by this workflow"
value: ${{ jobs.determine-and-build.outputs.container_image }}

jobs:
determine-and-build:
runs-on: ubuntu-latest
outputs:
container_image: ${{ steps.set_image.outputs.container_image }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check for dependency changes
id: diff
shell: bash
run: |
echo "Checking for dependency changes..."
# Fetch the latest state of the default branch.
git fetch origin ${{ github.event.repository.default_branch }}
# Compare the dependency files between the default branch and current commit.
if git diff --name-only origin/${{ github.event.repository.default_branch }}...${{ github.sha }} | grep -E 'Dockerfile|conda.yaml'; then
echo "build_required=true" >> "$GITHUB_OUTPUT"
else
echo "build_required=false" >> "$GITHUB_OUTPUT"
fi

- name: Use Main Container if No Dependency Changes
id: use_main
if: steps.diff.outputs.build_required == 'false'
shell: bash
run: |
image="ghcr.io/marius-team/quake/ubuntu-latest:latest"
echo "No dependency changes detected. Using main container: $image"
echo "container_image=$image" >> "$GITHUB_OUTPUT"

- name: Compute Dependency Hash
id: dependency_hash
if: steps.diff.outputs.build_required == 'true'
shell: bash
run: |
echo "Computing hash for dependency files..."
# Concatenate the files to create a unique fingerprint.
hash=$(cat environments/ubuntu-latest/Dockerfile environments/ubuntu-latest/conda.yaml 2>/dev/null | sha256sum | awk '{print $1}')
echo "hash=$hash" >> "$GITHUB_OUTPUT"
echo "Dependency hash: $hash"

- name: Check if Test Container Exists
id: check_container
if: steps.diff.outputs.build_required == 'true'
shell: bash
run: |
image="ghcr.io/marius-team/quake/test_container:${{ steps.dependency_hash.outputs.hash }}"
echo "Checking if container exists: $image"
if docker pull "$image" > /dev/null 2>&1; then
echo "container_exists=true" >> "$GITHUB_OUTPUT"
echo "container_image=$image" >> "$GITHUB_OUTPUT"
echo "Container already exists: $image"
else
echo "container_exists=false" >> "$GITHUB_OUTPUT"
echo "Container not found: $image"
fi

- name: Build Test Container if Needed
id: build
if: steps.diff.outputs.build_required == 'true' && steps.check_container.outputs.container_exists == 'false'
shell: bash
run: |
tag="ghcr.io/marius-team/quake/test_container:${{ steps.dependency_hash.outputs.hash }}"
echo "Building test container: $tag"
docker build -f environments/ubuntu-latest/Dockerfile -t "$tag" .
docker push "$tag"
echo "container_image=$tag" >> "$GITHUB_OUTPUT"
echo "Test container built and pushed."

- name: Set Container Image Output
id: set_image
shell: bash
run: |
if [ "${{ steps.diff.outputs.build_required }}" = "false" ]; then
image="ghcr.io/marius-team/quake/ubuntu-latest:latest"
else
# Use the pre-existing container image if available, otherwise the one just built.
if [ -n "${{ steps.check_container.outputs.container_image }}" ]; then
image="${{ steps.check_container.outputs.container_image }}"
else
image="${{ steps.build.outputs.container_image }}"
fi
fi
echo "Using container image: $image"
echo "container_image=$image" >> "$GITHUB_OUTPUT"
32 changes: 32 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint Checks

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Dependencies
run: |
pip install black==25.1.0 isort==6.0.1 flake8==7.1.2

- name: Run Black Check
run: black --check .

- name: Run isort Check
run: isort --check-only .

- name: Run flake8
run: flake8 .
26 changes: 4 additions & 22 deletions .github/workflows/publish_docker_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: Build and Publish Docker Image
on:
push:
branches: [ main ]
# pull_request:
# branches: [ main ]

jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -25,27 +24,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
- name: Build and push main container
uses: docker/build-push-action@v4
with:
context: .
file: environments/ubuntu-latest/Dockerfile
tags: ghcr.io/marius-team/quake/ubuntu-latest:latest
push: true

test:
runs-on: ubuntu-latest
container:
image: ghcr.io/marius-team/quake/ubuntu-latest:latest
needs: [build-and-push-image]
steps:
- uses: actions/checkout@v4

- name: Build project
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
conda activate quake-env
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DQUAKE_USE_NUMA=OFF -DQUAKE_ENABLE_GPU=OFF -DBUILD_TESTS=ON ../
make bindings -j2
push: true
41 changes: 41 additions & 0 deletions .github/workflows/regression_baseline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Manual Baseline Generation

on:
workflow_dispatch:

jobs:
setup-container:
uses: ./.github/workflows/container_setup.yaml

generate-baseline:
needs: setup-container
runs-on: ubuntu-latest
container:
image: ${{ needs.setup-container.outputs.container_image }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Quake
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
conda activate quake-env
pip install --no-use-pep517 .

- name: Run Baseline Driver Script
run: |
git config --global --add safe.directory '*'
eval "$(conda shell.bash hook)"
conda activate quake-env
cd test/python/regression
python run_all_workloads.py --overwrite --name baseline

- name: Upload Baseline Artifacts
uses: actions/upload-artifact@v4
with:
name: baseline-artifacts
path: |
test/python/regression/workloads
test/python/regression/results
test/python/regression/data
Loading
Loading