Python as service and source hosting

Hi,

1st learning and creating snaps. Hope you can clear my mind on this.

a. When using snaps, is it possible to let myapp.py running as a service or at least bring the application running after boot and keep it alive if it closes?
b. How can I maintain the application updated if it is hosted on my local network and not at snap store or hub? I mean, I wish I could get myapp.py (snap) updated everytime I push new commits to the git repo…

Thanks!

Regards,
Sylvio

Yes, this is possible by setting the following on your apps: definition as an example:

apps:
  name-of-your-app:
    command: some-command
    daemon: simple
    plugs:
    ... # plug any interfaces required here

See Snapcraft.yaml reference for the daemon documentation.

You need to put your application inside the snap package. There is zero benefit to using a snap package if your application is not packaged in the snap. When you update your application you need to rebuild the snap with the new code and publish it to the snap store in order for it to update your installed snaps.

Hi,

Yes, I was not sure about automatically running on startup.

It means that it must be published on snap store… there is no other way out…

Thanks!