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

Revert "Delete all Mesos-using code (+ misc. cleanups) (#215)" #216

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,24 @@ else
BUILD_ENV?=$(shell hostname -f)
endif

.PHONY: venv
venv:
tox -e venv

.PHONY: test
test:
tox

.PHONY: tox_%
tox_%:
tox -e $*

.PHONY: docs
itest:
tox -e integration

docs:
tox -e docs

.PHONY: pypi
pypi:
tox -e pypi

.PHONY: clean
clean:
rm -rf docs/build
find . -name '*.pyc' -delete
Expand Down
64 changes: 61 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,47 @@ Interfaces and shared infrastructure for generic task processing (also known as

### Pre-requisites

+ [Docker](https://www.docker.com/get-docker)
+ [Python 3.8](https://www.python.org/downloads/)
+ [Virtualenv](https://virtualenv.pypa.io/en/stable/installation/)

### Running examples

[hello-world.py](/examples/hello-world/py) is a very simple annotated example that launches a task to echo `hello world`. From the root of the repository, run:

docker-compose -f examples/cluster/docker-compose.yaml \
run playground examples/hello-world.py

This will bring up a single master, single agent Mesos cluster using [Docker Compose](https://docs.docker.com/compose/) and launch a single task which will print "hello world" to the sandbox's stdout before terminating.

Other examples available include:
+ async.py
Example of the [async](#async) task runner.

+ dynamo_persistence.py
Example that shows how task events may be persisted to [DynamoDB](https://aws.amazon.com/dynamodb) using the `stateful` plugin.

+ file_persistence.py
Example that shows how task events may be persisted to disk using the `stateful` plugin.

+ promise.py
Example that shows how the [promise/future](#Promise/Future) task runner (not yet implemented) may be used.

+ subscription.py
Example of the [subscription](#subscription) task runner.

+ sync.py
Brief example using the [sync](#sync) task runner.

+ timeout.py
Example that shows how to timeout a task execution using the `timeout` plugin.

+ retry.py
Example that shows how to retry a task on failure using the `retry` plugin.

+ task_logging.py
Example that shows how to fetch task logs from Mesos agents using the `logging` plugin.

### Running tests

From the root of the repository, run:
Expand All @@ -27,10 +65,30 @@ From the root of the repository, run:

### /plugins

Plugins can be chained to create a task execution pipeline with more than one property.
Plugins can be chained to create a task execution pipeline with more than one property. Please refer to persistence/retry/timeout examples.

#### mesos
Implements all required interfaces to talk to Mesos deployment. This plugin uses [PyMesos](https://github.com/douban/pymesos) to communicate with Mesos.

#### timeout
Implements an executor to timeout task execution.

#### retrying
Implements an executor to retry task execution upon failure.

#### logging
Implements an executor to retrieve task logs from Mesos agents. Note that it has to be the immediate upstream executor of the mesos executor.

##### Configuration options

- authentication\_principal Mesos principal
- credential\_secret\_file path to file containing Mesos secret
- mesos\_address host:port to connect to Mesos cluster
- event_translator a fucntion that maps Mesos-specific events to `Event` objects

#### stateful

#### Kubernetes
Implements all required interfaces to talk to Kubernetes. This plugin uses [kubernetes-client](https://github.com/kubernetes-client/python) to communicate with Kubernetes.
TODO: documentation

### /runners

Expand Down
10 changes: 5 additions & 5 deletions docs/source/generated/task_processing.interfaces.event.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task\_processing.interfaces.event module
========================================
task\_processing\.interfaces\.event module
==========================================

.. automodule:: task_processing.interfaces.event
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

This file was deleted.

12 changes: 5 additions & 7 deletions docs/source/generated/task_processing.interfaces.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
task\_processing.interfaces package
===================================
task\_processing\.interfaces package
====================================

Submodules
----------

.. toctree::
:maxdepth: 4

task_processing.interfaces.event
task_processing.interfaces.persistence
task_processing.interfaces.runner
task_processing.interfaces.task_executor

Module contents
---------------

.. automodule:: task_processing.interfaces
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
10 changes: 5 additions & 5 deletions docs/source/generated/task_processing.interfaces.runner.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task\_processing.interfaces.runner module
=========================================
task\_processing\.interfaces\.runner module
===========================================

.. automodule:: task_processing.interfaces.runner
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task\_processing.interfaces.task\_executor module
=================================================
task\_processing\.interfaces\.task\_executor module
===================================================

.. automodule:: task_processing.interfaces.task_executor
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 0 additions & 7 deletions docs/source/generated/task_processing.metrics.rst

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions docs/source/generated/task_processing.plugins.kubernetes.rst

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
task\_processing\.plugins\.mesos\.execution\_framework module
=============================================================

.. automodule:: task_processing.plugins.mesos.execution_framework
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
task\_processing\.plugins\.mesos\.mesos\_executor module
========================================================

.. automodule:: task_processing.plugins.mesos.mesos_executor
:members:
:undoc-members:
:show-inheritance:
19 changes: 19 additions & 0 deletions docs/source/generated/task_processing.plugins.mesos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
task\_processing\.plugins\.mesos package
========================================

Submodules
----------

.. toctree::

task_processing.plugins.mesos.execution_framework
task_processing.plugins.mesos.mesos_executor
task_processing.plugins.mesos.translator

Module contents
---------------

.. automodule:: task_processing.plugins.mesos
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
task\_processing\.plugins\.mesos\.translator module
===================================================

.. automodule:: task_processing.plugins.mesos.translator
:members:
:undoc-members:
:show-inheritance:
13 changes: 6 additions & 7 deletions docs/source/generated/task_processing.plugins.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
task\_processing.plugins package
================================
task\_processing\.plugins package
=================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

task_processing.plugins.kubernetes
task_processing.plugins.mesos

Module contents
---------------

.. automodule:: task_processing.plugins
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
23 changes: 6 additions & 17 deletions docs/source/generated/task_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,15 @@ Subpackages
-----------

.. toctree::
:maxdepth: 4

task_processing.interfaces
task_processing.plugins
task_processing.runners

Submodules
----------

.. toctree::
:maxdepth: 4

task_processing.metrics
task_processing.task_processor
task_processing.utils
task_processing.interfaces
task_processing.plugins
task_processing.runners

Module contents
---------------

.. automodule:: task_processing
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/generated/task_processing.runners.async.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
task\_processing\.runners\.async module
=======================================

.. automodule:: task_processing.runners.async
:members:
:undoc-members:
:show-inheritance:

This file was deleted.

10 changes: 5 additions & 5 deletions docs/source/generated/task_processing.runners.promise.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
task\_processing.runners.promise module
=======================================
task\_processing\.runners\.promise module
=========================================

.. automodule:: task_processing.runners.promise
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
Loading
Loading