Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
212 changes: 124 additions & 88 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,136 @@
name: Run Workflow and Deploy to GitHub Pages
name: Benchmark & Deploy to GitHub Pages

permissions:
contents: write


on:
push:
branches:
- main # Run the workflow on pushes to the main branch
- p16-benchmark # Run the workflow on pushes to the p16-benchmark branch
pull_request:
branches:
- main # Optionally run on pull requests to the main branch
- p16-benchmark # Optionally run on pull requests to the p16-benchmark branch

branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
dataset:
description: 'Dataset to benchmark'
required: false
default: 'dbpedia'
type: choice
options: [dbpedia, bowlogna, bsbm, lubm]
engines:
description: 'Comma-separated engines (e.g. corese.4.6.5,jena.6.2.0)'
required: false
default: 'corese.4.6.5,jena.6.2.0,rdf4j.5.3.2'
scales:
description: 'Dataset scales'
required: false
default: 'small,medium,large'
inference:
description: 'Enable RDFS inference (Corese only)'
required: false
default: false
type: boolean

jobs:
#####################################
# using Github public runner
#####################################
public-build:
if: github.ref != 'refs/heads/p16-benchmark'
#runs-on: p16-benchmark-corese
runs-on: ubuntu-latest # Use the latest Ubuntu runner

# ─── Smoke test on PR (GitHub-hosted, fast) ───────────────────────────────
smoke-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'

- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: python-utils/environment.yml
activate-environment: benchmarkenv
auto-activate-base: false

- name: Run smoke test (dbpedia small only)
shell: bash -l {0}
run: |
python python-utils/workflow.py \
--engines="corese.4.6.5,jena.6.2.0,rdf4j.5.3.2" \
--dataset="dbpedia" \
--scales="small"

- name: Check site/data output
run: ls -la ./site/data/

# ─── Full benchmark on merge to main (P16 self-hosted) ────────────────────
benchmark-node:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: [self-hosted, corese-benchmark]

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2.1: Create and activate conda environment, install dependencies
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: python-utils/environment.yml
activate-environment: benchmarkenv
auto-activate-base: false

# Step 2.2: Create and activate conda environment, install dependencies
- name: Run workflow
shell: bash -l {0}
env:
RUNNER_ENV: github-public
run: |
conda info --envs
cd python-utils
python workflow.py --triplestoreNames="rdf4j.5.1.2,jena.5.4.0,corese.4.6.3"



# Step 3 : Debugging step: Check if the public directory exists
- name: Check public directory is here and contains required files
run: ls -la ./public

# Step 4: Deploy the dashboard folder to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public # Path to the folder containing the HTML files
force_orphan: true # Overwrite the gh-pages branch


#####################################
# using P16 private runner
#####################################
private-build:
if: github.ref == 'refs/heads/p16-benchmark'
runs-on: p16-benchmark-corese
- name: Checkout
uses: actions/checkout@v4

- name: Set up conda environment
run: |
CONDA_SH=$(find $HOME -name "conda.sh" -path "*/profile.d/conda.sh" 2>/dev/null | head -1)
source "$CONDA_SH"
conda env update -f python-utils/environment.yml --prune

- name: Run full benchmark
run: |
CONDA_SH=$(find $HOME -name "conda.sh" -path "*/profile.d/conda.sh" 2>/dev/null | head -1)
source "$CONDA_SH"
conda activate benchmarkenv
python python-utils/workflow.py \
--engines="corese.4.6.5,jena.6.2.0,rdf4j.5.3.2" \
--dataset="dbpedia"

- name: Check site/data output
run: ls -la ./site/data/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
force_orphan: true

# ─── Manual run (workflow_dispatch) ───────────────────────────────────────
benchmark-manual:
if: github.event_name == 'workflow_dispatch'
runs-on: [self-hosted, corese-benchmark]

steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Create and activate conda environment, install dependencies
- name: Create and activate conda environment
env:
RUNNER_ENV: P16-benchmark
run: |
source ~/miniconda3/bin/activate
conda env update -f python-utils/environment.yml
source $HOME/miniconda3/etc/profile.d/conda.sh
conda activate benchmarkenv
conda info --envs
cd python-utils
python workflow.py --triplestoreNames="rdf4j.5.1.2,jena.5.4.0,corese.4.6.3" --dataDir="/media/storage/corese-benchmark/benchmark_data"

# Debugging step: Check if the public directory exists
- name: Check public directory is here and contains required files
run: ls -la ./public

# Step 3: Deploy the dashboard folder to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public # Path to the folder containing the HTML files
force_orphan: true # Overwrite the gh-pages branch
- name: Checkout
uses: actions/checkout@v4

- name: Set up conda environment
run: |
CONDA_SH=$(find $HOME -name "conda.sh" -path "*/profile.d/conda.sh" 2>/dev/null | head -1)
source "$CONDA_SH"
conda env update -f python-utils/environment.yml --prune

- name: Run benchmark
run: |
CONDA_SH=$(find $HOME -name "conda.sh" -path "*/profile.d/conda.sh" 2>/dev/null | head -1)
source "$CONDA_SH"
conda activate benchmarkenv
python python-utils/workflow.py \
--engines="${{ github.event.inputs.engines }}" \
--dataset="${{ github.event.inputs.dataset }}" \
--scales="${{ github.event.inputs.scales }}" \
${{ github.event.inputs.inference == 'true' && '--inference' || '' }}

- name: Check site/data output
run: ls -la ./site/data/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
force_orphan: true
31 changes: 24 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
.DS_Store
tmp
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
# Gradle
.gradle
build
input
out
public

# Benchmark data (downloaded datasets, generated reports)
input/
out/
public/
commit/

# Local Corese JAR (copied by workflow.py)
libs/*
commit/*
!libs/.gitkeep

# Generated site data (rebuilt on every run)
site/data/benchmark-report.json
site/data/benchmark-report.csv
site/data/report-data.js
site/data/history-data.js
site/data/history/

# Python
__pycache__/
*.pyc
*.pyo
python-utils/datasets/__pycache__/
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/claudeCodeEditorTabs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# corese-benchmark — common workflow commands
# Usage: make <target>
# Requires: conda env 'benchmarkenv' active, or run `make env` first

PYTHON := python
WORKFLOW := python-utils/workflow.py
ENGINES ?= corese.local,corese.4.6.5,jena.6.2.0,rdf4j.5.3.2
DATASET ?= dbpedia
DATASETS ?= dbpedia,bowlogna,bsbm,lubm
SCALES ?= small

.PHONY: help env regression compare next bowlogna lubm bsbm all site clean-out

help:
@echo ""
@echo " make regression Detect a Corese regression (local vs 4.6.5)"
@echo " make compare Compare corese + jena + rdf4j on dbpedia"
@echo " make next Benchmark corese.next vs corese.4.6.5"
@echo " make bowlogna Bowlogna dataset with SPARQL queries (corese.local vs 4.6.5)"
@echo " make lubm LUBM dataset with SPARQL queries"
@echo " make bsbm BSBM dataset"
@echo " make all All datasets (dbpedia + bowlogna + bsbm + lubm) in one run"
@echo " make site Serve the dashboard at http://localhost:8080"
@echo " make env Create conda environment"
@echo " make clean-out Delete all generated reports in out/"
@echo ""
@echo " Override engines: make regression ENGINES=corese.local,corese.4.6.5"
@echo " Override dataset: make compare DATASET=bowlogna"
@echo " Override datasets: make all DATASETS=dbpedia,bowlogna"
@echo " Override scales: make bowlogna SCALES=small,medium"
@echo ""

env:
conda env create -f python-utils/environment.yml
@echo "Run: conda activate benchmarkenv"

regression:
$(PYTHON) $(WORKFLOW) --engines corese.local,corese.4.6.5 --dataset $(DATASET)

compare:
$(PYTHON) $(WORKFLOW) --engines $(ENGINES) --dataset $(DATASET)

next:
$(PYTHON) $(WORKFLOW) --engines corese.next,corese.4.6.5 --dataset $(DATASET)

bowlogna:
$(PYTHON) $(WORKFLOW) --engines corese.local,corese.4.6.5 --dataset bowlogna --scales $(SCALES)

lubm:
$(PYTHON) $(WORKFLOW) --engines corese.local,corese.4.6.5 --dataset lubm --scales $(SCALES)

bsbm:
$(PYTHON) $(WORKFLOW) --engines $(ENGINES) --dataset bsbm --scales $(SCALES)

all:
$(PYTHON) $(WORKFLOW) --engines $(ENGINES) --datasets $(DATASETS) --scales $(SCALES)

site:
@echo "Dashboard: http://localhost:8080"
cd site && $(PYTHON) -m http.server 8080

clean-out:
rm -rf out/json/*.json out/csv/*.csv
@echo "Reports deleted."
Loading
Loading