Snapcraft Linux

Hello there,
With the latest Ubuntu release I saw they are starting to push Ubuntu Appliances. After reading a little bit it looks like it uses Snaps to make a install and go applications. This seems like a perfect medium for Octoprint, and I was just wondering if supporting Snaps was being considered or already in the works?

Seems like if there was a Snap made then we could install Octoprint on any computer really quickly and easily. And as a side effect be able to make an Appliance that we could just image on to a Pi and have it up and running quickly too.

I can't speak for @foosel but I don't think she got time for that.

Also I think somebody already made a snap package.

You are right. And I also have no idea of snaps and I also don't use that stuff myself, so I'm entirely unqualified to begin with.

Cool thanks. If the snap works as it should, it should pretty much be a 1-click install. Much easier than manual install instructions.

And if Paulo is able to get an Appliance made out of the snap there there is a simple alternative to Octopi that uses Ubuntu instead of Rasbian. Pretty cool stuff. I will try out the snap later see if it is that easy.

anyone know how the restart octoprint, reboot and shutdown are supposed to be set?

Assuming that you're using a Snap version of OctoPrint then the documentation for Snapcraft is probably the best way of learning about that.

Hello everybody !
I've install snap on manjaro. I've started octoprint service (sudo snap start octoprint-pfs.daemon), but now, i don't know on which port i can connect to octoprint ?

If you can do an sudo snap start... then you can probably do a netstat -auntp and see what ports are open and assigned to which processes (man netstat if my switches don't work).

Thanks for your answer !
On my manjaro, i use ss instead of netstat...

So here is my results

~ >>> snap services                                                                                                                                      
Service               Startup  Current  Notes
octoprint-pfs.daemon  enabled  active   -
~ >>> ss -auntp                                                                                                                                          
Netid State      Recv-Q Send-Q                            Local Address:Port                Peer Address:PortProcess                                      
udp   ESTAB      0      0                                                                         
udp   UNCONN     0      0                                       *    users:(("chromium",pid=11651,fd=32))        
udp   UNCONN     213056 0                                        *    users:(("python3",pid=39523,fd=39))         
udp   UNCONN     213056 0                                        *    users:(("python3",pid=39523,fd=37))         
udp   UNCONN     0      0                                        *    users:(("python3",pid=39523,fd=34))         
udp   UNCONN     0      0                                    *    users:(("chromium",pid=11651,fd=30))        
udp   UNCONN     0      0                                    *    users:(("chromium",pid=11618,fd=250))       
udp   UNCONN     0      0                                    *    users:(("chromium",pid=11651,fd=97))        
udp   UNCONN     0      0                                        *    users:(("MainThread",pid=2511,fd=374))      
udp   ESTAB      0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:51883 [2a00:1450:4007:806::200e]:443  users:(("chromium",pid=11651,fd=50))        
udp   UNCONN     0      0                                             *:52820                          *:*    users:(("chromium",pid=11651,fd=37))        
tcp   LISTEN     0      5                                       *                                                
tcp   ESTAB      0      0                               users:(("MainThread",pid=2511,fd=125))      
tcp   SYN-SENT   0      1                               users:(("thunderbird",pid=2219,fd=39))      
tcp   ESTAB      0      0                            users:(("chromium",pid=11651,fd=142))       
tcp   CLOSE-WAIT 1      0                                users:(("chrome-gnome-sh",pid=2811,fd=150)) 
tcp   ESTAB      0      0                              users:(("chromium",pid=11651,fd=79))        
tcp   ESTAB      0      0                             users:(("chromium",pid=11651,fd=268))       
tcp   ESTAB      148    0                              users:(("gvfsd-smb-brows",pid=2104,fd=9))   
tcp   ESTAB      0      0                              users:(("chromium",pid=11651,fd=53))        
tcp   ESTAB      0      0                              users:(("chromium",pid=11651,fd=38))        
tcp   TIME-WAIT  0      0                                                                          
tcp   ESTAB      0      0                             users:(("MainThread",pid=2511,fd=52))       
tcp   ESTAB      0      0                               users:(("thunderbird",pid=2219,fd=73))      
tcp   ESTAB      0      0                             users:(("chromium",pid=11651,fd=48))        
tcp   ESTAB      0      0                              users:(("chromium",pid=11651,fd=109))       
tcp   ESTAB      0      0                              users:(("chromium",pid=11651,fd=171))       
tcp   LISTEN     0      5                                         [::1]:631                         [::]:*                                                
tcp   ESTAB      0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:53814 [2a00:1450:4007:806::200a]:443  users:(("MainThread",pid=2511,fd=56))       
tcp   TIME-WAIT  0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:56590 [2a00:1450:4007:817::2003]:443                                              
tcp   ESTAB      0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:32786  [2606:4700:20::ac43:45a2]:443  users:(("chromium",pid=11651,fd=44))        
tcp   ESTAB      0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:41450    [2a01:4f8:1c1c:bd5b::1]:443  users:(("MainThread",pid=2511,fd=99))       
tcp   ESTAB      0      0      [2a01:e35:2e3c:c080:fad8:e128:58a4:67fe]:60328   [2606:4700:20::681a:a99]:443  users:(("MainThread",pid=2511,fd=142))      
~ >>>  

EDIT : replying to myself, after a few second the service is inactive... Someon have successfully used this snap ??

The only thing I know about this snap, is that it didn't work for someone on the discord recently either. I couldn't find a way (back then) to peek inside what it does, so I recommended that they installed using the standard guide.

On a typical OctoPi / OctoPrint setup, OctoPrint is listening on port 5000 and haproxy is listening on port 80 (and redirects per its config file to OctoPrint's port). Your output only shows port 631 in the LISTEN state.

I think that you're right

~ >>> sudo snap start octoprint-pfs.daemon && date                                                                                                                                              
dim. 04 oct. 2020 18:28:30 CEST
~ >>> snap services && date                                                                                                                                                                     
Service               Startup  Current  Notes
octoprint-pfs.daemon  enabled  active   -
dim. 04 oct. 2020 18:28:31 CEST
~ >>> snap services && date                                                                                                                                                                     
Service               Startup  Current  Notes
octoprint-pfs.daemon  enabled  active   -
dim. 04 oct. 2020 18:28:34 CEST
~ >>> snap services && date                                                                                                                                                                     
Service               Startup  Current   Notes
octoprint-pfs.daemon  enabled  inactive  -
dim. 04 oct. 2020 18:28:38 CEST

it's crashing after 10 seconds... i don't know if we can see what a snap is doing...