Skip to content

♻️ Extract Celery code to a new simcore package ⚠️ #7698

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

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
0545b05
Initial commit
giancarloromeo May 19, 2025
3d833dd
add files
giancarloromeo May 19, 2025
5eff59d
rename
giancarloromeo May 19, 2025
8eb12a0
add codeowner
giancarloromeo May 19, 2025
48b4532
add dependency
giancarloromeo May 19, 2025
f4ca78a
add reqs
giancarloromeo May 19, 2025
04690ca
refactor
giancarloromeo May 19, 2025
5cfdb51
refactor
giancarloromeo May 19, 2025
d5cdf8c
add celery dep
giancarloromeo May 19, 2025
a1de0be
continue
giancarloromeo May 19, 2025
305f925
continue
giancarloromeo May 19, 2025
836f751
update deps
giancarloromeo May 19, 2025
61eb070
tests
giancarloromeo May 20, 2025
115748e
add py.typed
giancarloromeo May 20, 2025
50983d3
add assert
giancarloromeo May 20, 2025
6ea72b1
move tests
giancarloromeo May 20, 2025
daa3a7a
add celery-library
giancarloromeo May 20, 2025
39856a0
ci
giancarloromeo May 20, 2025
1630ee9
add celery-library.bash
giancarloromeo May 20, 2025
757d96a
add celery-lib
giancarloromeo May 20, 2025
08e887f
add Makefile
giancarloromeo May 20, 2025
5ccbded
typecheck
giancarloromeo May 20, 2025
69d24ca
fix tests
giancarloromeo May 20, 2025
da2bf53
typecheck
giancarloromeo May 20, 2025
ab48cea
revert
giancarloromeo May 20, 2025
2ea37be
Merge branch 'master' into extract-celery-code
giancarloromeo May 20, 2025
fa25e67
add ref
giancarloromeo May 20, 2025
74d77b4
add type hint
giancarloromeo May 20, 2025
43fd068
typecheck
giancarloromeo May 20, 2025
6de9a83
typecheck
giancarloromeo May 20, 2025
ca9d7c5
Merge branch 'master' into extract-celery-code
giancarloromeo May 20, 2025
2405161
remove pydantic
giancarloromeo May 20, 2025
54a4f5f
Merge branch 'extract-celery-code' of github.com:giancarloromeo/ospar…
giancarloromeo May 20, 2025
9d234de
add task_id
giancarloromeo May 20, 2025
17382ca
Merge branch 'master' into extract-celery-code
giancarloromeo May 20, 2025
4589ae1
fix body
giancarloromeo May 20, 2025
4baa92c
Merge branch 'extract-celery-code' of github.com:giancarloromeo/ospar…
giancarloromeo May 20, 2025
490ba71
assert
giancarloromeo May 20, 2025
1477536
fix return
giancarloromeo May 20, 2025
8e5dd06
Merge branch 'master' into extract-celery-code
giancarloromeo May 20, 2025
c080344
fix modeldump
giancarloromeo May 20, 2025
0fc9137
add params
giancarloromeo May 20, 2025
ea0665c
Merge branch 'master' into extract-celery-code
bisgaard-itis May 26, 2025
4479935
Merge branch 'master' into extract-celery-code
bisgaard-itis May 27, 2025
58e7fa1
start adding tests to celery module
bisgaard-itis May 27, 2025
c8d9b01
create fixture for creating rabbitmq rpc server
bisgaard-itis May 27, 2025
0cd3857
Merge branch 'master' into extract-celery-code
bisgaard-itis May 27, 2025
07ee77a
make sure celery tasks actually run
bisgaard-itis May 27, 2025
dcef2f1
minor changes
bisgaard-itis May 28, 2025
593c353
Merge branch 'master' into extract-celery-code
bisgaard-itis Jun 4, 2025
fc98752
upgraded celery-library requirements
bisgaard-itis Jun 4, 2025
e212495
minor fix
bisgaard-itis Jun 4, 2025
e4e85dc
Merge branch 'master' into extract-celery-code
giancarloromeo Jun 5, 2025
2c065f7
Merge branch 'master' into extract-celery-code
giancarloromeo Jun 5, 2025
f27e9ad
Revert "🐛 fix wrong project name in billing center usage view (#7798)"
bisgaard-itis Jun 5, 2025
8b2e65c
Merge branch 'extract-celery-code' of github.com:giancarloromeo/ospar…
bisgaard-itis Jun 5, 2025
384a2a1
Revert "create fixture for creating rabbitmq rpc server"
bisgaard-itis Jun 5, 2025
6021ddb
Revert "Revert "🐛 fix wrong project name in billing center usage view…
bisgaard-itis Jun 5, 2025
97a1e8b
Revert "upgraded celery-library requirements"
bisgaard-itis Jun 5, 2025
b71cbca
Revert "minor changes"
bisgaard-itis Jun 5, 2025
1202074
Revert "make sure celery tasks actually run"
bisgaard-itis Jun 5, 2025
738ad55
Revert "create fixture for creating rabbitmq rpc server"
bisgaard-itis Jun 5, 2025
2e05671
Revert "start adding tests to celery module"
bisgaard-itis Jun 5, 2025
f85f878
fix after reverts
bisgaard-itis Jun 5, 2025
abc94de
Merge branch 'master' into extract-celery-code
bisgaard-itis Jun 5, 2025
a5ebd01
Merge remote-tracking branch 'upstream/master' into extract-celery-code
giancarloromeo Jun 5, 2025
e813cdb
Merge remote-tracking branch 'upstream/master' into extract-celery-code
giancarloromeo Jun 6, 2025
f7a6279
unify interfaces
giancarloromeo Jun 6, 2025
64a0c4e
remove duplicate
giancarloromeo Jun 6, 2025
5d3425e
rename
giancarloromeo Jun 6, 2025
c01d337
Merge remote-tracking branch 'upstream/master' into extract-celery-code
giancarloromeo Jun 6, 2025
3d0bbb5
move method
giancarloromeo Jun 6, 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
3 changes: 3 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ component_management:
- component_id: pkg_aws_library
paths:
- packages/aws-library/**
- component_id: pkg_celery_library
paths:
- packages/celery-library/**
- component_id: pkg_dask_task_models_library
paths:
- packages/dask-task-models-library/**
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Makefile @pcrespov @sanderegg
/api/ @sanderegg @pcrespov @matusdrobuliak66
/ci/ @sanderegg @pcrespov
/docs/ @pcrespov
/packages/celery-library/ @giancarloromeo
/packages/common-library/ @giancarloromeo
/packages/models-library/ @sanderegg @pcrespov @matusdrobuliak66 @giancarloromeo
/packages/postgres-database/ @matusdrobuliak66
Expand Down
1 change: 1 addition & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ disable-default-queries: false

paths:
- packages/aws-library/src
- packages/celery-library/src
- packages/dask-task-models-library/src
- packages/models-library/src/models_library
- packages/postgres-database/src/simcore_postgres_database
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
# Set job outputs to values from filter step
outputs:
aws-library: ${{ steps.filter.outputs.aws-library }}
celery-library: ${{ steps.filter.outputs.celery-library }}
dask-task-models-library: ${{ steps.filter.outputs.dask-task-models-library }}
models-library: ${{ steps.filter.outputs.models-library }}
common-library: ${{ steps.filter.outputs.common-library }}
Expand Down Expand Up @@ -94,6 +95,12 @@ jobs:
- 'services/docker-compose*'
- 'scripts/mypy/*'
- 'mypy.ini'
celery-library:
- 'packages/celery-library/**'
- 'packages/pytest-simcore/**'
- 'services/docker-compose*'
- 'scripts/mypy/*'
- 'mypy.ini'
dask-task-models-library:
- 'packages/dask-task-models-library/**'
- 'packages/pytest-simcore/**'
Expand Down Expand Up @@ -1035,6 +1042,49 @@ jobs:
with:
flags: unittests #optional

unit-test-celery-library:
needs: changes
if: ${{ needs.changes.outputs.celery-library == 'true' || github.event_name == 'push' || github.event.inputs.force_all_builds == 'true' }}
timeout-minutes: 18 # if this timeout gets too small, then split the tests
name: "[unit] celery-library"
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.11"]
os: [ubuntu-24.04]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.6.x"
enable-cache: false
cache-dependency-glob: "**/celery-library/requirements/ci.txt"
- name: show system version
run: ./ci/helpers/show_system_versions.bash
- name: install
run: ./ci/github/unit-testing/celery-library.bash install
- name: typecheck
run: ./ci/github/unit-testing/celery-library.bash typecheck
- name: test
if: ${{ !cancelled() }}
run: ./ci/github/unit-testing/celery-library.bash test
- uses: codecov/codecov-action@v5
if: ${{ !cancelled() }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unittests #optional

unit-test-dask-task-models-library:
needs: changes
Expand Down Expand Up @@ -1824,6 +1874,7 @@ jobs:
unit-test-clusters-keeper,
unit-test-dask-sidecar,
unit-test-aws-library,
unit-test-celery-library,
unit-test-dask-task-models-library,
unit-test-datcore-adapter,
unit-test-director-v2,
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
"./packages/aws-library/src",
"./packages/celery-library/src",
"./packages/common-library/src",
"./packages/dask-task-models-library/src",
"./packages/models-library/src",
"./packages/postgres-database/src",
"./packages/postgres-database/tests",
Expand Down
43 changes: 43 additions & 0 deletions ci/github/unit-testing/celery-library.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't hide errors within pipes
IFS=$'\n\t'

install() {
make devenv
# shellcheck source=/dev/null
source .venv/bin/activate
pushd packages/celery-library
make install-ci
popd
uv pip list
}

test() {
# shellcheck source=/dev/null
source .venv/bin/activate
pushd packages/celery-library
make tests-ci
popd
}

typecheck() {
# shellcheck source=/dev/null
source .venv/bin/activate
uv pip install mypy
pushd packages/celery-library
make mypy
popd
}

# Check if the function exists (bash specific)
if declare -f "$1" >/dev/null; then
# call arguments verbatim
"$@"
else
# Show a helpful error
echo "'$1' is not a known function name" >&2
exit 1
fi
50 changes: 50 additions & 0 deletions packages/celery-library/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Targets for DEVELOPMENT of Celery Library
#
include ../../scripts/common.Makefile
include ../../scripts/common-package.Makefile

.PHONY: requirements
requirements: ## compiles pip requirements (.in -> .txt)
@$(MAKE_C) requirements reqs


.PHONY: install-dev install-prod install-ci
install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode
# installing in $(subst install-,,$@) mode
@uv pip sync requirements/$(subst install-,,$@).txt


.PHONY: tests tests-ci
tests: ## runs unit tests
# running unit tests
@pytest \
--asyncio-mode=auto \
--color=yes \
--cov-config=../../.coveragerc \
--cov-report=term-missing \
--cov=celery_library \
--durations=10 \
--exitfirst \
--failed-first \
--pdb \
-vv \
$(CURDIR)/tests

tests-ci: ## runs unit tests
# running unit tests
@pytest \
--asyncio-mode=auto \
--color=yes \
--cov-append \
--cov-config=../../.coveragerc \
--cov-report=term-missing \
--cov-report=xml \
--junitxml=junit.xml -o junit_family=legacy \
--cov=celery_library \
--durations=10 \
--log-date-format="%Y-%m-%d %H:%M:%S" \
--log-format="%(asctime)s %(levelname)s %(message)s" \
--verbose \
-m "not heavy_load" \
$(CURDIR)/tests
20 changes: 20 additions & 0 deletions packages/celery-library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# simcore Celery library

Provides a wrapper around Celery library [1].

## Installation

```console
make help
make install-dev
```

## Test

```console
make help
make test-dev
```


[1] https://github.com/celery/celery
1 change: 1 addition & 0 deletions packages/celery-library/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
6 changes: 6 additions & 0 deletions packages/celery-library/requirements/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Targets to pip-compile requirements
#
include ../../../requirements/base.Makefile

# Add here any extra explicit dependency: e.g. _migration.txt: _base.txt
11 changes: 11 additions & 0 deletions packages/celery-library/requirements/_base.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Specifies third-party dependencies for 'celery-library'
#
--constraint ../../../requirements/constraints.txt
--requirement ../../../packages/common-library/requirements/_base.in
--requirement ../../../packages/models-library/requirements/_base.in
--requirement ../../../packages/service-library/requirements/_base.in
--requirement ../../../packages/settings-library/requirements/_base.in

asgi_lifespan
celery[redis]
Loading
Loading