-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Cronjob that creates artificial traffic for new preview environments jobs. #12663
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
Conversation
I'm currently failing to configure git in the job 😭 Can you identify anything I'm during wrong? @gitpod-io/platform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment on how I think you can fix the issue you're seeing
echo "[Creating new branch|DONE] Trigger new job with preview environment" | ||
|
||
echo "[Trigger new job with-preview|PHASE] Trigger new job with preview environment" | ||
werft run github -a with-preview=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to poll for the job to finish so we can delete the branch again, otherwise we'll create a ton of branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done a few other places, e.g here's how to workspace integration test jobs currently does it - we'd need something slightly different as we don't care if the preview environment failed or not, we still want to delete the branch.
Alternatively we'd need some other mechanism of deleting old branches. E.g. this job could even just start by delete all branches that match the pattern that are more than x hours old (that might be a more robust way to deal with it actually)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to poll for the job to finish so we can delete the branch again, otherwise we'll create a ton of branches
☺️
I am creating tons of branches but I'm never pushing them to origin
, so it should be fine right? I don't want the previews to stick around anyway, so it will even get cleaned up faster if the branch doesn't get pushed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, I'm surprised this works to be honest 😝 I guess Werft doesn't validate that the Ref actually exist (e.g. refs/heads/platform-artificial-job-7f30eab068977bb4e4d2), and it only really cares about the Revision when checking out the code
The only potential downside I can think of is if we decide to GC the VM because the branch doesn't exist. I can't remember if our heuristics were updated to keep VMs alive for at least 2h
Signed-off-by: ArthurSens <[email protected]>
0c466b0
to
d027176
Compare
Signed-off-by: ArthurSens <[email protected]>
We've got an artificial job running 🙂 https://werft.gitpod-dev.com/job/gitpod-build-platform-artificial-job-7f30eab068977bb4e4d2.0 |
werft log phase "Trigger new job with-preview" "Trigger new job with preview environment" | ||
sudo chown -R gitpod:gitpod /workspace | ||
git config --global user.name roboquat | ||
git config --global user.email [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're not pushing to origin I wonder if we even need these three lines at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it is still needed :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Added hold in case you want to try to remove those git config lines
Description
Once ready, this PR will create a cronjob that triggers new werft jobs which, in their turn, will create new preview environments.
The final goal is that we get a little more traffic for new preview environments, so we can be more proactive when they start failing.
Related Issue(s)
Fixes #
How to test
Release Notes
Documentation
Werft options: