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

Auth update #2

Merged
merged 16 commits into from
Jul 15, 2024
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,33 @@

# k8s-job-scheduler

> Add a short description here!
A package for managing Kubernetes jobs and cron jobs from Python. It allows running CLI scripts and Python function within native Kubernetes job engine.

A longer description of your project goes here...
## Installation

```python
pip install k8s-job-scheduler
```

<!-- pyscaffold-notes -->
## Getting Started

## Note
```commandline
from k8s_job_scheduler import JobManager

This project has been set up using PyScaffold 4.5. For details and usage
information on PyScaffold see https://pyscaffold.org/.
def add(a, b):
return a + b

manager = JobManager(docker_image="python:3.11.1-slim-bullseye")
job = manager.create_job(add, 1, 2)

```

This example will create a Kubernetes job and run the function `add` with arguments 1 and 2 inside Python Docker container.


## Other Prerequisites

### Executing Python functions withing Kubernetes containers

* Docker images should include Python interpreter and all the dependencies required to execute the function.
* `dill` package is used to send the execution function and it's arguments when Docker container is created. If you wish to use standard Python Docker images or custom images which does not have `dill` package preinstalled, it is possible to specify `dynamic_dill_install=True` when calling `create_instant_python_job`. In this case `dill` will be dynamically installed before running the code.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ package_dir =
install_requires =
importlib-metadata; python_version<"3.8"
kubernetes
dill

[options.packages.find]
where = src
Expand All @@ -66,7 +67,6 @@ testing =
setuptools
pytest
pytest-cov
psycopg2

[options.entry_points]
# Add here console scripts like:
Expand Down
Loading
Loading