orchestrator-lso 2.3.0__py3-none-any.whl → 2.4.0__py3-none-any.whl

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.
lso/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -13,7 +13,7 @@
13
13
 
14
14
  """LSO, an API for remotely running Ansible playbooks."""
15
15
 
16
- __version__ = "2.3.0"
16
+ __version__ = "2.4.0"
17
17
 
18
18
  import logging
19
19
 
lso/app.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
lso/config.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
lso/environment.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
lso/execute.py CHANGED
@@ -1,8 +1,21 @@
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+
1
14
  """Module for handling the execution of arbitrary executables."""
2
15
 
3
16
  import subprocess # noqa: S404
4
- import uuid
5
17
  from pathlib import Path
18
+ from uuid import UUID, uuid4
6
19
 
7
20
  from pydantic import HttpUrl
8
21
 
@@ -17,12 +30,12 @@ def get_executable_path(executable_name: Path) -> Path:
17
30
  return Path(settings.EXECUTABLES_ROOT_DIR) / executable_name
18
31
 
19
32
 
20
- def run_executable_async(executable_path: Path, args: list[str], callback: HttpUrl | None) -> uuid.UUID:
33
+ def run_executable_async(executable_path: Path, args: list[str], callback: HttpUrl | None) -> UUID:
21
34
  """Dispatch the task for executing an arbitrary executable remotely.
22
35
 
23
36
  Uses a ThreadPoolExecutor (for local execution) or a Celery worker (for distributed tasks).
24
37
  """
25
- job_id = uuid.uuid4()
38
+ job_id = uuid4()
26
39
  callback_url = str(callback) if callback else None
27
40
  if settings.EXECUTOR == ExecutorType.THREADPOOL:
28
41
  executor = get_thread_pool()
lso/playbook.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -13,15 +13,22 @@
13
13
 
14
14
  """Module that gathers common API responses and data models."""
15
15
 
16
- import uuid
16
+ import logging
17
+ from collections.abc import Callable
17
18
  from pathlib import Path
18
19
  from typing import Any
20
+ from uuid import UUID, uuid4
19
21
 
22
+ import requests
23
+ from ansible_runner import Runner
20
24
  from pydantic import HttpUrl
25
+ from starlette import status
21
26
 
22
27
  from lso.config import ExecutorType, settings
23
28
  from lso.tasks import run_playbook_proc_task
24
- from lso.utils import get_thread_pool
29
+ from lso.utils import CallbackFailedError, get_thread_pool
30
+
31
+ logger = logging.getLogger(__name__)
25
32
 
26
33
 
27
34
  def get_playbook_path(playbook_name: Path) -> Path:
@@ -29,12 +36,66 @@ def get_playbook_path(playbook_name: Path) -> Path:
29
36
  return Path(settings.ANSIBLE_PLAYBOOKS_ROOT_DIR) / playbook_name
30
37
 
31
38
 
39
+ def playbook_event_handler_factory(progress: str, *, progress_is_incremental: bool) -> Callable[[dict], bool]:
40
+ """Create an event handler for Ansible playbook runs.
41
+
42
+ This is used to send incremental progress updates to the external system that called for this playbook to be run.
43
+
44
+ :param str progress: The progress URL where the external system expects to receive updates.
45
+ :param bool progress_is_incremental: Whether progress updates are sent incrementally, or only contain the latest
46
+ event data.
47
+ :return Callable[[dict], bool]]: A handler method that processes every Ansible playbook event.
48
+ """
49
+ events_stdout = []
50
+
51
+ def _playbook_event_handler(event: dict) -> bool:
52
+ if progress_is_incremental:
53
+ emit_body = event["stdout"].strip()
54
+ else:
55
+ events_stdout.append(event["stdout"].strip())
56
+ emit_body = events_stdout
57
+
58
+ requests.post(str(progress), json={"progress": emit_body}, timeout=settings.REQUEST_TIMEOUT_SEC)
59
+ return True
60
+
61
+ return _playbook_event_handler
62
+
63
+
64
+ def playbook_finished_handler_factory(callback: str, job_id: UUID) -> Callable[[Runner], None]:
65
+ """Create an event handler for finished Ansible playbook runs.
66
+
67
+ Once Ansible runner is finished, it will call the handler method created by this factory before teardown.
68
+
69
+ :param str callback: The callback URL that ansible runner should report to.
70
+ :param UUID job_id: The job ID of this playbook run, used for reporting.
71
+ :return Callable[[Runner], None]: A handler method that sends one request to the callback URL.
72
+ """
73
+
74
+ def _playbook_finished_handler(runner: Runner) -> None:
75
+ payload = {
76
+ "status": runner.status,
77
+ "job_id": str(job_id),
78
+ "output": runner.stdout.readlines(),
79
+ "return_code": int(runner.rc),
80
+ }
81
+
82
+ response = requests.post(str(callback), json=payload, timeout=settings.REQUEST_TIMEOUT_SEC)
83
+ if not (status.HTTP_200_OK <= response.status_code < status.HTTP_300_MULTIPLE_CHOICES):
84
+ msg = f"Callback failed: {response.text}, url: {callback}"
85
+ raise CallbackFailedError(msg)
86
+
87
+ return _playbook_finished_handler
88
+
89
+
32
90
  def run_playbook(
33
91
  playbook_path: Path,
34
92
  extra_vars: dict[str, Any],
35
93
  inventory: dict[str, Any] | str,
36
- callback: HttpUrl,
37
- ) -> uuid.UUID:
94
+ callback: HttpUrl | None,
95
+ progress: HttpUrl | None,
96
+ *,
97
+ progress_is_incremental: bool,
98
+ ) -> UUID:
38
99
  """Run an Ansible playbook against a specified inventory.
39
100
 
40
101
  :param Path playbook_path: Playbook to be executed.
@@ -42,19 +103,41 @@ def run_playbook(
42
103
  :param dict[str, Any] | str inventory: The inventory that the playbook is executed against.
43
104
  :param HttpUrl callback: Callback URL where the playbook should send a status update when execution is completed.
44
105
  This is used for workflow-orchestrator to continue with the next step in a workflow.
45
- :return: Result of playbook launch, this could either be successful or unsuccessful.
46
- :rtype: :class:`fastapi.responses.JSONResponse`
106
+ :return UUID: Job ID of the launched playbook.
47
107
  """
48
- job_id = uuid.uuid4()
108
+ msg = f"playbook_path: {playbook_path}"
109
+ job_id = uuid4()
110
+ callback_str = None
111
+ progress_str = None
112
+ event_handler = None
113
+ finished_callback = None
114
+
115
+ if callback:
116
+ callback_str = str(callback)
117
+ msg += f", callback URL: {callback_str}"
118
+ finished_callback = playbook_finished_handler_factory(callback_str, job_id)
119
+ if progress:
120
+ progress_str = str(progress)
121
+ msg += f", progress URL: {progress_str}"
122
+ event_handler = playbook_event_handler_factory(progress_str, progress_is_incremental=progress_is_incremental)
123
+
124
+ logger.info(msg)
125
+
49
126
  if settings.EXECUTOR == ExecutorType.THREADPOOL:
50
127
  executor = get_thread_pool()
51
128
  executor_handle = executor.submit(
52
- run_playbook_proc_task, str(job_id), str(playbook_path), extra_vars, inventory, str(callback)
129
+ run_playbook_proc_task, str(playbook_path), extra_vars, inventory, event_handler, finished_callback
53
130
  )
54
131
  if settings.TESTING:
55
132
  executor_handle.result()
56
133
 
57
134
  elif settings.EXECUTOR == ExecutorType.WORKER:
58
- run_playbook_proc_task.delay(str(job_id), str(playbook_path), extra_vars, inventory, str(callback))
135
+ run_playbook_proc_task.delay(
136
+ str(playbook_path),
137
+ extra_vars,
138
+ inventory,
139
+ event_handler,
140
+ finished_callback,
141
+ )
59
142
 
60
143
  return job_id
lso/routes/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
lso/routes/default.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
lso/routes/execute.py CHANGED
@@ -1,9 +1,22 @@
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+
1
14
  """FastAPI route for running arbitrary executables."""
2
15
 
3
16
  import asyncio
4
- import uuid
5
17
  from pathlib import Path
6
18
  from typing import Annotated
19
+ from uuid import uuid4
7
20
 
8
21
  from fastapi import APIRouter, HTTPException, status
9
22
  from pydantic import AfterValidator, BaseModel, HttpUrl
@@ -48,6 +61,6 @@ async def run_executable_endpoint(params: ExecutableRunParams) -> ExecutableRunR
48
61
  job_id = run_executable_async(params.executable_name, params.args, params.callback)
49
62
  return ExecutableRunResponse(job_id=job_id)
50
63
 
51
- job_id = uuid.uuid4()
64
+ job_id = uuid4()
52
65
  result = await asyncio.to_thread(run_executable_sync, str(params.executable_name), params.args)
53
66
  return ExecutableRunResponse(job_id=job_id, result=result)
lso/routes/playbook.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -15,11 +15,11 @@
15
15
 
16
16
  import json
17
17
  import tempfile
18
- import uuid
19
18
  from contextlib import redirect_stderr
20
19
  from io import StringIO
21
20
  from pathlib import Path
22
21
  from typing import Annotated, Any
22
+ from uuid import UUID
23
23
 
24
24
  import ansible_runner
25
25
  from ansible.inventory.manager import InventoryManager
@@ -44,7 +44,7 @@ def _inventory_validator(inventory: dict[str, Any] | str) -> dict[str, Any] | st
44
44
  """
45
45
  if not ansible_runner.utils.isinventory(inventory):
46
46
  detail = "Invalid inventory provided. Should be a string, or JSON object."
47
- raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=detail)
47
+ raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, detail=detail)
48
48
 
49
49
  loader = DataLoader()
50
50
  output = StringIO()
@@ -58,7 +58,7 @@ def _inventory_validator(inventory: dict[str, Any] | str) -> dict[str, Any] | st
58
58
  output.seek(0)
59
59
  error_messages = output.readlines()
60
60
  if error_messages:
61
- raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=error_messages)
61
+ raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, detail=error_messages)
62
62
 
63
63
  return inventory
64
64
 
@@ -79,7 +79,7 @@ PlaybookName = Annotated[Path, AfterValidator(_playbook_path_validator)]
79
79
  class PlaybookRunResponse(BaseModel):
80
80
  """PlaybookRunResponse domain model schema."""
81
81
 
82
- job_id: uuid.UUID
82
+ job_id: UUID
83
83
 
84
84
 
85
85
  class PlaybookRunParams(BaseModel):
@@ -89,7 +89,11 @@ class PlaybookRunParams(BaseModel):
89
89
  #: configuration option ``ANSIBLE_PLAYBOOKS_ROOT_DIR``.
90
90
  playbook_name: PlaybookName
91
91
  #: The address where LSO should call back to upon completion.
92
- callback: HttpUrl
92
+ callback: HttpUrl | None = None
93
+ #: Optionally, the address where LSO should send progress updates as the playbook executes.
94
+ progress: HttpUrl | None = None
95
+ #: Optionally, whether progress updates should be incremental or not.
96
+ progress_is_incremental: bool = True
93
97
  #: The inventory to run the playbook against. This inventory can also include any host vars, if needed. When
94
98
  #: including host vars, it should be a dictionary. Can be a simple string containing hostnames when no host vars are
95
99
  #: needed. In the latter case, multiple hosts should be separated with a ``\n`` newline character only.
@@ -114,6 +118,8 @@ def run_playbook_endpoint(params: PlaybookRunParams) -> PlaybookRunResponse:
114
118
  extra_vars=params.extra_vars,
115
119
  inventory=params.inventory,
116
120
  callback=params.callback,
121
+ progress=params.progress,
122
+ progress_is_incremental=params.progress_is_incremental,
117
123
  )
118
124
 
119
125
  return PlaybookRunResponse(job_id=job_id)
lso/schema.py CHANGED
@@ -13,8 +13,8 @@
13
13
 
14
14
  """Module for defining the schema for running arbitrary executables."""
15
15
 
16
- import uuid
17
16
  from enum import StrEnum
17
+ from uuid import UUID
18
18
 
19
19
  from pydantic import BaseModel, model_validator
20
20
 
@@ -46,5 +46,5 @@ class ExecutionResult(BaseModel):
46
46
  class ExecutableRunResponse(BaseModel):
47
47
  """Response for running an arbitrary executable."""
48
48
 
49
- job_id: uuid.UUID
49
+ job_id: UUID
50
50
  result: ExecutionResult | None = None
lso/tasks.py CHANGED
@@ -18,52 +18,48 @@ the results to a specified callback URL.
18
18
  """
19
19
 
20
20
  import logging
21
+ from collections.abc import Callable
21
22
  from typing import Any
22
23
  from uuid import UUID
23
24
 
24
- import ansible_runner
25
25
  import requests
26
+ from ansible_runner import Runner, run
26
27
  from starlette import status
27
28
 
28
29
  from lso.config import settings
29
30
  from lso.schema import ExecutableRunResponse
31
+ from lso.utils import CallbackFailedError
30
32
  from lso.worker import RUN_EXECUTABLE, RUN_PLAYBOOK, celery
31
33
 
32
34
  logger = logging.getLogger(__name__)
33
35
 
34
36
 
35
- class CallbackFailedError(Exception):
36
- """Exception raised when a callback url can't be reached."""
37
-
38
-
39
37
  @celery.task(name=RUN_PLAYBOOK) # type: ignore[misc]
40
38
  def run_playbook_proc_task(
41
- job_id: str, playbook_path: str, extra_vars: dict[str, Any], inventory: dict[str, Any] | str, callback: str
39
+ playbook_path: str,
40
+ extra_vars: dict[str, Any],
41
+ inventory: dict[str, Any] | str,
42
+ event_handler: Callable[[dict], bool] | None = None,
43
+ finished_callback: Callable[[Runner], None] | None = None,
42
44
  ) -> None:
43
45
  """Celery task to run a playbook.
44
46
 
45
- :param str job_id: Identifier of the job being executed.
46
47
  :param str playbook_path: Path to the playbook to be executed.
47
48
  :param dict[str, Any] extra_vars: Extra variables to pass to the playbook.
48
49
  :param dict[str, Any] | str inventory: Inventory to run the playbook against.
49
- :param HttpUrl callback: Callback URL for status updates.
50
+ :param Callable[[dict], bool] event_handler: Event handler method that is executed on every event while the playbook
51
+ runs.
52
+ :param Callable[[Runner], None] finished_callback: Callback handler method that is executed once the playbook run is
53
+ completed.
50
54
  :return: None
51
55
  """
52
- msg = f"playbook_path: {playbook_path}, callback: {callback}"
53
- logger.info(msg)
54
- ansible_playbook_run = ansible_runner.run(playbook=playbook_path, inventory=inventory, extravars=extra_vars)
55
-
56
- payload = {
57
- "status": ansible_playbook_run.status,
58
- "job_id": job_id,
59
- "output": ansible_playbook_run.stdout.readlines(),
60
- "return_code": int(ansible_playbook_run.rc),
61
- }
62
-
63
- response = requests.post(str(callback), json=payload, timeout=settings.REQUEST_TIMEOUT_SEC)
64
- if not (status.HTTP_200_OK <= response.status_code < status.HTTP_300_MULTIPLE_CHOICES):
65
- msg = f"Callback failed: {response.text}, url: {callback}"
66
- raise CallbackFailedError(msg)
56
+ run(
57
+ playbook=playbook_path,
58
+ inventory=inventory,
59
+ extravars=extra_vars,
60
+ event_handler=event_handler,
61
+ finished_callback=finished_callback,
62
+ )
67
63
 
68
64
 
69
65
  @celery.task(name=RUN_EXECUTABLE) # type: ignore[misc]
lso/utils.py CHANGED
@@ -20,6 +20,10 @@ from lso.config import settings
20
20
  _executor = None
21
21
 
22
22
 
23
+ class CallbackFailedError(Exception):
24
+ """Exception raised when a callback url can't be reached."""
25
+
26
+
23
27
  def get_thread_pool() -> ThreadPoolExecutor:
24
28
  """Initialize or return a cached ThreadPoolExecutor for local asynchronous execution."""
25
29
  global _executor # noqa: PLW0603
lso/worker.py CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 GÉANT Vereniging.
1
+ # Copyright 2023-2025 GÉANT Vereniging.
2
2
  # Licensed under the Apache License, Version 2.0 (the "License");
3
3
  # you may not use this file except in compliance with the License.
4
4
  # You may obtain a copy of the License at
@@ -1,10 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orchestrator-lso
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: LSO, an API for remotely running Ansible playbooks.
5
+ Author: GÉANT Orchestration and Automation Team
5
6
  Author-email: GÉANT Orchestration and Automation Team <goat@geant.org>
6
- Requires-Python: >=3.11,<3.14
7
- Description-Content-Type: text/markdown
8
7
  License-Expression: Apache-2.0
9
8
  Classifier: Intended Audience :: Information Technology
10
9
  Classifier: Intended Audience :: System Administrators
@@ -25,38 +24,20 @@ Classifier: Intended Audience :: Telecommunications Industry
25
24
  Classifier: Programming Language :: Python :: 3 :: Only
26
25
  Classifier: Programming Language :: Python :: 3.11
27
26
  Classifier: Programming Language :: Python :: 3.12
28
- License-File: LICENSE
29
- Requires-Dist: ansible-runner==2.4.1
27
+ Requires-Dist: ansible-runner==2.4.2
30
28
  Requires-Dist: ansible==10.7.0
31
- Requires-Dist: fastapi==0.116.1
29
+ Requires-Dist: fastapi==0.120.4
32
30
  Requires-Dist: httpx==0.28.1
33
- Requires-Dist: uvicorn[standard]==0.35.0
31
+ Requires-Dist: uvicorn[standard]==0.38.0
34
32
  Requires-Dist: requests==2.32.5
35
- Requires-Dist: pydantic-settings==2.10.1
33
+ Requires-Dist: pydantic-settings==2.11.0
36
34
  Requires-Dist: celery==5.5.3
37
35
  Requires-Dist: redis==5.3.1
38
- Requires-Dist: types-setuptools ; extra == "dev"
39
- Requires-Dist: types-requests ; extra == "dev"
40
- Requires-Dist: toml ; extra == "dev"
41
- Requires-Dist: types-toml ; extra == "dev"
42
- Requires-Dist: mypy_extensions ; extra == "dev"
43
- Requires-Dist: pre-commit ; extra == "dev"
44
- Requires-Dist: sphinx ; extra == "doc"
45
- Requires-Dist: sphinx-rtd-theme ; extra == "doc"
46
- Requires-Dist: docutils ; extra == "doc"
47
- Requires-Dist: pytest ; extra == "test"
48
- Requires-Dist: pytest-cov ; extra == "test"
49
- Requires-Dist: Faker ; extra == "test"
50
- Requires-Dist: responses ; extra == "test"
51
- Requires-Dist: mypy ; extra == "test"
52
- Requires-Dist: ruff ; extra == "test"
53
- Requires-Dist: jsonschema ; extra == "test"
54
- Requires-Dist: starlette ; extra == "test"
55
- Project-URL: Documentation, https://workfloworchestrator.org/lso/
36
+ Requires-Python: >=3.11, <3.14
37
+ Project-URL: Documentation, https://docs.gap.geant.org
38
+ Project-URL: Homepage, https://workfloworchestrator.org/lso/
56
39
  Project-URL: Source, https://github.com/workfloworchestrator/lso
57
- Provides-Extra: dev
58
- Provides-Extra: doc
59
- Provides-Extra: test
40
+ Description-Content-Type: text/markdown
60
41
 
61
42
  ![Lightweight Service Orchestrator](./docs/LSO_banner.jpg)
62
43
  [![Supported python versions](https://img.shields.io/pypi/pyversions/orchestrator-lso.svg?color=%2334D058)](https://pypi.org/project/orchestrator-lso)
@@ -65,10 +46,6 @@ Provides-Extra: test
65
46
 
66
47
  LSO: an API that allows for remotely executing Ansible playbooks.
67
48
 
68
- ## Code documentation
69
-
70
- Code documentation can be found at <https://workfloworchestrator.org/lso>
71
-
72
49
  ## Quick start
73
50
 
74
51
  This is a quick setup guide for running on your local machine.
@@ -104,7 +81,6 @@ This will expose the API on port 8000. The container requires some more files to
104
81
 
105
82
  ### Install the module
106
83
 
107
-
108
84
  As an alternative, below are a set of instructions for installing and running LSO directly on a machine.
109
85
 
110
86
  *One of these should be what you're looking for:*
@@ -112,24 +88,18 @@ As an alternative, below are a set of instructions for installing and running LS
112
88
  * Install the latest release
113
89
 
114
90
  ```bash
115
- python3 -m venv my-venv-directory
116
- . my-venv-directory/bin/activate
117
-
118
- pip install orchestrator-lso
91
+ uv venv --python 3.12
92
+ uv add orchestrator-lso
119
93
  ```
120
94
 
121
95
  * Install the source code
122
96
 
123
97
  ```bash
124
98
  git clone https://github.com/workfloworchestrator/lso.git && cd lso
125
- python3 -m venv my-venv-directory
126
- . my-venv-directory/bin/activate
99
+ uv venv --python 3.12
100
+ . .venv/bin/activate
127
101
 
128
- pip install flit
129
- flit install --deps production
130
-
131
- # Or, for the full development environment
132
- flit install --deps develop
102
+ uv sync --all-extras --dev
133
103
  ```
134
104
 
135
105
  ### Running the app
@@ -161,3 +131,18 @@ celery -A lso.worker worker --loglevel=info -Q lso-worker-queue
161
131
  2. ThreadPoolExecutor (Local Execution)
162
132
 
163
133
  For local concurrent tasks, set `EXECUTOR=threadpool` and configure `MAX_THREAD_POOL_WORKERS`.
134
+
135
+ ## Contributing
136
+
137
+ We use [uv](https://docs.astral.sh/uv/getting-started/installation/) to manage dependencies.
138
+
139
+ To get started, run:
140
+
141
+ ```
142
+ uv sync --all-extras --dev
143
+ pre-commit install
144
+ ```
145
+
146
+ ## Code documentation
147
+
148
+ Code documentation can be found at <https://workfloworchestrator.org/lso>
@@ -0,0 +1,17 @@
1
+ lso/__init__.py,sha256=uZ6rBsNmtFc11EZl1eag4GsGhtFpLCDEzdzO4GH-H5o,1589
2
+ lso/app.py,sha256=PCdL4hY5i1fho_pMSiNAHuaIKWPgfQNyePsZ-LdasCg,775
3
+ lso/config.py,sha256=tyxjq67EJLEMLmpIlkxrtwJ3arm8ZUBNGkj9NTsBJxw,1639
4
+ lso/environment.py,sha256=4k8a8cSLwgLjBIU-XUa7Y6Clns2VjmsBkiKvkzK2Pp4,1771
5
+ lso/execute.py,sha256=T-HL9Q86vGU5VunjP7mjokRYvaVs0EnkSOFXZUT_GJE,2731
6
+ lso/playbook.py,sha256=-WcL-kFXaBqSnvA4XlS7r0Rga8b05g5Ynk9VewTa3kQ,5500
7
+ lso/routes/__init__.py,sha256=l2hfxU8DF_bhbZ4GQ24VzcLjlZMfVSjUNBWSk1beEPw,639
8
+ lso/routes/default.py,sha256=ScSrDFjbGqjcjeOodMTKZUMzZqXZ0zC6L-I9hrP0dqk,1438
9
+ lso/routes/execute.py,sha256=nDmilV2THCnPzAIHGUjYBuETrL0QeOQSUC7z5M3EaMA,2713
10
+ lso/routes/playbook.py,sha256=9ughP7zqnqRpBV31KQbTMoJdfgzF0qyjxiXw1l3TlUE,5270
11
+ lso/schema.py,sha256=Xp4D7FRc21Mhh-1xlp0EbjTvdu5kGEHRpQvQp6ic6ro,1518
12
+ lso/tasks.py,sha256=Ddj5smLkbafpdBbS3_fbz-stX72Zy3-jqODuyV5QhGc,3847
13
+ lso/utils.py,sha256=Ml2JCHdy9BPJ4ItjYhx5z3lHwKQiJ9JzMySktrRzo_Q,1148
14
+ lso/worker.py,sha256=ZAXii3EctILrpnHInvVMTyjOs_40gqR_VybVLBzGRw4,1727
15
+ orchestrator_lso-2.4.0.dist-info/WHEEL,sha256=5w2T7AS2mz1-rW9CNagNYWRCaB0iQqBMYLwKdlgiR4Q,78
16
+ orchestrator_lso-2.4.0.dist-info/METADATA,sha256=xPixjYkEuCEDtHbOpFsGm5TuzCLSuLKRewrcL8rKGDQ,5621
17
+ orchestrator_lso-2.4.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.12.0
2
+ Generator: uv 0.9.7
3
3
  Root-Is-Purelib: true
4
- Tag: py3-none-any
4
+ Tag: py3-none-any
@@ -1,18 +0,0 @@
1
- lso/__init__.py,sha256=uPb7ce2aFPEFj5_WAwySf0NBvCf4MMyGz1R3VeWwQXI,1589
2
- lso/app.py,sha256=WDtlmjELIeFA437j-WPfqBQf6QT_l35LEABbEosHlqY,775
3
- lso/config.py,sha256=fceYs85UGN76GRyGs4x6TiKhktv-ykjc6-WocPRmFGY,1639
4
- lso/environment.py,sha256=iZ3DmsSKAC5a7VNL-HfJOJZ0sQwUMf7ZzNGC34B2CG0,1771
5
- lso/execute.py,sha256=G1AacmmN46mAzPWpnoI31RhXoWN6WEZUFr_P8Z_9Ngw,2139
6
- lso/playbook.py,sha256=NHCeVttY5u1xGAdty954SZEYLcZEGBbBfjPuvBCgUwI,2409
7
- lso/schema.py,sha256=-QCBaUcfMH1MaEEDaGzZoGJn-NcQLbH4dfrLxFYoXXs,1513
8
- lso/tasks.py,sha256=tM26bAiEviaKAVwiHkKr6od3N00covBAAXTFVxIvdY8,4030
9
- lso/utils.py,sha256=eVKyYRtdu_yPkbUQqDJlCKlCPAgc0dFxG1E1kY2Qsao,1043
10
- lso/worker.py,sha256=61TXUefv8mGMq9LsD419r0O9Qxpa-WAtgSfu7SPEg44,1727
11
- lso/routes/__init__.py,sha256=1kRrth9zkFgmj6LChujieYJq5cjIETeTGXa1G70pduk,639
12
- lso/routes/default.py,sha256=a7STN1BJyFVizXUzmqKuADO0fpE1SHun-PzaZ-jx1wU,1438
13
- lso/routes/execute.py,sha256=zwObIRB2aSlCikpmHQ6TJFcZFCjEPFC4R7oIu1UA7R8,2122
14
- lso/routes/playbook.py,sha256=YNPZGuJXh5JkDWJ-sVRVE-cTg9eEm6BPjNThFLDqxeM,4904
15
- orchestrator_lso-2.3.0.dist-info/licenses/LICENSE,sha256=CgFXf7XbZXJADozQIw2uUmmvU-zwAwXo4u7cgDfx3rE,10744
16
- orchestrator_lso-2.3.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
17
- orchestrator_lso-2.3.0.dist-info/METADATA,sha256=9W-z5F57L_hvIb0GqJaML1piONiGfns5cqaRmFckcQo,6320
18
- orchestrator_lso-2.3.0.dist-info/RECORD,,
@@ -1,202 +0,0 @@
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 [2023-2024] [GÉANT Vereniging]
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.