Skip to content
This repository was archived by the owner on Mar 14, 2026. It is now read-only.

Commit bc176c5

Browse files
committed
Merge branch 'release/0.5.0'
2 parents 37aa83b + 1d28bcf commit bc176c5

76 files changed

Lines changed: 2751 additions & 424 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- 'release/**'
9+
paths:
10+
- 'rust/employee-scheduling/**'
11+
- 'legacy/employee-scheduling-fast/**'
12+
- 'legacy/maintenance-scheduling-fast/**'
13+
- 'legacy/meeting-scheduling-fast/**'
14+
- 'legacy/order-picking-fast/**'
15+
- 'legacy/vehicle-routing-fast/**'
16+
- 'legacy/vm-placement-fast/**'
17+
- '.github/workflows/docker-publish.yml'
18+
workflow_dispatch:
19+
inputs:
20+
apps:
21+
description: 'Apps to build (comma-separated, or "all")'
22+
required: false
23+
default: 'all'
24+
25+
env:
26+
REGISTRY: ghcr.io
27+
28+
jobs:
29+
# Rust tests
30+
test-rust:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Rust
37+
uses: dtolnay/rust-toolchain@stable
38+
39+
- name: Cache Rust dependencies
40+
uses: Swatinem/rust-cache@v2
41+
with:
42+
workspaces: rust/employee-scheduling
43+
44+
- name: Run tests
45+
working-directory: rust/employee-scheduling
46+
run: cargo test --verbose
47+
48+
- name: Build
49+
working-directory: rust/employee-scheduling
50+
run: cargo build --release --verbose
51+
52+
# Python legacy tests
53+
test-python:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
app:
59+
- name: employee-scheduling-fast
60+
path: legacy/employee-scheduling-fast
61+
- name: maintenance-scheduling-fast
62+
path: legacy/maintenance-scheduling-fast
63+
- name: meeting-scheduling-fast
64+
path: legacy/meeting-scheduling-fast
65+
- name: order-picking-fast
66+
path: legacy/order-picking-fast
67+
- name: vehicle-routing-fast
68+
path: legacy/vehicle-routing-fast
69+
- name: vm-placement-fast
70+
path: legacy/vm-placement-fast
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@v4
74+
75+
- name: Set up Python
76+
uses: actions/setup-python@v5
77+
with:
78+
python-version: '3.12'
79+
80+
- name: Set up JDK 21
81+
uses: actions/setup-java@v4
82+
with:
83+
java-version: '21'
84+
distribution: 'temurin'
85+
86+
- name: Install dependencies
87+
working-directory: ${{ matrix.app.path }}
88+
run: |
89+
python -m pip install --upgrade pip
90+
pip install -e .
91+
pip install pytest
92+
93+
- name: Run tests
94+
working-directory: ${{ matrix.app.path }}
95+
run: pytest -v
96+
97+
# Build and push on main and dev
98+
build-and-push:
99+
needs: [test-rust, test-python]
100+
runs-on: ubuntu-latest
101+
permissions:
102+
contents: read
103+
packages: write
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
app:
108+
- name: employee-scheduling
109+
context: rust/employee-scheduling
110+
- name: employee-scheduling-fast
111+
context: legacy/employee-scheduling-fast
112+
- name: maintenance-scheduling-fast
113+
context: legacy/maintenance-scheduling-fast
114+
- name: meeting-scheduling-fast
115+
context: legacy/meeting-scheduling-fast
116+
- name: order-picking-fast
117+
context: legacy/order-picking-fast
118+
- name: vehicle-routing-fast
119+
context: legacy/vehicle-routing-fast
120+
- name: vm-placement-fast
121+
context: legacy/vm-placement-fast
122+
steps:
123+
- name: Checkout repository
124+
uses: actions/checkout@v4
125+
126+
- name: Check if app should be built
127+
id: check
128+
run: |
129+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
130+
apps="${{ github.event.inputs.apps }}"
131+
if [[ "$apps" == "all" || "$apps" == *"${{ matrix.app.name }}"* ]]; then
132+
echo "build=true" >> $GITHUB_OUTPUT
133+
else
134+
echo "build=false" >> $GITHUB_OUTPUT
135+
fi
136+
else
137+
echo "build=true" >> $GITHUB_OUTPUT
138+
fi
139+
140+
- name: Set up Docker Buildx
141+
if: steps.check.outputs.build == 'true'
142+
uses: docker/setup-buildx-action@v3
143+
144+
- name: Log in to Container Registry
145+
if: steps.check.outputs.build == 'true'
146+
uses: docker/login-action@v3
147+
with:
148+
registry: ${{ env.REGISTRY }}
149+
username: ${{ github.actor }}
150+
password: ${{ secrets.GITHUB_TOKEN }}
151+
152+
- name: Extract metadata (tags, labels)
153+
if: steps.check.outputs.build == 'true'
154+
id: meta
155+
uses: docker/metadata-action@v5
156+
with:
157+
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.app.name }}
158+
tags: |
159+
type=ref,event=branch
160+
type=sha,prefix=
161+
type=raw,value=latest
162+
163+
- name: Build and push Docker image
164+
if: steps.check.outputs.build == 'true'
165+
uses: docker/build-push-action@v5
166+
with:
167+
context: ${{ matrix.app.context }}
168+
push: true
169+
tags: ${{ steps.meta.outputs.tags }}
170+
labels: ${{ steps.meta.outputs.labels }}
171+
cache-from: type=gha
172+
cache-to: type=gha,mode=max

README.md

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,92 @@
11
# SolverForge Quickstarts
22

3-
This repository contains quickstarts for [SolverForge](https://github.com/SolverForge/solverforge-legacy), an AI constraint solver and framework for Rust and Python.
4-
It shows different use cases and basic implementations of constraint solving. The legacy (Timefold-based) quicktarts have been moved to [legacy](legacy/).
3+
This repository contains quickstarts for [SolverForge](https://github.com/SolverForge/solverforge), an AI constraint solver and framework for Rust and Python.
4+
It shows different use cases and basic implementations of constraint solving.
55

66
## Overview
77

8-
| Use Case <img width="341" height="1"> | Notable Solver Concepts <img width="541" height="1"> |
9-
|-----------------------------------------------------------------------|----------------------------------------------------------|
10-
| 🚚 <a href="#-vehicle-routing">Vehicle Routing</a> | Chained Through Time, Shadow Variables |
11-
| 🧑‍💼 <a href="#-employee-scheduling">Employee Scheduling</a> | Load Balancing |
12-
| 🛠️ <a href="#-maintenance-scheduling">Maintenance Scheduling</a> | TimeGrain, Shadow Variable, Variable Listener |
13-
| 🛒 <a href="#-order-picking">Order Picking</a> | Chained Planning Variable, Shadow Variables |
14-
| 👥 <a href="#-meeting-scheduling">Meeting Scheduling</a> | TimeGrain |
8+
| Use Case <img width="341" height="1"> | Rust | Python (Legacy) | Notable Solver Concepts <img width="541" height="1"> |
9+
|-----------------------------------------------------------------------|------|-----------------|-----------------------------------------------------|
10+
| 👋 <a href="#-hello-world">Hello World</a> | 🚧 || Basic Planning Problem |
11+
| 🧑‍💼 <a href="#-employee-scheduling">Employee Scheduling</a> ||| Load Balancing |
12+
| 🚚 <a href="#-vehicle-routing">Vehicle Routing</a> | 🚧 || Chained Through Time, Shadow Variables |
13+
| 🛠️ <a href="#-maintenance-scheduling">Maintenance Scheduling</a> | 🚧 || TimeGrain, Shadow Variable, Variable Listener |
14+
| 🛒 <a href="#-order-picking">Order Picking</a> | 🚧 || Chained Planning Variable, Shadow Variables |
15+
| 👥 <a href="#-meeting-scheduling">Meeting Scheduling</a> | 🚧 || TimeGrain |
16+
| 📈 <a href="#-portfolio-optimization">Portfolio Optimization</a> | 🚧 || Financial Constraints |
17+
| 🖥️ <a href="#-vm-placement">VM Placement</a> | 🚧 || Bin Packing, Resource Allocation |
1518

1619
> [!NOTE]
1720
> The implementations in this repository serve as a starting point and/or inspiration when creating your own application.
1821
> SolverForge is a library and does not include a UI. To illustrate these use cases a rudimentary UI is included in these quickstarts.
22+
>
23+
> **Rust implementations** are native SolverForge applications showcasing zero-erasure architecture.
24+
> **Python (Legacy)** implementations use the Timefold-based legacy solver and are located in the [legacy/](legacy/) directory.
1925
2026
## Use cases
2127

22-
### 🚚 Vehicle Routing
23-
24-
Find the most efficient routes for vehicles to reach visits, considering vehicle capacity and time windows when visits are available. Sometimes also called "CVRPTW".
28+
### 👋 Hello World
2529

26-
![Vehicle Routing Screenshot](legacy/vehicle-routing/vehicle-routing-screenshot.png)
30+
A minimal example demonstrating the basics of constraint solving with SolverForge.
2731

28-
- [Run vehicle-routing](legacy/vehicle-routing/README.MD) (Python, FastAPI)
29-
- [Run vehicle-routing (fast)](fast/vehicle-routing-fast/README.MD) (Python, FastAPI)
30-
31-
> [!TIP]
32-
> <img src="https://docs.timefold.ai/_/img/models/field-service-routing.svg" align="right" width="50px" /> [Check out our off-the-shelf model for Field Service Routing](https://app.timefold.ai/models/field-service-routing). This model goes beyond basic Vehicle Routing and supports additional constraints such as priorities, skills, fairness and more.
32+
- **Python (Legacy)**: [legacy/hello-world-fast](legacy/hello-world-fast/README.md)
3333

3434
---
3535

3636
### 🧑‍💼 Employee Scheduling
3737

3838
Schedule shifts to employees, accounting for employee availability and shift skill requirements.
3939

40-
![Employee Scheduling Screenshot](java/employee-scheduling/employee-scheduling-screenshot.png)
40+
- **Rust**: [rust/employee-scheduling](rust/employee-scheduling/README.md)
41+
- **Python (Legacy)**: [legacy/employee-scheduling-fast](legacy/employee-scheduling-fast/README.md)
42+
43+
---
4144

42-
- [Run employee-scheduling](legacy/employee-scheduling/README.MD) (Python, FastAPI)
43-
- [Run employee-scheduling (fast)](fast/employee-scheduling-fast/README.MD) (Python, FastAPI)
45+
### 🚚 Vehicle Routing
4446

45-
> [!TIP]
46-
> <img src="https://docs.timefold.ai/_/img/models/employee-shift-scheduling.svg" align="right" width="50px" /> [Check out our off-the-shelf model for Employee Shift Scheduling](https://app.timefold.ai/models/employee-scheduling). This model supports many additional constraints such as skills, pairing employees, fairness and more.
47+
Find the most efficient routes for vehicles to reach visits, considering vehicle capacity and time windows when visits are available. Sometimes also called "CVRPTW".
48+
49+
- **Python (Legacy)**: [legacy/vehicle-routing-fast](legacy/vehicle-routing-fast/README.md)
4750

4851
---
4952

5053
### 🛠️ Maintenance Scheduling
5154

5255
Schedule maintenance jobs to crews over time to reduce both premature and overdue maintenance.
5356

54-
![Maintenance Scheduling Screenshot](legacy/maintenance-scheduling/maintenance-scheduling-screenshot.png)
55-
56-
- [Run maintenance-scheduling](legacy/maintenance-scheduling/README.adoc) (Python, FastAPI)
57+
- **Python (Legacy)**: [legacy/maintenance-scheduling-fast](legacy/maintenance-scheduling-fast/README.md)
5758

5859
---
5960

6061
### 🛒 Order Picking
6162

6263
Generate an optimal picking plan for completing a set of orders.
6364

64-
![Order Picking Screenshot](legacy/order-picking/order-picking-screenshot.png)
65-
66-
- [Run order-picking](legacy/order-picking/README.adoc) (Python, FastAPI)
65+
- **Python (Legacy)**: [legacy/order-picking-fast](legacy/order-picking-fast/README.md)
6766

6867
---
6968

7069
### 👥 Meeting Scheduling
7170

7271
Assign timeslots and rooms for meetings to produce a better schedule.
7372

74-
![Meeting Scheduling Screenshot](legacy/meeting-scheduling/meeting-scheduling-screenshot.png)
73+
- **Python (Legacy)**: [legacy/meeting-scheduling-fast](legacy/meeting-scheduling-fast/README.md)
74+
75+
---
76+
77+
### 📈 Portfolio Optimization
78+
79+
Optimize investment portfolios to balance risk and return while satisfying various financial constraints.
80+
81+
- **Python (Legacy)**: [legacy/portfolio-optimization-fast](legacy/portfolio-optimization-fast/README.md)
82+
83+
---
84+
85+
### 🖥️ VM Placement
86+
87+
Optimize the placement of virtual machines across physical servers to maximize resource utilization and minimize costs.
7588

76-
- [Run meeting-scheduling](legacy/meeting-scheduling/README.adoc) (Python, FastAPI)
77-
- [Run meeting-scheduling (fast)](fast/meeting-scheduling-fast/README.adoc) (Python, FastAPI)
89+
- **Python (Legacy)**: [legacy/vm-placement-fast](legacy/vm-placement-fast/README.md)
7890

7991
---
8092

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: ApplicationSet
3+
metadata:
4+
name: solverforge-legacy-apps
5+
namespace: argocd
6+
spec:
7+
generators:
8+
- list:
9+
elements:
10+
- appName: employee-scheduling-fast
11+
chartPath: legacy/employee-scheduling-fast/helm/employee-scheduling-fast
12+
- appName: maintenance-scheduling-fast
13+
chartPath: legacy/maintenance-scheduling-fast/helm/maintenance-scheduling-fast
14+
- appName: meeting-scheduling-fast
15+
chartPath: legacy/meeting-scheduling-fast/helm/meeting-scheduling-fast
16+
- appName: order-picking-fast
17+
chartPath: legacy/order-picking-fast/helm/order-picking-fast
18+
- appName: vehicle-routing-fast
19+
chartPath: legacy/vehicle-routing-fast/helm/vehicle-routing-fast
20+
- appName: vm-placement-fast
21+
chartPath: legacy/vm-placement-fast/helm/vm-placement-fast
22+
template:
23+
metadata:
24+
name: '{{appName}}'
25+
namespace: argocd
26+
labels:
27+
app.kubernetes.io/part-of: solverforge-legacy
28+
finalizers:
29+
- resources-finalizer.argocd.argoproj.io
30+
spec:
31+
project: default
32+
source:
33+
repoURL: https://github.com/SolverForge/solverforge-quickstarts.git
34+
targetRevision: HEAD
35+
path: '{{chartPath}}'
36+
helm:
37+
releaseName: '{{appName}}'
38+
valueFiles:
39+
- values.yaml
40+
destination:
41+
server: https://kubernetes.default.svc
42+
namespace: solverforge-benchmark
43+
syncPolicy:
44+
automated:
45+
prune: true
46+
selfHeal: true
47+
syncOptions:
48+
- CreateNamespace=true
49+
- PruneLast=true
50+
retry:
51+
limit: 5
52+
backoff:
53+
duration: 5s
54+
factor: 2
55+
maxDuration: 3m
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.DS_Store
2+
.git/
3+
.gitignore
4+
.bzr/
5+
.bzrignore
6+
.hg/
7+
.hgignore
8+
.svn/
9+
*.swp
10+
*.bak
11+
*.tmp
12+
*.orig
13+
*~
14+
.project
15+
.idea/
16+
*.tmproj
17+
.vscode/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v2
2+
name: employee-scheduling-fast
3+
description: Employee Scheduling optimization using Timefold Solver (Python/FastAPI)
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"
7+
keywords:
8+
- timefold
9+
- optimization
10+
- scheduling
11+
- python
12+
- fastapi

0 commit comments

Comments
 (0)