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

Adjust Python #839

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#For local debugging
function
venv

__pycache__
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
## How to locally run and debug Python Function and runtime

1.Create [venv](https://docs.python.org/3/library/venv.html)
```bash
python3 -m venv venv
```

2.Activate venv:
```bash
source venv/bin/activete
```
3.Create the `function` directory with `handler.py` and `requirements.txt`

4.Install dependencies from runtime and Function:
4.Install dependencies from specific runtime {XYZ} and Function:
Cortey marked this conversation as resolved.
Show resolved Hide resolved
```bash
pip install -r requirements.txt
pip install -r kubeless/requirements.txt
pip install -r python{XYZ}/requirements.txt
pip install -r function/requirements.txt
```

5.Set the following envs:
Expand All @@ -23,6 +26,6 @@

6.Run Function from the terminal.
```bash
python3 kubeless.py
python3 kubeless/kubeless.py
```

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import bottle
import prometheus_client as prom

import tracing
from ce import Event
from tracing import set_req_context
import lib.tracing as tracing
from lib.ce import Event
from lib.tracing import set_req_context


# The reason this file has an underscore prefix in its name is to avoid a
Expand Down
2 changes: 1 addition & 1 deletion components/runtimes/python/python312/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY ./python312/requirements.txt /kubeless/requirements.txt

RUN pip install --no-cache-dir -r /kubeless/requirements.txt

COPY ./kubeless/ /
COPY ./ /

WORKDIR /

Expand Down
2 changes: 1 addition & 1 deletion components/runtimes/python/python39/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY ./python39/requirements.txt /kubeless/requirements.txt

RUN pip install --no-cache-dir -r /kubeless/requirements.txt

COPY ./kubeless/ /
COPY ./ /

WORKDIR /

Expand Down
Loading