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

Replace Drone pipeline with Github actions #2168

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

weyfonk
Copy link
Contributor

@weyfonk weyfonk commented Feb 20, 2024

This provides a new release-fleet.yaml CI workflow to replace our .drone.yml pipelines.
Here is an example of a release generated by this new workflow.

Refers to #2121

Additions

  • Linting
  • Integration tests
  • gitjob and gitcloner binaries

Limitations/Possible improvements

  • Single checksum file, as per GoReleaser limitation (this may change soon); could be mitigated by using a separate workflow step to compute checksums by target arch
  • No Windows-based images for now, although there may be a way (see experimental branch) involving a patch to GoReleaser
    • Further discussion suggested that we may not actually need Windows images, because we require at least one Linux node in each cluster, and the agent is not scheduled to run on Windows nodes anyway.
  • Fleet binaries are built twice for the Github runner platform: once to run the tests, then again by GoReleaser to prepare a release.

Doubts

  • How much value is there in releasing gitjob and gitcloner binaries on their own? Would having them in rancher/gitjob images be enough?

Left to do

  • Remove .drone.yml and Dapper ./scripts/

@weyfonk weyfonk requested a review from a team as a code owner February 20, 2024 10:21
@weyfonk weyfonk force-pushed the 2121-replace-drone-pipeline branch 2 times, most recently from aca1c09 to 0d89dfd Compare March 1, 2024 10:12
.goreleaser.yml Outdated Show resolved Hide resolved
.goreleaser.yml Outdated Show resolved Hide resolved
.goreleaser.yml Outdated Show resolved Hide resolved
@@ -10,6 +11,10 @@ FROM base AS copy_buildx
ONBUILD ARG TARGETARCH
ONBUILD COPY bin/fleetcontroller-linux-${TARGETARCH} /usr/bin/fleetcontroller

FROM base AS copy_goreleaser
ONBUILD ARG ARCH
ONBUILD COPY fleetcontroller-linux-${ARCH} /usr/bin/fleetcontroller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is needed because of no_unique_dist_dirs?

Previously:

fleet/package/Dockerfile

Lines 11 to 12 in fb18a5e

FROM base AS copy_goreleaser
ONBUILD COPY fleetcontroller /usr/bin/fleetcontroller

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@weyfonk weyfonk force-pushed the 2121-replace-drone-pipeline branch from 0d89dfd to 3827cb5 Compare March 4, 2024 09:08
@weyfonk weyfonk requested a review from manno March 4, 2024 10:34
@weyfonk weyfonk force-pushed the 2121-replace-drone-pipeline branch from 3827cb5 to 005ad3a Compare March 5, 2024 17:00
This adds a new CI workflow for releasing Fleet via GoReleaser, with
configuration inherited from a previous pull request and extended.

This runs linters, then unit and integration tests, after which it
builds then releases all needed binaries and Docker images for Fleet.

Dockerfiles are adapted to GoReleaser's particularity of building Docker
images using the build directory as context. In this case, we configure
GoReleaser to output all binaries to a common root `dist/` directory, so
that all binaries are available to all Docker image build processes.
This is useful to include eg. both `gitjob` and `gitcloner` binaries in
the `rancher/gitjob` image.

Windows-based images are not supported, and should not be needed anyway
as the Fleet agent is only ever deployed to Linux k8s nodes.
@weyfonk weyfonk force-pushed the 2121-replace-drone-pipeline branch from 005ad3a to ef70466 Compare March 6, 2024 07:45
@weyfonk weyfonk merged commit 95964e7 into rancher:master Mar 6, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants