GitHub Integrations with snapcraft build arguments

I am trying to leverage the automatic build GitHub integration feature, but currently to build my snap it requires experimental feature package-repositories. So locally I must install snapcraft via sudo snap refresh --candidate snapcraft then pass the build argument --enable-experimental-package-repositories. Also I must increase the build environment memory SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=16G snapcraft --enable-experimental-package-repositories. How can this be accomplished leveraging the GitHub integration feature?

@kyrofa do you have any ides? I also ran into the same issue with trying to the leverage the remote-build feature.

If you’re talking about the snapcore/action-build@v1 Github Action, please file a bug report and I’ll take a look.

Looking over what you’ve written, there seem to be a few parameters that you want to configure:

  1. Choose the Snapcraft release channel. This seems like a reasonable thing to add, and could be useful for the action’s own CI process to make sure it works with unreleased versions of Snapcraft.

  2. Passing --bind-ssh: I presume you’re installing a private key to ~/.ssh via secrets and want it available within the snap build environment? I wonder if there is any downside to passing this one unconditionally? Or at a minimum, passing it if ~/.ssh exists?

  3. Enabling experimental Snapcraft features. Presumably these flags will come and go as features are added and stabilised. It probably makes more sense to provide an input parameter to the action listing additional arguments to pass to Snapcraft.

  4. Adjusting build environment RAM. I don’t think this one makes sense in the context of the action: it uses an LXD container to build, so will have access to all the RAM available to the runner. It’s not spinning up a VM that needs RAM assigned to it.

Sorry the --bind-ssh was a carry over when the repository was private, but is public now.

I have currently tried the following options, but they all have issues because I need a way to pass this option --enable-experimental-package-repositories. I have not tried leveraging github action to do this but will take a look and thank you for the feedback.

  • The github integration for building
  • snapcraft remote-build which off loads to for building.

I think snapcraft is hiding those behind a flag for a reason, and automated build tools probably avoid such flags for the same reason. @sergiusens, @cjp256 that feature is super useful, what will it take to remove the experimental flag?

I’m hoping soon. After this, I think it’s pretty much good to go with a little bit of documentation polish and final review.

1 Like

It looks like PR 3232 has been merged.

@cjp256: Do you have any updates on when the package-repositories feature will be available without the experimental flag? (I’m hoping soon? - We need to install the Vulkan SDK.)

@pastdue from some additional feedback, I have a couple more actions to sort through first before we can mark the interface stable.

I have some higher priorities atm, but I imagine a couple of weeks or so to get the changes into edge?


@cjp256 Thank you for the update - that would be fantastic. (This really is a super useful feature. :+1: )