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

Improve security and automation of official binary releases #1247

Closed
na-- opened this issue Nov 15, 2019 · 7 comments
Closed

Improve security and automation of official binary releases #1247

na-- opened this issue Nov 15, 2019 · 7 comments

Comments

@na--
Copy link
Member

na-- commented Nov 15, 2019

As pointed out by this forum post, currently our RPM packages are not signed 😞

I think that during the transition away from AppVeyor/CircleCI (#959), we should also make a substantial improvement (mostly in terms of security) and upgrade in how we build our packages:

@na--
Copy link
Member Author

na-- commented Dec 16, 2019

Something else we should do for every commit, not just for tagged releases: actually build the rpm/deb/msi/etc. packages and test them (in the appropriate OS containers)... The v0.26.0 build of the linux packages broke: https://circleci.com/gh/loadimpact/k6/8360 🤦‍♂️ If we were building these on every commit, or at least once daily, we would have noticed and fixed the issue much sooner.

@imiric
Copy link
Contributor

imiric commented Dec 16, 2019

Since the go-bin-{deb,rpm} tools are giving us issues and they don't seem to be well maintained (last commit was over 2 years ago), we might want to consider switching to https://github.com/jordansissel/fpm .

I haven't used fpm personally, but have heard good things when used with Python projects. Presumably we should be able to use the directory input option for Go binaries, and would have more output options, including macOS .pkg files, so it's worth looking into.

na-- added a commit that referenced this issue Dec 16, 2019
This is just a collection of short-term fixes:
- pin the latest .msi package in the README, instead of using a specific version
- use `go get -d` for the go-bin-deb and go-bin-rpm packages, to only download the source (without building them) before we use glide to get their precise dependencies
- inject the new full version information in the build process

As mentioned in #1247 (comment), we should build and test the linux packages regularly, so we can fix them if something breaks...
na-- added a commit that referenced this issue Dec 16, 2019
This is just a collection of short-term fixes:
- pin the latest .msi package in the README, instead of using a specific version
- use `go get -d` for the go-bin-deb and go-bin-rpm packages, to only download the source (without building them) before we use glide to get their precise dependencies
- inject the new full version information in the build process

As mentioned in #1247 (comment), we should build and test the linux packages regularly, so we can fix them if something breaks...
@na-- na-- modified the milestones: v0.27.0, v1.0.0 May 21, 2020
@imiric
Copy link
Contributor

imiric commented Sep 22, 2020

There's another issue with Homebrew packaging on macOS. The current k6 formula actually builds the binary, which currently doesn't have any version information or any custom build flags we use for the GitHub releases. It's also a problem if we change our build system, since it currently uses dep and in v0.28.0 we switched to Go modules. This type of change hopefully won't happen again, but we shouldn't have to maintain two separate builds.

Ideally the binary shouldn't be rebuilt for Homebrew, and the formula should just fetch the *-mac.zip package from our GitHub release, verify the checksum, and bundle the binary for Homebrew. From a quick look, this seems possible but it would be messy to setup if have to use Bintray for this, so not sure, some investigation is needed for this.

@na--
Copy link
Member Author

na-- commented Feb 4, 2021

This is becoming a bit of a forced priority because of https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

@na-- na-- modified the milestones: v0.31.0, v0.32.0 Feb 24, 2021
imiric pushed a commit that referenced this issue Mar 18, 2021
This is part of the effort to abandon Bintray[0] in favor of a
self-hosted package repository solution. The current approach involves
pushing the packages and repository metadata to an S3 bucket, which will
eventually be served from a CDN (CloudFront).

Part of #1247

[0]: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
@imiric
Copy link
Contributor

imiric commented Apr 22, 2021

The scope of this issue is a bit fuzzy, but most of the things mentioned have now been addressed:

  • We replaced Bintray with our own package repositories at https://dl.k6.io.
  • DEB/RPM packages are signed with our GPG key, and MSI packages with our certificate.
  • build-release.sh is still used, but is now part of CI and run automatically for new releases.

What's still pending:

I suggest closing this issue and opening new ones for specific things. @na-- @mstoykov WDYT?

@na--
Copy link
Member Author

na-- commented Apr 23, 2021

👍 We should close this and open individual issues for anything else we want to do. The important part is that it's now "want", not "need" 🎉 😅

@imiric
Copy link
Contributor

imiric commented Apr 28, 2021

I created #1996 and #1997 for the leftover issues here, so closing this.

@imiric imiric closed this as completed Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants