pi-builder icon indicating copy to clipboard operation
pi-builder copied to clipboard

Build recipe template and recommended workflow

Open jywarren opened this issue 6 years ago • 6 comments

Now that we have these building, which is amazing, let's think about how we might make this a quick and standard workflow. I'm imagining different people might want to prepare an .img from the following inputs:

  • a build script, not necessarily included in this repository?
  • a starting image to build on (although for now Raspbian is fine, so let's not think too hard about this yet)

Additionally:

  • a wifi hotspot name and pwd, and whether to enable the "captive welcome screen"
  • (optional for the narrower case of WiFi hotspot-based applications) - a "captive welcome screen" with
    • link(s) to the installed applications/apps

... and get these outputs:

  • an .img built from the build script

What would be the ideal workflow from start to finish to specify these things? Maybe what's the current workflow and what would we like to work towards?

For ideal, what about:

  1. create a build script as build.sh or something
  2. upload, or paste it, into a web interface? Or set it in a config file? Or open a PR with it in a directory called /recipes/?
  3. press "RUN" on a web interface and wait, or run a build command on a CLI?

Thanks!!!

jywarren avatar Jul 30 '18 16:07 jywarren

@icarito what do you think? We don't have to do everything at once, but trying to imagine what our ideal goal is...

jywarren avatar Jul 30 '18 16:07 jywarren

Hi @jywarren I've given this a lot of thought and some work!

I can see others would like to build the image with custom settings, and they may not have a Jenkins server or a Docker host at hand.

The best solution I could find is setting up the project to be built with Gitlab-CI. This way, when there's a PR, the CI pipeline will automatically build an image and it will be available for download. Users could work within a PR or fork their own repository (in Gitlab) to build their own images.

With regard to how to customize, the recommended way to do it is leveraging cloudinit (documentation). This is the way Hypriot project does it and it makes a lot of sense. Basically you have to edit builder/files/boot/user-data either at build time or after flashing but before first boot. Files can be added to the image at the builder/files/ path.

icarito avatar Aug 02 '18 07:08 icarito

cloudinit sounds great. I think having PRs open as examples of how to create a script would be great. So the PRs would not have to actually be merged to generate images, right?

jywarren avatar Aug 02 '18 18:08 jywarren

On 02/08/18 13:50, Jeffrey Warren wrote:

|cloudinit| sounds great. I think having PRs open as examples of how to create a script would be great.

+1 That's a straightforward workflow!

So the PRs would not have to actually be merged to generate images, right?

Exactly! :-)

icarito avatar Aug 02 '18 19:08 icarito

one other idea I had was to have a subfile required in, if that's possible -- so that the really long script could include all the more complex stuff, but a simpler subsection with just a simple "recipe" could be a stand-alone file. Do you think that would be possible (eventually)?

On Thu, Aug 2, 2018 at 3:14 PM Sebastian Silva [email protected] wrote:

On 02/08/18 13:50, Jeffrey Warren wrote:

|cloudinit| sounds great. I think having PRs open as examples of how to create a script would be great.

+1 That's a straightforward workflow!

So the PRs would not have to actually be merged to generate images, right?

Exactly! :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/image-builder-rpi/issues/7#issuecomment-410036673, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJxUeq6voUgL-GKyla77wiweMIODvks5uM0-kgaJpZM4Vmt7_ .

jywarren avatar Aug 02 '18 20:08 jywarren

Added some extra docs in the README, but we can link to the blog post when we're ready with that too!

https://github.com/publiclab/image-builder-rpi/blob/master/README.md

jywarren avatar Oct 16 '18 03:10 jywarren