Skip to content
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

Update Dockerfile for Python 3 and latest Balena and OctoPrint changes #5

Conversation

RyanBalfanz
Copy link

@RyanBalfanz RyanBalfanz commented Apr 21, 2020

These changes enable installed plugin persistence to the data directory, as well as the OctoPrint config.yaml.

In addition, it focuses on Python 3. The latest OctoPrint (v.14.0) adds Python 3 support as Python 2 is EOL.

Requirements?

  • Python 3 ready
  • Ability to install plugins reliably (i.e. persistent, and resilient to system reboot and shutdown)
    Note that restarting the application via a container restart is available but not the target in the UI because the is not equivalent to a reboot of the device. A "restart" in the UI is really a reboot for this reason. You can restart the application using the balenactl restart if you really want to start with a fresh container. This has implications with how the config.yaml file is currently managed during the first run. The config option to restart is defined for the convenience offered (e.g. easy "restart" via post-plugin install popup button).
  • Ability to create and restore from backups
  • Ability to restart the octoprint server without restarting the container

Nice to have:

Various Balena application and device Actions

  • Ability to toggle public device URL from within OctoPrint
  • Ability to purge data directory from within OctoPrint
  • Update locking, especially while printing is in progress, or during other OctoPrint operations such as installing plugins, restoring from backup, etc.

CC: @curcuz

@RyanBalfanz RyanBalfanz mentioned this pull request Apr 21, 2020
@RyanBalfanz RyanBalfanz force-pushed the maintenaince-including-python3 branch from fba442d to 481cd4b Compare April 21, 2020 14:40
@RyanBalfanz RyanBalfanz force-pushed the maintenaince-including-python3 branch from 481cd4b to 193e065 Compare April 21, 2020 14:45
@RyanBalfanz
Copy link
Author

This information belongs here just as much, if not more?, than in the other PR:

#4 (comment)

@RyanBalfanz
Copy link
Author

RyanBalfanz commented Apr 21, 2020

Still missing is the ability to restart the octoprint server without restarting the container.

Using the octoprint command's daemon mode might work here, and then solve some other issues pertaining to config.yaml handling and how OctoPrint works internally.

Dockerfile.template Outdated Show resolved Hide resolved
@RyanBalfanz RyanBalfanz marked this pull request as draft April 30, 2020 19:04
@thebigredgeek
Copy link

@RyanBalfanz why don't we branch this into a different project? Would be more than happy to help maintain it, too

@RyanBalfanz
Copy link
Author

RyanBalfanz commented May 15, 2020 via email

@RyanBalfanz
Copy link
Author

@thebigredgeek: Just to follow up from my previous message, wanted to pass along these other projects as well.

  1. https://github.com/AmedeeBulle/octoprint-containers
  2. https://github.com/OctoPrint/docker

As for (1), it seems pretty good. The only downside that I think exists is that multi-container support is a paid feature with Balena.io. I beleive it should be possible to create a complete solution (e.g. OctoPrint, webcam support, etc.) using Supervisor, for example, in single container if need be.

As for (2), @LongLiveCHIEF can speak more to it than I can.

@RyanBalfanz
Copy link
Author

RyanBalfanz commented May 17, 2020

Screen Shot 2020-05-17 at 2 53 23 PM

Screen Shot 2020-05-17 at 2 53 19 PM

Screen Shot 2020-05-17 at 2 53 39 PM

@thebigredgeek, @LongLiveCHIEF

Following up from my last comment–I just created an example showing how to use Supervisor with Balena. In this example the web port 80 is dedicated to the Supervisor internet interface, but can be swapped for OctoPrint instead. Supervisor only needs to be used to run (a) OctoPrint, (b, c…) auxiliary applications such as those to support the webcam.

The code is at https://github.com/RyanBalfanz/balena-supervisor.

@brainstorm
Copy link

I would actually prefer to see this merged on balena-io instead, seems to be more findable instead of hunting for different individual repos?

@curcuz
Copy link
Contributor

curcuz commented Jun 16, 2020

@RyanBalfanz sorry for the long time it took to notice your PR, but it's still marked as WIP :P

Is this ready for review?

Also, I'm looking within the Balena team for a maintainer to promote this project from experiment playground (as it is now under the balena-io-playground org) to maintained project so hopefully there will be better response to community in the near future.

@curcuz
Copy link
Contributor

curcuz commented Jun 16, 2020

@RyanBalfanz @brainstorm @thebigredgeek I was pointed by colleagues that there is already a well-maintained community project here https://github.com/MatthewCroughan/octobalena that is actually a fork of this one.

I am considering deprecating this project and directing people towards octobalena.

Fun fact: Matthew, the maintainer, was also our guest in our IoT Happy Hour EP9

@chrisys
Copy link
Member

chrisys commented Jul 21, 2020

I've updated this project and kept it as a barebones version, but octobalena linked above is still a great option for a more fully featured version. There are definitely still some nice ideas in this PR we could implement in a basic version though.

Just to clarify though, you can still run multicontainer applications on the free tier of balenaCloud - that's exactly what octobalena is doing :)

@chrisys chrisys closed this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants