orchestrator-cookiecutter 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orchestrator_cookiecutter-0.0.1/.gitignore +14 -0
- orchestrator_cookiecutter-0.0.1/LICENSE +202 -0
- orchestrator_cookiecutter-0.0.1/PKG-INFO +57 -0
- orchestrator_cookiecutter-0.0.1/README.md +34 -0
- orchestrator_cookiecutter-0.0.1/cookiecutter.json +16 -0
- orchestrator_cookiecutter-0.0.1/hooks/post_gen_project.py +112 -0
- orchestrator_cookiecutter-0.0.1/hooks/pre_gen_project.py +35 -0
- orchestrator_cookiecutter-0.0.1/orchestrator/cookiecutter/__init__.py +15 -0
- orchestrator_cookiecutter-0.0.1/orchestrator/cookiecutter/cli.py +54 -0
- orchestrator_cookiecutter-0.0.1/pyproject.toml +60 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/.gitignore +14 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/.pre-commit-config.yaml +46 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/.python-version +1 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/LICENSE +204 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/README.md +71 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/docker-compose.yml +37 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/pyproject.toml +176 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/__init__.py +4 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/conftest.py +566 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/fixtures/__init__.py +19 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/domain/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/domain/product_types/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/services/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/test_app.py +23 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/utils/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/workflows/__init__.py +260 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/test/unit_tests/workflows/my_product/__init__.py +15 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/__init__.py +58 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/celery_worker.py +34 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/main.py +25 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/products/__init__.py +46 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/products/product_blocks/__init__.py +14 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/products/product_types/__init__.py +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/services/__init__.py +15 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/translations/en-GB.json +13 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/utils/__init__.py +15 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/workflows/__init__.py +44 -0
- orchestrator_cookiecutter-0.0.1/{{ cookiecutter.package_name }}/{{ cookiecutter.project_slug }}/wsgi.py +22 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
Copyright [yyyy] [name of copyright owner]
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
# Copyright 1998 ACME INC.
|
|
191
|
+
#
|
|
192
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
# you may not use this file except in compliance with the License.
|
|
194
|
+
# You may obtain a copy of the License at
|
|
195
|
+
#
|
|
196
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
#
|
|
198
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
# See the License for the specific language governing permissions and
|
|
202
|
+
# limitations under the License.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: orchestrator-cookiecutter
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A Cookiecutter template for setting up an implementation of Workflow Orchestrator
|
|
5
|
+
Project-URL: Source, https://github.com/workfloworchestrator/orchestrator-cookiecutter
|
|
6
|
+
Project-URL: Homepage, https://workfloworchestrator.org
|
|
7
|
+
Project-URL: Documentation, https://workfloworchestrator.org
|
|
8
|
+
Author-email: GÉANT Orchestration and Automation Team <goat@geant.org>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development
|
|
19
|
+
Requires-Python: <3.15,>=3.12
|
|
20
|
+
Requires-Dist: cookiecutter==2.7.1
|
|
21
|
+
Requires-Dist: typer==0.27.0
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# Workflow Orchestrator Cookiecutter Template
|
|
25
|
+
|
|
26
|
+
A [Cookiecutter](https://github.com/cookiecutter/cookiecutter) template repository for creating an implementation of
|
|
27
|
+
the Workflow Orchestrator.
|
|
28
|
+
|
|
29
|
+
## What You Get
|
|
30
|
+
|
|
31
|
+
This cookiecutter template includes the following tools to help you get started to implement your own Workflow
|
|
32
|
+
Orchestrator.
|
|
33
|
+
|
|
34
|
+
- `uv` as package manager
|
|
35
|
+
- `ruff` as Python linter and formatter
|
|
36
|
+
- `mypy` as type checker
|
|
37
|
+
- `pre-commit` hooks wired up to run linting, formatting and type checking
|
|
38
|
+
- `pytest` as unit testing framework, with boilerplate code for test cases
|
|
39
|
+
- A choice of `Threadpool` or `Celery` as task executor
|
|
40
|
+
- A GraphQL API registered alongside the REST API out of the box
|
|
41
|
+
- An optional `docker-compose.yml` to run Postgres (and Redis, when using Celery) locally
|
|
42
|
+
|
|
43
|
+
## Quickstart
|
|
44
|
+
|
|
45
|
+
[Install `uv`](https://docs.astral.sh/uv/getting-started/installation/) and run:
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
uvx orchestrator-cookiecutter
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This will take you through the generation of a boilerplate project for Workflow Orchestrator.
|
|
52
|
+
|
|
53
|
+
for development use:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
uv run cookiecutter .
|
|
57
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Workflow Orchestrator Cookiecutter Template
|
|
2
|
+
|
|
3
|
+
A [Cookiecutter](https://github.com/cookiecutter/cookiecutter) template repository for creating an implementation of
|
|
4
|
+
the Workflow Orchestrator.
|
|
5
|
+
|
|
6
|
+
## What You Get
|
|
7
|
+
|
|
8
|
+
This cookiecutter template includes the following tools to help you get started to implement your own Workflow
|
|
9
|
+
Orchestrator.
|
|
10
|
+
|
|
11
|
+
- `uv` as package manager
|
|
12
|
+
- `ruff` as Python linter and formatter
|
|
13
|
+
- `mypy` as type checker
|
|
14
|
+
- `pre-commit` hooks wired up to run linting, formatting and type checking
|
|
15
|
+
- `pytest` as unit testing framework, with boilerplate code for test cases
|
|
16
|
+
- A choice of `Threadpool` or `Celery` as task executor
|
|
17
|
+
- A GraphQL API registered alongside the REST API out of the box
|
|
18
|
+
- An optional `docker-compose.yml` to run Postgres (and Redis, when using Celery) locally
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
[Install `uv`](https://docs.astral.sh/uv/getting-started/installation/) and run:
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
uvx orchestrator-cookiecutter
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This will take you through the generation of a boilerplate project for Workflow Orchestrator.
|
|
29
|
+
|
|
30
|
+
for development use:
|
|
31
|
+
|
|
32
|
+
```shell
|
|
33
|
+
uv run cookiecutter .
|
|
34
|
+
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project_name": "My Orchestrator",
|
|
3
|
+
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '_') }}",
|
|
4
|
+
"package_name": "{{ cookiecutter.project_name.lower().replace(' ', '-') }}",
|
|
5
|
+
"description": "A Workflow Orchestrator implementation for {{ cookiecutter.project_name }}.",
|
|
6
|
+
"author": "ACME inc.",
|
|
7
|
+
"author_email": "devnull@example.com",
|
|
8
|
+
"executor": ["Threadpool", "Celery"],
|
|
9
|
+
"use_docker": ["yes", "no"],
|
|
10
|
+
"__prompts__": {
|
|
11
|
+
"description": "A short description of your Orchestrator implementation.",
|
|
12
|
+
"author_email": "The e-mail address of the author, used in pyproject.toml.",
|
|
13
|
+
"executor": "What task executor should your Orchestrator use?\n\tChoose \"Threadpool\" if you just want to try things out.\n\tEventually, it is recommended to choose \"Celery\" for production.\n\tMore info on this topic can be found in the documentation at https://workfloworchestrator.org/orchestrator-core/guides/scaling/",
|
|
14
|
+
"use_docker": "Generate a docker-compose.yml with the services (Postgres, and Redis if using Celery) needed for local development?"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Copyright 2026 GÉANT
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import subprocess
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
#: We add `VIRTUAL_ENV` to the environment to prevent a UV warning from popping up.
|
|
20
|
+
UV_ENV = os.environ | {"VIRTUAL_ENV": "{{ cookiecutter._output_dir }}/{{ cookiecutter.package_name }}/.venv"}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def prune_unused_files() -> None:
|
|
24
|
+
"""Delete files that were generated for a wizard choice the user didn't make.
|
|
25
|
+
|
|
26
|
+
Cookiecutter has no native way to skip generating a single file based on a variable, so the
|
|
27
|
+
standard pattern is to generate it unconditionally and remove it here.
|
|
28
|
+
"""
|
|
29
|
+
if "{{ cookiecutter.executor }}" != "Celery":
|
|
30
|
+
Path("{{ cookiecutter.project_slug }}/celery_worker.py").unlink(missing_ok=True)
|
|
31
|
+
|
|
32
|
+
if "{{ cookiecutter.use_docker }}" != "yes":
|
|
33
|
+
Path("docker-compose.yml").unlink(missing_ok=True)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def run_uv_sync() -> None:
|
|
37
|
+
print("\n" * 2, "=" * 10, " Installing dependencies ", "=" * 10, "\n" * 2)
|
|
38
|
+
subprocess.run(["uv", "venv"], check=True, env=UV_ENV)
|
|
39
|
+
subprocess.run(["uv", "sync", "--all-groups", "--all-extras"], check=True, env=UV_ENV)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def install_pre_commit() -> None:
|
|
43
|
+
print("\n" * 2, "=" * 10, " Initialising git repo ", "=" * 10, "\n" * 2)
|
|
44
|
+
subprocess.run(["git", "init"], check=True)
|
|
45
|
+
|
|
46
|
+
print("\n" * 2, "=" * 10, " Installing git pre-commit hooks ", "=" * 10, "\n" * 2)
|
|
47
|
+
subprocess.run(["uv", "run", "pre-commit", "install"], check=True, env=UV_ENV)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def run_db_init() -> None:
|
|
51
|
+
print("\n" * 2, "=" * 10, " Initializing DB migration files ", "=" * 10, "\n" * 2)
|
|
52
|
+
subprocess.run(
|
|
53
|
+
["uv", "run", "main.py", "db", "init"], cwd="{{ cookiecutter.project_slug }}", check=True, env=UV_ENV
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def print_next_steps() -> None:
|
|
58
|
+
print("""
|
|
59
|
+
========== Completed cookiecutter install ===========
|
|
60
|
+
|
|
61
|
+
You now have a minimal but functional Orchestrator implementation!
|
|
62
|
+
|
|
63
|
+
To interact with it, use the following commands:
|
|
64
|
+
|
|
65
|
+
# Activate the Python runtime in the generated project
|
|
66
|
+
cd {{ cookiecutter._output_dir }}/{{ cookiecutter.package_name }}
|
|
67
|
+
source .venv/bin/activate
|
|
68
|
+
|
|
69
|
+
# Start the API (note: you will need a database setup for the calls to work, see next steps)
|
|
70
|
+
uvicorn --reload --host 127.0.0.1 --port 8080 {{ cookiecutter.project_slug }}.wsgi:app
|
|
71
|
+
|
|
72
|
+
# Access the CLI
|
|
73
|
+
python {{ cookiecutter.project_slug }}/main.py --help
|
|
74
|
+
|
|
75
|
+
============= Next steps =============
|
|
76
|
+
|
|
77
|
+
1. Setup the database
|
|
78
|
+
{%- if cookiecutter.use_docker == "yes" %}
|
|
79
|
+
|
|
80
|
+
Start the local docker-compose.yml services (this already creates the database orchestrator-core
|
|
81
|
+
expects by default, so no DATABASE_URI export is needed):
|
|
82
|
+
|
|
83
|
+
docker compose up --detach
|
|
84
|
+
|
|
85
|
+
Create the schema:
|
|
86
|
+
|
|
87
|
+
uv run main.py db upgrade heads
|
|
88
|
+
|
|
89
|
+
# Stop the databases and remove their volumes
|
|
90
|
+
docker compose down --volumes
|
|
91
|
+
{%- else %}
|
|
92
|
+
|
|
93
|
+
Point the app at your own PostgreSQL database, then create the schema:
|
|
94
|
+
|
|
95
|
+
export DATABASE_URI=postgresql+psycopg://<user>:<password>@<host>:<port>/<database>
|
|
96
|
+
uv run main.py db upgrade heads
|
|
97
|
+
|
|
98
|
+
See https://workfloworchestrator.org/orchestrator-core/getting-started/base/ for more on setting up a database.
|
|
99
|
+
{%- endif %}
|
|
100
|
+
|
|
101
|
+
2. Generate a product
|
|
102
|
+
|
|
103
|
+
(some basic instructions here, preferably directing the user to documentation)
|
|
104
|
+
""")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
if __name__ == "__main__":
|
|
108
|
+
prune_unused_files()
|
|
109
|
+
run_uv_sync()
|
|
110
|
+
install_pre_commit()
|
|
111
|
+
run_db_init()
|
|
112
|
+
print_next_steps()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright (c) 2025 Audrey M. Roy Greenfeld
|
|
2
|
+
#
|
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
# furnished to do so, subject to the following conditions:
|
|
9
|
+
#
|
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
# copies or substantial portions of the Software.
|
|
12
|
+
#
|
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
# SOFTWARE.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
import re
|
|
23
|
+
import sys
|
|
24
|
+
|
|
25
|
+
MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
|
|
26
|
+
|
|
27
|
+
module_name = "{{ cookiecutter.project_slug }}"
|
|
28
|
+
|
|
29
|
+
if not re.match(MODULE_REGEX, module_name):
|
|
30
|
+
print(
|
|
31
|
+
f"ERROR: The project slug ({module_name}) is not a valid Python module name. "
|
|
32
|
+
"Please do not use a - and use _ instead"
|
|
33
|
+
)
|
|
34
|
+
# Exit to cancel project
|
|
35
|
+
sys.exit(1)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright 2026 GÉANT
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""A Cookiecutter template for an implementation of Workflow Orchestrator."""
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Copyright (c) 2025 Audrey M. Roy Greenfeld
|
|
2
|
+
# Copyright (c) 2026 GÉANT Orchestration and Automation Team
|
|
3
|
+
#
|
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
# furnished to do so, subject to the following conditions:
|
|
10
|
+
#
|
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
# copies or substantial portions of the Software.
|
|
13
|
+
#
|
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
# SOFTWARE.
|
|
21
|
+
|
|
22
|
+
"""CLI for orchestrator-cookiecutter.
|
|
23
|
+
|
|
24
|
+
Usage:
|
|
25
|
+
`uvx orchestrator-cookiecutter` will default to the current directory.
|
|
26
|
+
`uvx orchestrator-cookiecutter /path/to/output` to point to a different output directory.
|
|
27
|
+
`uvx orchestrator-cookiecutter --no-input` to use default values for everything.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
from typing import Annotated
|
|
32
|
+
|
|
33
|
+
import typer
|
|
34
|
+
|
|
35
|
+
from cookiecutter.main import cookiecutter
|
|
36
|
+
|
|
37
|
+
app = typer.Typer(help="Generate a Python package from the orchestrator-cookiecutter template.", add_completion=False)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@app.command(context_settings={"allow_extra_args": False})
|
|
41
|
+
def main(
|
|
42
|
+
output_dir: Annotated[Path, typer.Argument(help="Where to output the generated project")] = Path.cwd(), # noqa: B008
|
|
43
|
+
no_input: bool = typer.Option(False, "--no-input", help="Do not prompt for parameters, use defaults"),
|
|
44
|
+
) -> None:
|
|
45
|
+
"""Generate a new Python package from the orchestrator-cookiecutter template."""
|
|
46
|
+
# Template is bundled inside the package (see [tool.hatch.build.targets.wheel.force-include])
|
|
47
|
+
template_dir = Path(__file__).parent / "template"
|
|
48
|
+
|
|
49
|
+
# Run cookiecutter with the bundled template
|
|
50
|
+
cookiecutter(str(template_dir), output_dir=str(output_dir), no_input=no_input)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == "__main__":
|
|
54
|
+
app()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "orchestrator-cookiecutter"
|
|
3
|
+
description = "A Cookiecutter template for setting up an implementation of Workflow Orchestrator"
|
|
4
|
+
version = "0.0.1"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "GÉANT Orchestration and Automation Team", email = "goat@geant.org" }
|
|
10
|
+
]
|
|
11
|
+
requires-python = ">=3.12,<3.15"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"cookiecutter==2.7.1",
|
|
14
|
+
"typer==0.27.0",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Natural Language :: English",
|
|
21
|
+
"Programming Language :: Python",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Software Development",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Source = "https://github.com/workfloworchestrator/orchestrator-cookiecutter"
|
|
29
|
+
Homepage = "https://workfloworchestrator.org"
|
|
30
|
+
Documentation = "https://workfloworchestrator.org"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
orchestrator-cookiecutter = "orchestrator.cookiecutter.cli:app"
|
|
34
|
+
|
|
35
|
+
[build-system]
|
|
36
|
+
requires = ["hatchling"]
|
|
37
|
+
build-backend = "hatchling.build"
|
|
38
|
+
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
target-version = "py313"
|
|
41
|
+
line-length = 120
|
|
42
|
+
|
|
43
|
+
[tool.uv]
|
|
44
|
+
prerelease = "if-necessary"
|
|
45
|
+
|
|
46
|
+
[tool.hatch.build.targets.sdist]
|
|
47
|
+
include = [
|
|
48
|
+
"orchestrator/",
|
|
49
|
+
"cookiecutter.json",
|
|
50
|
+
"hooks/",
|
|
51
|
+
"{{ cookiecutter.package_name }}/",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[tool.hatch.build.targets.wheel]
|
|
55
|
+
packages = ["orchestrator"]
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
58
|
+
"cookiecutter.json" = "orchestrator/cookiecutter/template/cookiecutter.json"
|
|
59
|
+
"hooks" = "orchestrator/cookiecutter/template/hooks"
|
|
60
|
+
"{{ cookiecutter.package_name }}" = "orchestrator/cookiecutter/template/{{ cookiecutter.package_name }}"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
default_language_version:
|
|
2
|
+
python: python3
|
|
3
|
+
repos:
|
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
+
rev: v6.0.0
|
|
6
|
+
hooks:
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
name: Fix trailing whitespace
|
|
9
|
+
- id: end-of-file-fixer
|
|
10
|
+
name: Fix end of file newlines
|
|
11
|
+
- id: mixed-line-ending
|
|
12
|
+
name: Fix mixed line endings
|
|
13
|
+
- id: check-ast
|
|
14
|
+
name: Check Python syntax
|
|
15
|
+
- id: check-merge-conflict
|
|
16
|
+
name: Check for merge conflicts
|
|
17
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
18
|
+
# uv version.
|
|
19
|
+
rev: 0.11.17
|
|
20
|
+
hooks:
|
|
21
|
+
# Update the uv lockfile
|
|
22
|
+
- id: uv-lock
|
|
23
|
+
name: Check uv lockfile is up-to-date
|
|
24
|
+
files: ^uv\.lock$
|
|
25
|
+
always_run: true
|
|
26
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
27
|
+
# Ruff version.
|
|
28
|
+
rev: v0.15.14
|
|
29
|
+
hooks:
|
|
30
|
+
# Run the linter.
|
|
31
|
+
- id: ruff-check
|
|
32
|
+
name: Check linting
|
|
33
|
+
args:
|
|
34
|
+
- --respect-gitignore
|
|
35
|
+
# Run the formatter.
|
|
36
|
+
- id: ruff-format
|
|
37
|
+
name: Check formatting
|
|
38
|
+
args:
|
|
39
|
+
- --respect-gitignore
|
|
40
|
+
- repo: local
|
|
41
|
+
hooks:
|
|
42
|
+
- id: mypy-check
|
|
43
|
+
name: Check types
|
|
44
|
+
entry: uv run mypy {{ cookiecutter.project_slug }} test
|
|
45
|
+
language: system
|
|
46
|
+
pass_filenames: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|