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

jenkins: preparations to upload and serve artifacts #161

Merged
merged 5 commits into from
May 31, 2024
Merged

Conversation

flokli
Copy link
Collaborator

@flokli flokli commented May 24, 2024

Depends on #160, will be rebased once merged (so ignore the first 2 commits).

This adds the necessary services running on the jenkins-controller machine to upload and serve artifacts from Azure storage.

  • A per-environment storage container for artifacts is added via terraform
  • Two rclone services exposing the bucket contents, rw and ro, plus config to expose the ro part via caddy.
  • Our rclone gains another patch/feature, support to connect to webdav backends via unix domain sockets, and that rclone is made available in jenkins' $PATH.

@henrirosten

This comment was marked as off-topic.

@flokli

This comment was marked as off-topic.

@flokli
Copy link
Collaborator Author

flokli commented May 27, 2024

Disabling the setup wizard is done in #160, this is unrelated to this PR.

@flokli
Copy link
Collaborator Author

flokli commented May 30, 2024

Drafting until #160 is merged.

@flokli flokli marked this pull request as draft May 30, 2024 15:23
henrirosten and others added 4 commits May 31, 2024 09:46
Adds per-environment storage account and storage container for
storing Jenkins artifacts.

Signed-off-by: Florian Klink <[email protected]>
This adds two rclone services, one for uploads, one for browsing.

Both listen on unix sockets. The first one is used by (and limited to)
Jenkins to upload artifacts, the second one is exposed (over HTTPS)
through caddy, exposing artifacts at the /artifacts/* subpath.

Signed-off-by: Florian Klink <[email protected]>
rclone also doesn't support connecting to a webdav endpoint that's
exposed via an HTTP socket, so apply that patch too.

The feature also has been sent upstream, we link to the PR, but vendor a
patch, as it doesn't apply cleanly on our rclone version.

Signed-off-by: Florian Klink <[email protected]>
We'll shell out to our patched rclone from the pipeline definition.

Signed-off-by: Florian Klink <[email protected]>
@flokli flokli force-pushed the jenkins-artifacts branch from 19119e5 to 303dfaa Compare May 31, 2024 07:47
@flokli
Copy link
Collaborator Author

flokli commented May 31, 2024

With #160 merged, I rebased this.

@flokli flokli marked this pull request as ready for review May 31, 2024 07:47
@henrirosten henrirosten requested a review from a team May 31, 2024 07:49
@flokli
Copy link
Collaborator Author

flokli commented May 31, 2024

Corresponding pipeline PR: tiiuae/ghaf-jenkins-pipeline#25

@flokli flokli force-pushed the jenkins-artifacts branch from f66236b to 496d949 Compare May 31, 2024 10:21
We don't want to cache directory listings for 5 minutes (the default),
as that will mean artifacts won't be visible for way too long.

Set to 5 secs, which will still give us some request deduplication, but
not too much.

We cannot apply this to the binary cache configs yet, as rclone seems to
always want to fetch a listing, which is very slow for that.

Signed-off-by: Florian Klink <[email protected]>
@flokli flokli force-pushed the jenkins-artifacts branch from 496d949 to 14cac75 Compare May 31, 2024 10:24
@henrirosten
Copy link
Collaborator

henrirosten commented May 31, 2024

Reviewed and verified working by deploying to a private environment.

I guess once this is merged, and all the Jenkins pipelines are changed to no longer use the archiveArtifacts, we could also downsize the Jenkins disk to something more reasonable. But that needs to happen in a follow-up PR later.

@flokli
Copy link
Collaborator Author

flokli commented May 31, 2024

Yeah, that's blocked on everything being switched over, and we might need to schedule some time to properly sync some existing state (if we want to keep the disk contents)

@flokli flokli merged commit a0a970c into main May 31, 2024
2 checks passed
@flokli flokli deleted the jenkins-artifacts branch May 31, 2024 12:08
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.

2 participants