Skip to content

Commit

Permalink
Adjust Python (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbadura authored Mar 29, 2024
1 parent c78af1a commit d538529
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
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 Python Runtime Version {XYZ} and Function:
```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
File renamed without changes.
File renamed without changes.
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

0 comments on commit d538529

Please sign in to comment.