-
Notifications
You must be signed in to change notification settings - Fork 2
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
New Server #44
New Server #44
Conversation
- setup poetry to use a local venv - add that venv to node-calls-python - simple dependency import test for sig-gen
This comment was marked as resolved.
This comment was marked as resolved.
because it's called externally, relative paths go a bit wierd
Sadly there's no way in node-calls-python to trash the environment, andno way in bun to watch arbitrary files
as much as I intend to, anyway
So I've said "JSON in JSON out" for the endpoints. But inside the services I'm also saying "what is the point in wrapping everything up in a It's actually annoying internally to have to wrap everything. I wonder if there's a common format like:
That means that each service has a common JSON response format, but has a lot of flexibility within it to do their own thing. |
with summaries and links to readme
Cannot begin to tell you how much trouble I've had getting the right versions of bun and python into the docker image 😬 In the end I've gone with |
fix node, bun and poetry so they all work properly with the correct versions
Outstanding right now is: python unit tests - but I don't really have anything to test 🤔 Maybe this can be introduced as needed? versioning - I think I'll spin this out as an issue, I'm not really sure on the requirements yet. I think service versions are probably tied to server Versions? |
So it looks like the docker image doesn't seem to log python output either! |
This PR creates a bun-based webserver which will host our AI and data-generation services.
Although I've refactored a lot of the python code (stripping out the HTTP layer), the aim of this project is to wrap a new web server around the existing code and not actually change anything. So the actual python services do need work and this is entrirely expeted!
Isma's original work is all committed under https://github.com/OpenFn/gen/releases/tag/last-isma-commit
Issues
Closes #42 and also #41 #34 #32
Features
bun py inference tmp/path.json
(useful for debug).env
(designed for dev mode only)Index page
If you go to the the server root, you'll be given a simple index page showing the available services. We show the first paragraph of the readme on the index, and link to the full readme.
Example Usage
All services are hosted at
/services/<service-name>
and accept a POST with JSON:With a payload:
This will call into the
adaptor_gen
service and return an adaptor file to you:For very easy testing, use the
echo
service!With a payload:
This will pass your payload into python and return it right back to you.
Tasks
services/template-gen/v1/
? Or maybe the version is in a query param?Each service/endpoint will expect json in a certain format. How do we define that, and how do we version it? Does each service need to provide a json schema? Or d.ts? Should we have standard wrappers on the response and request, or can we be super loose?JSON in, JSON out. That's it my friend.Future Work
Issues
Closes #42 (others to follow)