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

Enable building snaps from source #969

Merged
merged 1 commit into from
Jan 15, 2020
Merged

Enable building snaps from source #969

merged 1 commit into from
Jan 15, 2020

Conversation

dholbach
Copy link
Contributor

@dholbach dholbach commented Jul 3, 2019

Build a snap from eksctl source. @mikeroyal and I worked on this (#871 and mikeroyal#1 are previous attempts at getting this in).

Description

To build the snap, run

# Prep
sudo snap install snapcraft --classic
sudo snap install multipass --beta --classic

# Actual build
snapcraft

The resulting snap works nicely for me.

@dholbach dholbach changed the title Snap Enable building snaps from source Jul 3, 2019
@dholbach
Copy link
Contributor Author

dholbach commented Jul 3, 2019

This would need to be hooked up with CI and all, but this should be first steps for allowing us to

@dholbach dholbach mentioned this pull request Jul 3, 2019
6 tasks
@errordeveloper
Copy link
Contributor

errordeveloper commented Jul 3, 2019

This would need to be hooked up with CI and all

In order to do that, we should integrate this as part of our release process, goreleaser supports snaps. I believe this simply implies we need make snap/snapcraft.yaml part of .goreleaser.yml, probably in a manner similar to how .goreleaser.brew.yml is done.

https://github.com/weaveworks/eksctl/blob/ae1436bfaf4580a736199dca0d8bd8e78228f668/do-release.sh#L12-L13

@dholbach
Copy link
Contributor Author

dholbach commented Jul 3, 2019

Thanks Ilya for the feedback. I'm not sure what the best way is to hook this up with goreleaser. 🤷‍♂️

@errordeveloper
Copy link
Contributor

errordeveloper commented Jul 3, 2019 via email

@dholbach
Copy link
Contributor Author

dholbach commented Jul 3, 2019

Ah ok. Shall we do two separate PRs for this?

@errordeveloper
Copy link
Contributor

@dholbach are you interested in finishing this?

@dholbach
Copy link
Contributor Author

dholbach commented Aug 6, 2019

I was thinking we could land this piece of work first, then move on to goreleaser et al in a second PR. It's what I'm unfamiliar with.

@dholbach
Copy link
Contributor Author

dholbach commented Sep 5, 2019

Can we maybe just merge this and then do second PR with whatever's required to enable the build and publication of the snap? Goreleaser has support for snapcraft, but it's not complete.

@dholbach
Copy link
Contributor Author

dholbach commented Sep 5, 2019

Either we use build.snapcraft.io for this (the GH account to set this up will need to be admin unfortunately - to be able to set up the webhook).

If that's not an option, we could try to roll our own and do a:

# Prep
sudo apt install snapd
sudo snap install snapcraft --classic
sudo snap install multipass --beta --classic

# Actual build
snapcraft
snapcraft push eksctl_<version>_amd64.snap

For the last step we'd need to login to the store, etc.

@dholbach
Copy link
Contributor Author

@martina-if Thanks for assigning.

On this one I think we're blocked because there was the idea to use goreleaser which I don't know anything about.

What I'd suggest:

  1. I update this PR
  2. we merge it
  3. we create a shared account on https://snapcraft.io/
  4. I talk to the Snap Store maintainers, so we can take over https://snapcraft.io/eksctl from the inactive developer
  5. we figure out a way to do this in CI later (using build.snapcraft.io for this unfortunately requires pretty wide access to the Github repo to set up a webhook for us and there's no manual way to do it: Repo grayed-out at build.snapcraft.io/select-repositories canonical-web-and-design/build.snapcraft.io#1191)

The last point we haven't figured out for fluxctl either yet. I push snaps to the store manually every now and then. The workflow generally is:

# Prep
sudo snap install snapcraft --classic
sudo snap install multipass --classic

# Actual build
snapcraft

# Publishing
snapcraft push eksctl_<version>_amd64.snap --release [stable|beta|edge}

Let me know if it's unclear and if you have different thoughts.

@dholbach
Copy link
Contributor Author

Updated. The PR is good to go AFAICS. Let's decouple the snap build bits from the publication in the store.

@martina-if
Copy link
Contributor

Hi @dholbach thanks for updating this PR! If you think merging this is the best first step let's do that. Before that, can you please add those instructions here? https://github.com/weaveworks/eksctl/blob/master/CONTRIBUTING.md#release-process

@dholbach
Copy link
Contributor Author

@martina-if I documented things TTBOMK. Please review.

Our options for publishing (once we took over maintenance of the snap):

  • publish manually whenever we please
  • publish through CI through a mechanism we can figure out ourselves
  • publish using build.snapcraft.io (which would require us to at least temporarily give admin privs of the GH repo to the build service, so it can set up a webhook - not sure if that's acceptable for us)

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
	Thanks Michael Royal for your initial work on this.
	First attempts: #871 and mikeroyal#1
@dholbach dholbach merged commit 3de5b3f into eksctl-io:master Jan 15, 2020
@dholbach dholbach deleted the snap branch January 15, 2020 13:34
@marccarre marccarre added this to the 0.13.0 milestone Jan 20, 2020
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.

5 participants