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

Add Jenkinsfile #38565

Merged
merged 1 commit into from
Feb 28, 2019
Merged

Add Jenkinsfile #38565

merged 1 commit into from
Feb 28, 2019

Conversation

dave-tucker
Copy link
Contributor

- What I did

This commit uses the existing jenkins freestyle job configuration to
create a jenkinsfile. This allows the project to use multi-branch
pipelines in jenkins and to allow others to contribute to the CI setup.

- How I did it

Copy/Paste 😉

- How to verify it

A test job: https://jenkins.dockerproject.org/job/dave-tucker/job/jenkinsfile-test/

- Description for the changelog

N/A

- A picture of a cute animal (not mandatory but encouraged)

image

@thaJeztah
Copy link
Member

🎉

@cpuguy83 @olljanat @vdemeester

@olljanat
Copy link
Contributor

olljanat commented Jan 14, 2019

Nice. Now I "just" need study how to install and configure Jenkins...

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 😍
@dave-tucker I ❤️ u ! 🤗

@dave-tucker dave-tucker mentioned this pull request Jan 14, 2019
@dave-tucker
Copy link
Contributor Author

dave-tucker commented Jan 14, 2019

A couple of things to bear in mind 🐻

  1. To ensure this doesn't get merged and bit-rot we should have a clear plan to enable a Jenkins Multi-branch pipeline for moby/moby. This will involve stopping leeroy sending webhooks to the old Jenkins freestyle jobs

  2. To do a rebuild of a PR for a certain job, one will have to use the Jenkins UI. The Multibranch pipeline plugin will create a "branch" each PR. You just need to hit "build", deselect the builds that you don't want and then you are done. In theory this could be automated so the slack/irc style rebuild commands still work.

  3. I've used the checked in powershell script for Windows RS1 CI vs. the one that is in-lined in the Jenkins job as it makes the Jenkinsfile over 1000 lines 😨 This is the same script used for RS5. @jhowardmsft do you think that this would be ok?

  4. There are some inconsistencies between how the bundles.tar.gz is created and how container cleanup happens. It would be nice to fix this but it could be done in a follow up.

  5. I haven't seen a green build just yet. @thaJeztah I might need your help figuring out what is just flaky vs. what's a genuine failure.

@olljanat
Copy link
Contributor

@dave-tucker first of all. Thanks for sharing this config with us. Just to have it visible simplifies many things as we don't need to guess.

  1. To ensure this doesn't get merged and bit-rot we should have a clear plan to enable a Jenkins Multi-branch pipeline for moby/moby. This will involve stopping leeroy sending webhooks to the old Jenkins freestyle jobs
  2. To do a rebuild of a PR for a certain job, one will have to use the Jenkins UI. The Multibranch pipeline plugin will create a "branch" each PR. You just need to hit "build", deselect the builds that you don't want and then you are done. In theory this could be automated so the slack/irc style rebuild commands still work.

I don't know how others want to use this config but I would prefer to move logic to Jenkinsfile to generic bash scripts. First example of that kind of approach is on olljanat@936fc81

On that way:

  • contributors are able to test/debug most common CI related things locally without need to setup Jenkins.
  • we can allow contributors to enable CircleCI to forked repos by including super simple config like this to Moby olljanat@a1dcada (you can see log from test run on here )
  • IMO, we don't necessarily need migrate Jenkins to use Jenkinsfile but instead of just export it to here on documentation purposes as it should need updates very rarely.
  1. I've used the checked in powershell script for Windows RS1 CI vs. the one that is in-lined in the Jenkins job as it makes the Jenkinsfile over 1000 lines fearful This is the same script used for RS5. @jhowardmsft do you think that this would be ok?

I have understood that that logic have been in Jenkins on past and it was moved to PowerShell to simplify local debugging (seen comment on some old PR).

  1. There are some inconsistencies between how the bundles.tar.gz is created and how container cleanup happens. It would be nice to fix this but it could be done in a follow up.

Fixed already on example commit above 😉

  1. I haven't seen a green build just yet. @thaJeztah I might need your help figuring out what is just flaky vs. what's a genuine failure.

At least most common flaky issues are listed on #37306

@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #38565 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #38565      +/-   ##
==========================================
+ Coverage   36.43%   36.44%   +<.01%     
==========================================
  Files         613      613              
  Lines       45847    46481     +634     
==========================================
+ Hits        16706    16941     +235     
- Misses      26849    27155     +306     
- Partials     2292     2385      +93

@dave-tucker
Copy link
Contributor Author

Updated to add a 3 hr timeout to avoid builds staying in a pending state forever.

@dave-tucker
Copy link
Contributor Author

@olljanat I like the bash scripts ❤️

@lowenna
Copy link
Member

lowenna commented Jan 15, 2019

3. I've used the checked in powershell script for Windows RS1 CI vs. the one that is in-lined in the Jenkins job as it makes the Jenkinsfile over 1000 lines 😨 This is the same script used for RS5. @jhowardmsft do you think that this would be ok?

@dave-tucker - yes, hack\ci\windows.ps1 is the right script.

@dave-tucker
Copy link
Contributor Author

I pushed some changes to add a customWorkspace for the Windows builds as I missed this when extracting info from the current Jenkins builds.

Now I think this is good to go 🎉

See: https://jenkins.dockerproject.org/job/dave-tucker/job/jenkinsfile-test/

I've seen it pass at least once on each set of tests.

@dave-tucker dave-tucker changed the title WIP: Add Jenkinsfile Add Jenkinsfile Feb 26, 2019
@cpuguy83
Copy link
Member

java.lang.NoSuchMethodError: No such DSL method 'addFailedStep'

This commit uses the exitings jenkins freestyle job configuration to
create a jenkinsfile. This allows the project to use multi-branch
pipelines in Jenkins and to allow others to contribute to the CI setup.

Signed-off-by: Dave Tucker <[email protected]>
@dave-tucker
Copy link
Contributor Author

Good catch @cpuguy83 - I've just updated this PR to fix that!

@cpuguy83
Copy link
Member

Exception from GitHubCommitStatusSetter for windowsRS5-process: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method hudson.plugins.git.GitSCM getRepositories

@cpuguy83
Copy link
Member

Oh, somehow I grabbed logs from an old run...

@cpuguy83
Copy link
Member

cpuguy83 commented Feb 27, 2019

Oh well, powerpc has the same error on the last run. Seems to be triggered when a particular pipeline step fails.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Let's merge this; the file won't be used for now, as follow-up changes are needed to change the CI config and so on 😇

@thaJeztah thaJeztah merged commit 989d497 into moby:master Feb 28, 2019
@dave-tucker
Copy link
Contributor Author

@cpuguy83 @thaJeztah thanks!

Exception from GitHubCommitStatusSetter for windowsRS5-process: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method hudson.plugins.git.GitSCM getRepositories

This is a quick fix - I just need to add that method to the whitelist in Jenkins...
But if I did that now, then it would start setting commit status for real, which we don't want until we actually do the migration to Jenkins Multibranch Pipelines 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants