File tree Expand file tree Collapse file tree 8 files changed +53
-15
lines changed
Expand file tree Collapse file tree 8 files changed +53
-15
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,14 @@ jobs:
6262 with :
6363 python-version : ' 3.11'
6464 - name : Install dependencies
65+ working-directory : sdks/fs-python
6566 run : |
66- cd sdks/fs-python
6767 pip install .
6868 python -m pip install --upgrade pip
6969 pip install -r requirements.txt
7070 pip install pytest
7171 - name : Run Python SDK tests
72+ working-directory : sdks/fs-python
7273 run : |
73- cd sdks/fs-python
74- pytest
74+ make test
7575
Original file line number Diff line number Diff line change 1+ FROM python:3.13-slim
2+
3+ WORKDIR /function
4+
5+ # Copy the SDK files
6+ COPY . /function/
7+
8+ # Install the SDK
9+ RUN pip install .
10+
11+ # Set the default command
12+ CMD ["python" , "/function/function.py" ]
Original file line number Diff line number Diff line change 1+ .PHONY : build-image
2+
3+ build-image :
4+ docker build -t functionstream/fs-python-base .
5+
6+ test :
7+ pytest -v
Original file line number Diff line number Diff line change 1+ FROM functionstream/fs-python-base:latest
2+
3+ WORKDIR /function
4+
5+ COPY requirements.txt .
6+ RUN pip install -r requirements.txt
7+
8+ COPY string_function.py .
9+ COPY config.yaml .
10+ COPY package.yaml .
11+
12+ CMD ["python" , "string_function.py" ]
Original file line number Diff line number Diff line change 1+
2+ build-image :
3+ docker build -t my-function:latest .
4+
5+ .DEFAULT_GOAL := build-image
Original file line number Diff line number Diff line change 1616# This configuration file defines the settings for the string processing function example.
1717
1818pulsar :
19- serviceUrl : " pulsar://localhost :6650" # Required: URL of the Pulsar broker
19+ serviceUrl : " pulsar://192.168.31.80 :6650" # Required: URL of the Pulsar broker
2020 authPlugin : " " # Optional: Authentication plugin class name
2121 authParams : " " # Optional: Authentication parameters
2222
@@ -28,14 +28,14 @@ sources:
2828 - pulsar : # SourceSpec structure with pulsar configuration
2929 topic : " topic-a" # Topic name for regular message consumption
3030
31- # Required: Name of the subscription for the consumer
32- subscriptionName : " test-sub"
33-
34- # Optional: List of request source topics
31+ # Optional: request source
3532requestSource :
3633 pulsar : # SourceSpec structure with pulsar configuration
3734 topic : " string-topic" # Topic name for request messages
3835
36+ # Required: Name of the subscription for the consumer
37+ subscriptionName : " test-sub"
38+
3939# Optional: Output sink configuration
4040sink :
4141 pulsar : # SinkSpec structure with pulsar configuration
Original file line number Diff line number Diff line change 1+ # None. Please add your own deps here.
Original file line number Diff line number Diff line change 88 "pulsar-client>=3.0.0" ,
99 "pyyaml>=6.0" ,
1010 "aiohttp>=3.8.0" ,
11+ "pydantic>=2.0.0"
1112 ],
12- author = "FuncionStream Org" ,
13- author_email = "your.email@example.com " ,
14- description = "A simple RPC service SDK that allows users to focus on their core business logic " ,
13+ author = "FunctionStream Org" ,
14+ author_email = "" ,
15+ description = "FunctionStream SDK is a powerful Python library for building and deploying serverless functions that process messages from Apache Pulsar. " ,
1516 long_description = open ("README.md" ).read (),
1617 long_description_content_type = "text/markdown" ,
17- url = "https://github.com/yourusername/ fs-sdk " ,
18+ url = "https://github.com/functionstream/function-stream/sdks/ fs-python " ,
1819 classifiers = [
1920 "Programming Language :: Python :: 3" ,
20- "License :: OSI Approved :: MIT License" ,
21+ "License :: OSI Approved :: Apache Software License" ,
2122 "Operating System :: OS Independent" ,
2223 ],
23- python_requires = ">=3.7 " ,
24- )
24+ python_requires = ">=3.9 " ,
25+ )
You can’t perform that action at this time.
0 commit comments