-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Updating Python runtime to use Python SDK (#212)
* Adding initial version of the nodejs sdk. * Adding pid info. * Adding an example of using nodejs sdk. * Adding test in examples for the new sdk. * Simplifying package.json * Cleaning up handler. * chore: Adding NodeJS SDK to FEATURES.md & style fixes. * Updating FEATURES.md * fix: Fix for #190, broken nodejs sdk test. * Re-eanbling the test. * Trying out an example one more time. * That's my output from running `make test-examples` locally: ``` --- PASS: Test (245.21s) --- PASS: Test/101-hello (10.63s) --- PASS: Test/101-two-node (2.79s) --- PASS: Test/102-filter (8.33s) --- PASS: Test/102-flatten-expand (8.69s) --- PASS: Test/102-map (11.33s) --- PASS: Test/103-autoscaling (11.03s) --- PASS: Test/103-scaling (12.76s) --- PASS: Test/104-golang1-16 (14.03s) --- PASS: Test/104-java16 (9.62s) --- PASS: Test/104-python3-9 (10.28s) --- PASS: Test/106-git-go (13.64s) --- PASS: Test/106-git-nodejs (13.74s) --- PASS: Test/106-git-python (32.50s) --- PASS: Test/107-completion (3.29s) --- PASS: Test/107-terminator (4.05s) --- PASS: Test/108-container (3.00s) --- PASS: Test/108-fifos (10.38s) --- PASS: Test/109-group (11.50s) --- PASS: Test/301-cron-log (9.87s) --- PASS: Test/301-http (13.50s) --- PASS: Test/301-kafka (10.30s) --- PASS: Test/301-two-sinks (8.23s) --- PASS: Test/301-two-sources (11.71s) PASS ok github.com/argoproj-labs/argo-dataflow/examples 246.000s ``` Let's see if the same will happen in Github Actions. * DO NOT MERGE: Testing out a different CI configuration to see if it will help with broken example tests. * Adding NodeJS 16 Runtime & working NodeJS & Python example tests. * Adding FEATURE. * Updating example to point at main repo. * fixing features order. * Updating CONTRIBUTING docs. * feat: Updating python runtime to use python SDK. * Updating examples to use main repo code.
- Loading branch information
Showing
5 changed files
with
15 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
def handler(myServer, message, empty): | ||
def handler(message, context): | ||
msg = message.decode("UTF-8") | ||
print('Got message', msg) | ||
return ("hi " + msg).encode('UTF-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
from http.server import BaseHTTPRequestHandler, HTTPServer | ||
from argo_dataflow_sdk import ProcessHandler | ||
|
||
from handler import handler | ||
|
||
|
||
class MyServer(BaseHTTPRequestHandler): | ||
def do_GET(self): # GET /ready | ||
self.send_response(204) | ||
self.end_headers() | ||
|
||
def do_POST(self): # POST /messages | ||
len = int(self.headers.get('Content-Length')) | ||
msg = self.rfile.read(len) | ||
out = handler(msg, {}) | ||
if out: | ||
self.send_response(201) | ||
self.end_headers() | ||
self.wfile.write(out) | ||
else: | ||
self.send_response(204) | ||
self.end_headers() | ||
|
||
|
||
if __name__ == '__main__': | ||
webServer = HTTPServer(("localhost", 8080), MyServer) | ||
|
||
try: | ||
webServer.serve_forever() | ||
except KeyboardInterrupt: | ||
pass | ||
|
||
webServer.server_close() | ||
processHandler = ProcessHandler() | ||
processHandler.start(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
git+https://github.com/argoproj-labs/argo-dataflow#subdirectory=dsls/python | ||
git+https://github.com/argoproj-labs/argo-dataflow#subdirectory=dsls/python | ||
git+https://github.com/argoproj-labs/argo-dataflow#subdirectory=sdks/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters