benhylau / mesh-workshop

Nodes used to facilitate workshops and demos for mesh networking
GNU General Public License v3.0
35 stars 2 forks source link

Download .deb and docker archives in CI #16

Open benhylau opened 5 years ago

benhylau commented 5 years ago

I was thinking, if we can run the mesh-orange image in emulated armhf we'd be able to do these in Travis CI and put them the assets in release artifacts only, rather than committing them to git after creating them from an actual Raspberry Pi running mesh-orange:

See: https://github.com/benhylau/mesh-workshop/blob/master/src/shared/deb/README#L4-L7

@darkdrgn2k do you think your work in making prototype run tests on Raspbian can also be used for this?

@hamishcoleman do you have suggestions re: this perhaps based on debootstrap/multistrap or perhaps make use of the x86 images of mesh-orange?

hamishcoleman commented 5 years ago

@benhylau, the debian-minimal-builder is built to be flexible for adding additional steps - you can create a new 'packages.d' style subdir and add it to the CONFIGDIRS (perhaps also adding your source files to the target root from a _ALWAYS.customise.add/ dir) and then start running extra actions from a _ALWAYS.customise script - which will run with access to the built target root directory (and some magic to allow the armhf contents to be run from the x86_64 CI environment)

So your customise script could run any additional steps in the same environment as the ramdisk as a chroot and then copy the results out of the chroot. Importantly, any changes done during this customise step would be included in the output root file system, so this should not be done on the same target root dir as the one used to create ramdisk images.

darkdrgn2k commented 5 years ago

do you think your work in making prototype run tests on Raspbian can also be used for this?

Its doable but a little trickier since the image is actually compressed (i remember trying to add an overlay into it). So you cant just mount the image, you would need to

Sounds like @hamishcoleman 's idea may have a internal mechanism to deal with this.

One of these days i'd love to get a line by line (ish) walk through of exactly how the image is built.

benhylau commented 5 years ago

Thanks for the quick and detailed feedback guys! Happy to know there is a sane path to this. It seems to be that using debian-minimal-builder's build steps and looping this into my custom mesh orange builder to generate assets, and doing that armhf emulation magic, will be the way to go. This seems like a good way to learn mesh orange build and the prototype emulation that @darkdrgn2k is doing will help with that magic to build the armhf docker archive under emulation.