Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paraffin v0.3.0 #44

Merged
merged 40 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d74a26c
paraffin v0.3.0
PythonFZ Jan 20, 2025
086a9d0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 20, 2025
02ee1fa
paraffin ui
PythonFZ Jan 22, 2025
f73030a
paraffin v0.3.1
PythonFZ Jan 22, 2025
4ff1bc9
cleanup
PythonFZ Jan 22, 2025
db11f41
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 22, 2025
0e4ebb7
allow specifing the port
PythonFZ Jan 23, 2025
54c089d
Merge branch 'v3' of https://github.com/zincware/paraffin into v3
PythonFZ Jan 23, 2025
9b468ce
extract and send group info
PythonFZ Jan 23, 2025
e03305b
clean up
PythonFZ Jan 23, 2025
43c7e64
group somewhat showing
PythonFZ Jan 23, 2025
4d4a0c5
auto-layout
PythonFZ Jan 24, 2025
78c338d
group, collape and expand
PythonFZ Jan 24, 2025
d7e3ffd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 24, 2025
4b17664
style and format groups
PythonFZ Jan 25, 2025
c240a90
format and publish
PythonFZ Jan 25, 2025
dc70edc
update DB schema
PythonFZ Jan 25, 2025
35fe249
allow for manual refresh
PythonFZ Jan 25, 2025
1495c03
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
b415dd9
updates, everyone wants updates!
PythonFZ Jan 25, 2025
75d4e84
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
7a38b39
do not show cached, because it seems to be wrong
PythonFZ Jan 25, 2025
2cb20b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
612386c
update tests
PythonFZ Jan 25, 2025
225ce19
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
4ef0fe8
build before testing
PythonFZ Jan 25, 2025
47080be
refactor
PythonFZ Jan 25, 2025
623c478
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
5b13b7d
save workers in db and update UI when worker is updated
PythonFZ Jan 25, 2025
99aafa9
reset job status via UI
PythonFZ Jan 25, 2025
7e09915
do not allow to reset `completed` jobs
PythonFZ Jan 25, 2025
39663d9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 25, 2025
99a5651
capture lock errors
PythonFZ Jan 26, 2025
b957dcc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 26, 2025
151b2f9
update readme, db, gitignore and publish action
PythonFZ Jan 26, 2025
f546626
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 26, 2025
7982753
lint
PythonFZ Jan 26, 2025
345cc47
do not run `check-json`
PythonFZ Jan 26, 2025
eda140a
update readme
PythonFZ Jan 26, 2025
87123c9
v0.3.2
PythonFZ Jan 26, 2025
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 .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: build frontend
run: |
npm install -g bun
cd app && bun install && bun vite build && cd ..
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jobs:
- name: Install package
run: |
poetry install --no-interaction
- name: build frontend
run: |
npm install -g bun
cd app && bun install && bun vite build && cd ..
- name: Setup git user
run: |
git config --global user.name "John Doe"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
# - id: check-json
- id: check-merge-conflict
args: ['--assume-in-merge']
- id: check-toml
Expand Down
71 changes: 20 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
[![PyPI version](https://badge.fury.io/py/paraffin.svg)](https://badge.fury.io/py/paraffin)
[![Discord](https://img.shields.io/discord/1034511611802689557)](https://discord.gg/7ncfwhsnm4)

> [!WARNING]
> [celery](https://github.com/celery/celery) can not handle large workflows and will crash your computer.
> See https://github.com/celery/celery/issues/9475.
> Therefore, `paraffin` should **currently not** be used for large workflows.
> We are working on a solution without relying on `celery`.

# paraffin

Paraffin, derived from the Latin phrase `parum affinis` meaning
Expand All @@ -31,55 +25,30 @@ pip install paraffin

## Usage

The `paraffin submit` command mirrors `dvc repro`, enabling you to queue and execute your entire pipeline or selected stages with parallelization.
If no parameters are specified, the entire graph will be queued and executed via `dvc repro --single-item`.
### paraffin submit
You can submit your current DVC workflow to a database file `paraffin.db` for later execution.

> [!TIP]
> The paraffin submit command supports globing patterns.
```bash
paraffin submit <stage name> <stage name> ... <stage name>
# Example: run with a maximum of 4 parallel jobs
paraffin worker --concurrency=4
```

### Parallel Execution
Due to limitations in Celery’s graph handling (see [Celery discussion](https://github.com/celery/celery/discussions/9376)), complete parallelization is not always achievable. Paraffin will display parallel-ready stages in a flowchart format.
All stages are visualized in a [Mermaid](https://mermaid.js.org/) flowchart.

```mermaid
flowchart TD
subgraph Level0:1
A_X_ParamsToOuts
A_X_ParamsToOuts_1
A_Y_ParamsToOuts
A_Y_ParamsToOuts_1
end
subgraph Level0:2
A_X_AddNodeNumbers
A_Y_AddNodeNumbers
end
subgraph Level0:3
A_SumNodeAttributes
end
Level0:1 --> Level0:2
Level0:2 --> Level0:3
subgraph Level1:1
B_X_ParamsToOuts
B_X_ParamsToOuts_1
B_Y_ParamsToOuts
B_Y_ParamsToOuts_1
end
subgraph Level1:2
B_X_AddNodeNumbers
B_Y_AddNodeNumbers
end
subgraph Level1:3
B_SumNodeAttributes
end
Level1:1 --> Level1:2
Level1:2 --> Level1:3
paraffin submit C_AddNodeNumbers "A*"
```

### paraffin worker
A submitted job will be executed by paraffin workers.
To start a worker you can run `paraffin worker`.
The worker will pick up all the jobs in the workeres queue and close once finished.

```bash
paraffin worker
```

### paraffin ui
Paraffin ships with a web application for visualizing the progress.
You can start it using
```bash
paraffin ui
```

## Queue Labels

Expand All @@ -93,9 +62,9 @@ queue:
```
Then, start a worker with specified queues, such as celery (default) and AQueue:
```bash
paraffin worker -q AQueue,celery
paraffin worker -q AQueue,default
```
All `stages` not assigned to a queue in `paraffin.yaml` will default to the `celery` queue.
All `stages` not assigned to a queue in `paraffin.yaml` will default to the `default` queue.


> [!TIP]
Expand Down
24 changes: 24 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
50 changes: 50 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
30 changes: 30 additions & 0 deletions app/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
Binary file added app/bun.lockb
Binary file not shown.
28 changes: 28 additions & 0 deletions app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
);
13 changes: 13 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@xyflow/react": "^12.4.2",
"bootstrap": "^5.3.3",
"elkjs": "^0.9.3",
"react": "^18.3.1",
"react-bootstrap": "^2.10.8",
"react-dom": "^18.3.1",
"react-icons": "^5.4.0",
"react-markdown": "^9.0.3"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@eslint/js": "^9.17.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.17.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.14.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.18.2",
"vite": "^6.0.5"
}
}
1 change: 1 addition & 0 deletions app/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.react-flow__node {
z-index: -1 !important;
}
Loading
Loading