I want to announce pykitemodels, a Python interface for a set of Julia packages, known under the name Julia Kitepower Tools.
It mainly wraps KiteModels.jl, just released in version 0.6.1 with support for speed and torque controlled ground stations.
I presented this software on the JuliaCon 2024 in Eindhoven in the context of the aerospace symposium. You can see my talk at 5:30:40 here .
The interface uses the http
server Oxygen.jl
and JSON to communicate between Python and Julia.
The call overhead is quite small, about 80 µs per call. Because the simulation usually runs at 20 Hz, this is not an issue.
This is not yet a pip installable package, but my aim is to get there. A challange: How
can you create a web service if you are not root, how can you install a service that runs
in the background with pip?
Questions:
- does anybody know a Python forum where I could annonce this piece of software?
- how to create a service without being root?
It might serve as inspiration for people who want to make their SW available for Python users.
5 Likes
Regarding the service: one option is to create a daemon (cf. GitHub - thesharp/daemonize: daemonize is a library for writing system daemons in Python.) You don’t need to be root with that but keep in mind that you need to use unprivileged ports for the webserver (>1024) otherwise you have to be root (or at least need privileges
)
I thought of daemonize
, but can I use it to create a Julia service based on Oxygen.jl ?
Because I have a Julia server, only the client is written in Python.
In the moment I use this code to create a service, but this requires root permissions:
echo "Installing modelserver.service"
cp utils/modelserver.service.template utils/modelserver.service
sed -i "s/USER/$USER/g" utils/modelserver.service
sed -i "s|PATH|$(pwd)|g" utils/modelserver.service
sudo cp utils/modelserver.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable modelserver
sudo systemctl start modelserver
Oh I thought the server is running in Python. I don’t know of any Julia package which implements that but you might also consider using Supervisor
I use it for all kinds of complex systems where processes need to be up and running (and restarted in case of failures, logged, log-rotated etc.).
It’s written in Python but can launch whatever you can launch from the shell ![:wink: :wink:](https://emoji.discourse-cdn.com/twitter/wink.png?v=12)
However, I don’t know if it fits into your infrastructure. You might bury it into a Julia function call though…
1 Like