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

Make packer cache branches explicit #41990

Merged
merged 7 commits into from
May 22, 2019

Conversation

alpar-t
Copy link
Contributor

@alpar-t alpar-t commented May 9, 2019

Before this change we would recurse to cache bwc versions.
This proved to be problematic due to the number of steps it was
generating taking too long.
Also this required tricky maintenance to break the recursion for old
branches we don't really care about.

With this change we now cache specific branches only.

Before this change we would recurse to cache bwc versions.
This proved to be problematic due to  the number of steps it was
generating taking too long.
Also this required tricky maintenance to break the recursion for old
branches we don't really care about.

With this change we now cache specific branches only.
@alpar-t alpar-t added >non-issue :Delivery/Build Build or test infrastructure v8.0.0 labels May 9, 2019
@alpar-t alpar-t requested a review from mark-vieira May 9, 2019 06:38
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@alpar-t
Copy link
Contributor Author

alpar-t commented May 9, 2019

@elasticmachine run elasticsearch-ci/1

@mark-vieira
Copy link
Contributor

I don't quite follow the motivation for this change. With this change we have yet another place in CI where we are manually tracking branches and needs to be updated when we do major version bumps. This is starting to get out of hand IMO. We really, really, really should be avoiding having hard-coded branches all over the place.

From what I understand the existing logic is using BwcVersions to determine the unreleased versions in development and trigger dependency resolution. How is this different other than being hard-coded rather than dynamic? Are we doing less work? If so we should improve the existing implementation in a way where we can still leverage BwcVesions rather than hard-coding branches in the packer script.

@alpar-t
Copy link
Contributor Author

alpar-t commented May 10, 2019

The previus implementation also requires maintenance as we create new versions, we are not interested to cache some of the old versions, so we have to update them to break the recursion. I think due to the hidden non obvious nature that's worse than calling these out.

We are also doing less work now, because with bwc versions we would do it for both 7.x and 7.1 and when doing it for 7.1 recurse to 7.0.2. All in all I think the recursion there was a bad idea.

I fully agree on dealing with the hard coded version names and finding a solution for that, but that will neither be easy nor quick, and right now the CI images are really old increasing the chances of network failures.

@alpar-t
Copy link
Contributor Author

alpar-t commented May 10, 2019

run elasticsearch-ci/1

@mark-vieira
Copy link
Contributor

We are also doing less work now, because with bwc versions we would do it for both 7.x and 7.1 and when doing it for 7.1 recurse to 7.0.2. All in all I think the recursion there was a bad idea.

We have the known versions though. We can make the resolveAllBwcVersions task smarter and only do so for the versions we care about.

I think this is just another example that our version/branch/bwc logic is starting to get mind bendingly complex. We need to get this under control because I feel like half of the issues we have with CI jobs suddenly failing or acting funny are around release version handling.

@alpar-t
Copy link
Contributor Author

alpar-t commented May 21, 2019

@run elasticsearch-ci/1

@alpar-t
Copy link
Contributor Author

alpar-t commented May 21, 2019

@mark-vieira ready for another review

@@ -124,4 +124,7 @@ public int compareTo(Version other) {
return Integer.compare(getId(), other.getId());
}

public boolean isNextMajor() {
return getRevision() == 0 && getMinor() == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right. A version string without context cannot possibly determine if it is the next major version. This should really live in BwcVersions. For example Version.fromString("7.0.0").isNextMajor() would return true which is obviously incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The method shouldn't exist probably, and we should just do the check directly.
BWC versions doesn't know about newer versions, e.x on 6.8 there's no way to know how far we'we got. That being said we have used x.0.0 to identify master, as we will never build ex 7.0.0 as soon as it's released we version bump and the branch becomes 7.0.1. This would break down only when we have a major staged (as we had before 7.0 was released but the 7.x branch cut). This would I think be acceptable for this use-case (without the isNextMajor method of course). WDYT @mark-vieira ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be ok with renaming this something more pedantically accurate like isNewMajor().

@mark-vieira mark-vieira merged commit c9d04cc into elastic:master May 22, 2019
@mark-vieira
Copy link
Contributor

@atorok does this actually need to be backported? As far as I can tell the packer images checkout only master.

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 22, 2019
…sertion

* elastic/master:
  Make packer cache branches explicit (elastic#41990)
  Re-mute all ml_datafeed_crud rolling upgrade tests
  Ensure testAckedIndexing uses disruption index settings
  add 7_3 as version (elastic#42368)
  Fix grammar problem in stemming reference. (elastic#42148)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 22, 2019
…search-remote-settings

* elastic/master:
  Make packer cache branches explicit (elastic#41990)
  Re-mute all ml_datafeed_crud rolling upgrade tests
  Ensure testAckedIndexing uses disruption index settings
  add 7_3 as version (elastic#42368)
  Fix grammar problem in stemming reference. (elastic#42148)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 22, 2019
* elastic/master:
  Make packer cache branches explicit (elastic#41990)
  Re-mute all ml_datafeed_crud rolling upgrade tests
  Ensure testAckedIndexing uses disruption index settings
  add 7_3 as version (elastic#42368)
  Fix grammar problem in stemming reference. (elastic#42148)
@alpar-t
Copy link
Contributor Author

alpar-t commented May 27, 2019

@mark-vieira yes, so the bwc checkouts don't recourse too much when resolving dependencies. I'm going to do the back-ports now.

alpar-t added a commit that referenced this pull request May 27, 2019
Before this change we would recurse to cache bwc versions.
This proved to be problematic due to  the number of steps it was
generating taking too long.
Also this required tricky maintenance to break the recursion for old
branches we don't really care about.

With this change we now cache specific branches only.
@alpar-t alpar-t removed the v6.8.1 label May 27, 2019
alpar-t added a commit that referenced this pull request May 27, 2019
Before this change we would recurse to cache bwc versions.
This proved to be problematic due to  the number of steps it was
generating taking too long.
Also this required tricky maintenance to break the recursion for old
branches we don't really care about.

With this change we now cache specific branches only.
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Before this change we would recurse to cache bwc versions.
This proved to be problematic due to  the number of steps it was
generating taking too long.
Also this required tricky maintenance to break the recursion for old
branches we don't really care about.

With this change we now cache specific branches only.
@mark-vieira
Copy link
Contributor

@atorok Can you point me at where this script is run for older branches? It looks like this is the bit that runs the script during the packer builds. It's not clear to me that anything other than the version in master is ever used.

@alpar-t alpar-t deleted the speed-up-packer-cache-script branch May 28, 2019 05:18
@alpar-t
Copy link
Contributor Author

alpar-t commented May 28, 2019

@mark-vieira that is the only place that calls the script, but we do bwc checkouts as part of that when run on master and call resolveAllDependencies on those. Without back-porting this change that will recurse too far. That's what this PR is meant to prevent, thus the condition of checking if we are running on master. Essentially we are only caching the live versions of Master now. This does mean we are missing the latest bugfix in the caches.

@mark-vieira
Copy link
Contributor

Ah, of course. I understand now.

@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 >non-issue Team:Delivery Meta label for Delivery team v7.3.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants