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

Move periodic job to ES repo #48570

Merged
merged 10 commits into from
Nov 13, 2019
Merged

Move periodic job to ES repo #48570

merged 10 commits into from
Nov 13, 2019

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented Oct 28, 2019

Add the first job definition to the ES repo.
The goal is to move them all, this one paves the way.

Relates to https://github.com/elastic/infra/issues/15187

This change kickstarts the process of moving CI job definitions to this
repo.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

This looks fine, but could you please add a README to .ci or .ci/jobs.t explaining the format of the yml files? I believe they are jjb, but to someone unfamiliar with the CI setup that would not be obvious.

@@ -0,0 +1,11 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should have a .ci/scripts directory? Seems we are accumulating a lot of different shell scripts all at the root.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. I'll move that in the next iteration, when I have to re-test this anyhow.

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 29, 2019

This looks fine, but could you please add a README to .ci or .ci/jobs.t explaining the format of the yml files? I believe they are jjb, but to someone unfamiliar with the CI setup that would not be obvious.

I definitely want to add some documentation for this ... It's JJBN the tool that wraps JJB but I think I'll just like to the lather, as the syntax is very similar and the former link is not public.

.ci/README.md Outdated Show resolved Hide resolved
.ci/README.md Outdated Show resolved Hide resolved
reference-repo: "/var/lib/jenkins/.git-references/elasticsearch.git"
branches:
- "%BRANCH%"
url: "https://github.com/atorok/elasticsearch.git"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be the main repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!

alpar-t and others added 4 commits October 29, 2019 14:31
Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>
Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>
Jobs live in the [jobs.t](jobs.t) directory, these are defined in YML using a syntax
simmilar to [JJB](https://elasticsearch-ci.elastic.co/view/Elasticsearch%20master/).
Macros are not allowed, and each job must be defined in its own file.
Merging of the default configuration is customized so unlike in standard JJB,
Copy link
Contributor

Choose a reason for hiding this comment

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

Merging of the default configuration is customized so unlike in standard JJB, it recurses into YML objects.

This makes me so happy. The behavior in JJB was infuriating.

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

Left some comments. I'm still a little tentative about this one. Seems like there are some significant tradeoffs with JJBB. Let's see if it's worthwhile in the end.

Also how does this work in practice? Will Jenkins automatically pick up this job as soon as this is merged? Do we have to somehow tell Jenkins to look for job definitions here? How does this work for pull requests? How do we whitelist/blacklist branches?


CI is run by Jenkins at [elasticsearch-ci](https://elasticsearch-ci.elastic.co/).
Jobs live in the [jobs.t](jobs.t) directory, these are defined in YML using a syntax
simmilar to [JJB](https://elasticsearch-ci.elastic.co/view/Elasticsearch%20master/).
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the differences vs "vanilla" JJB? Is there some documentation in the infra repo we can link to here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is but I didn't want to include it because it's not public.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would that be so bad? External folks would just get denied.

.ci/jobs.t/defaults.yml Outdated Show resolved Hide resolved
JAVA12_HOME=$HOME/.java/openjdk12
JAVA13_HOME=$HOME/.java/openjdk13
- shell: |
#!/usr/local/bin/runbld --redirect-stderr {runbld_args}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does JJB support parameterization? What does {runbld_args} evaluate to here? I suspect this is just copy/paste leftovers from the original builder macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are correct, I changed it to default to last good commit.
We could also drop the shell part to have no default, maybe that would be less confusing

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I think if the expectation is that the shell bit is always overridden then having a default might not make sense.

fail: true
- ansicolor
- timestamps
# TODO: No support un JJBB ?
Copy link
Contributor

Choose a reason for hiding this comment

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

We had to use a custom JJB module for this one. I'm not sure how that translate to JJBB. We need to sort this out though as this is how we gather published build scans from Jenkins. Without this HOMER won't be able to find build scans either so this is a show stopper IMO unless we can sort it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was planing on sorting this out before I remove the job from the .ci repo.
Right now it's ok to be missing the notifications because this will be an additional job, the purpose is to make sure all the mechanics of creating and updating the jobs work.

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 30, 2019

@mark-vieira see https://github.com/elastic/infra/pull/15687 as a starting point on how this works. TL;DR is that there are jobs on the infra side that trigger when the configuration changes and these get deployed automatically.
PR jobs will be defined on one branch only, but maybe we can find a way to tell Jenkins to pick jobs based on the target branch. The jobs are not loaded / tested as part of PRs.
The list of active branches lives on the infra side just as before.

For me these are the clear advantages:

  • we can have per branch job configuration that lives with the build. there are some changes that we can't easily roll out without this, like running the packaging tests on nested virtualization, because 6.8 doesn't have the build changes to support it.
  • one job per file makes for a nicer overview and lack of macros makes the configuration easier to understand.
  • we don't have to create PRs in multiple branches when changing build and CI, and don't have to wait for someone to merge CI related changes
  • should we move to some other CI, the lack of macros and one job per file should make it easier than what we have with JJB so the work here isn't completely lost.

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 30, 2019

@elasticmachine update branch

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 30, 2019

@elasticmachine run elasticsearch-ci/2 and run elasticsearch-ci/1

@mark-vieira
Copy link
Contributor

we don't have to create PRs in multiple branches when changing build and CI, and don't have to wait for someone to merge CI related changes

How is this synchronized? I suspect there's no coordination between the JJBB job that updates the job definitions and the commit jobs. So we still might need to be careful here, or just live with the fact that we'll get some initial failures because we pushed a build config change that depends on a job config change that hasn't yet been deployed.

@mark-vieira
Copy link
Contributor

should we move to some other CI, the lack of macros and one job per file should make it easier than what we have with JJB so the work here isn't completely lost.

Or we could move to another CI system that doesn't have this same limitation 😉

@alpar-t
Copy link
Contributor Author

alpar-t commented Oct 31, 2019

@mark-vieira are you saying we should drop this for now ? Keep the jobs in the infra repo until we have smth better ?

@polyfractal polyfractal added v7.4.3 and removed v7.4.2 labels Oct 31, 2019
@mark-vieira
Copy link
Contributor

@mark-vieira are you saying we should drop this for now ? Keep the jobs in the infra repo until we have smth better ?

No, definitely not. I think there are clear benefits here that more than likely outweigh the limitations. My above comment was mostly jest. I'm hoping eventually we find a solution w/o such limitation but for now let's push forward.

@alpar-t
Copy link
Contributor Author

alpar-t commented Nov 11, 2019

@elasticmachine update branch

@jimczi jimczi removed the v7.5.0 label Nov 12, 2019
@alpar-t alpar-t merged commit 91b0ac3 into elastic:master Nov 13, 2019
@alpar-t alpar-t deleted the convert-jjbb branch November 13, 2019 15:12
alpar-t added a commit that referenced this pull request Nov 13, 2019
* Move periodic job to ES repo

This change kickstarts the process of moving CI job definitions to this
repo.

* Added a minimal readme to provide pointers to the documentation

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* point to main repo

* PR review

* Add link to JJBB
alpar-t added a commit that referenced this pull request Nov 13, 2019
* Move periodic job to ES repo

This change kickstarts the process of moving CI job definitions to this
repo.

* Added a minimal readme to provide pointers to the documentation

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* point to main repo

* PR review

* Add link to JJBB
alpar-t added a commit that referenced this pull request Nov 13, 2019
* Move periodic job to ES repo

This change kickstarts the process of moving CI job definitions to this
repo.

* Added a minimal readme to provide pointers to the documentation

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* point to main repo

* PR review

* Add link to JJBB
alpar-t added a commit that referenced this pull request Nov 13, 2019
* Move periodic job to ES repo

This change kickstarts the process of moving CI job definitions to this
repo.

* Added a minimal readme to provide pointers to the documentation

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* Update .ci/README.md

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>

* point to main repo

* PR review

* Add link to JJBB
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v6.8.5 v7.4.3 v7.6.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants