gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
16.97k stars 1.7k forks source link

Migrate push build pipelines from Drone to GitHub Actions #20647

Closed r0mant closed 3 months ago

r0mant commented 1 year ago

Drone pipelines

Drone currently runs the following pipelines on every push to master and branch/v* release branches:

update-docs-webhook triggers docs deployment in Vercel, build-buildboxes builds and pushes buildbox images to ECR, other push-* pipelines build Teleport artifacts on different architectures.

Scope

Let's start with push-* pipelines and then do buildboxes and docs.

Notes

These pipelines live in .drone.yaml, keep in mind the file (at least all push-* pipelines) is generated by dronegen:

https://github.com/gravitational/teleport/blob/362cb4641281f97e417e3e348958ded31e4d7108/.drone.yml#L38

Some other implementation notes:

camscale commented 1 year ago

Some work has been done on changing the buildboxes to be based on centos7 and to run on a native-ish architecture, which provides the following benefits:

This work has been started in:

and likely other PRs.

One issue with building on Centos 7 is it does not support node.js later than v16 and we need to use a later version for more modern Teleport Connect builds. https://github.com/gravitational/teleport/issues/21724 tracks this. The plan is to build the teleport binaries with a Centos 7 buildbox and take the tsh binary from that for Teleport Connect, which can be built on a more modern buildbox. This will forego running Teleport Connect on Centos 7, but that does not seem like it will be an issue as that is a server-based OS and not likely used a desktop OS, and Teleport Connect is a desktop app.

For the purposes of migrating the build pipelines off drone to GHA, we could leverage the work to use centos7-based buildboxes, but there is still some more work to be done there - at the very least, the arm64 buildbox does not appear to have the arm (32-bit) toolchain available so the build for arm fails with that.

As a first step to move off drone, we'll keep the existing buildboxes as used by drone and implemented in the build.assets/Makefile build targets. This is a fairly simple migration to get off drone. Then we can rev that to move the builds to be centos7-based and split off the Teleport Connect build to a different buildbox with a more modern version of node.js.

The current dispatchable workflow for linux builds (release-linux-arm64.yml) is not suitable for broader integration with drone in its current form:

This this in mind, the following steps will be taken:

Once that is done, #20729 can progress with the tag build pipelines using the same workflows, just with an additional parameter specifying that artifacts be released as is currently done with the ARM64 and MacOS release builds.

This will take care of most of the push build pipelines leaving:

The bulld-buildboxes workflow is a similar migration to the push build above - it is just calling targets in build.assets/Makefile and pushing the resulting images to an ECR registry.

The update-docs-webhook appears trivially implementable with a curl command in a github action. More details of the webhook are still to be understood

push-build-native-windows-arm64 is still an unknown. Investigation into Windows builders on GHA still to be done.

fheinecke commented 5 months ago

@camscale do you think that this is good to close out, or do you want to wait until after Drone no longer drives/calls the actions?

zmb3 commented 3 months ago

@camscale @fheinecke I assume this is good to close now?

camscale commented 3 months ago

Not quite. We have disabled push builds for now because we're not sure how to trigger them well from the OSS repo. I am doing a workflow cleanup and optimisation this week and next and I'll be looking at what options we might have available then. The alternative, depending on how fast I can get the release build process, is to have a release build each merge, pushed to the stage environment.

Alternatively we can close this and I can open a new issue for what might do.

camscale commented 3 months ago

On second thoughts, lets close this. We have migrated everything from drone. The rest is a change in the way we do things.