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

Allow manifest templates to include all the contents while changing version and ref based on core branch properties #4271

Conversation

peterzhuamazon
Copy link
Member

Description

Allow manifest templates to include all the contents while changing version and ref based on core branch properties.

All changes:

  1. Remove very old code which assumes 1.x is the only line with componentsfromsource.
  2. Add all version new templates with proper list of components.
  3. Remove component alternation in favor of directly copy contents from templates, then replace versions and refs before writing to disk.

Thanks.

Issues Resolved

Closes #3707

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dd41a58) 93.16% compared to head (6f5488a) 91.23%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4271      +/-   ##
==========================================
- Coverage   93.16%   91.23%   -1.94%     
==========================================
  Files         189      189              
  Lines        5973     6102     +129     
==========================================
+ Hits         5565     5567       +2     
- Misses        408      535     +127     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Peter Zhu <[email protected]>
templates_base_path = os.path.join(self.manifests_path(), "templates")
template_version_folder = version.split(".")[0] + ".x"
template_full_path = os.path.join(templates_base_path, self.prefix, template_version_folder, "manifest.yml")
if not os.path.exists(template_full_path):
logging.info(f"Not found: {template_full_path}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logging.info(f"Not found: {template_full_path}")
logging.info(f"Manifest template not found: {template_full_path}")

logging.info(f"{component.name}#main is version {release_version} (from {component_version})")

# summarize
logging.info("Found versions on main:")
Copy link
Member

Choose a reason for hiding this comment

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

Won't we be checking the versions on main now?

main_versions[version] = [c]

if component_klass is not None:
# components can increment their own version first without incrementing min
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this logic was not right and not useful that's why it was removed? since components won't be able to increment without min

Copy link
Collaborator

Choose a reason for hiding this comment

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

This was working but only limited to OpenSearch and OpenSearch-Dashboards, please correct me if I am wrong? @peterzhuamazon

@rishabh6788
Copy link
Collaborator

rishabh6788 commented Dec 8, 2023

Looks good but I have a few queries.
Now that we are updating templates with all the components for the workflow to read, update the refs to 2.x branch and write it back for the upcoming release version.
To make it even more simple, why can't we just read last released version input manifest, update the refs to 2.x and write to the new release version manifest? @peterzhuamazon

Also, I did not see where we are confirming whether each component has updated the next release version on 2.x/1.x branch before we update the refs and check in the new input manifest?
If this workflow runs just after 2.12 release, and if I understand the code flow correctly, this workflow will basically add 2.13 input manifest and will update the refs to 2.x (assuming OS/OSD have already updated the versions on their 2.x branch), but it may not be necessary that all the other components have updated the version on their 2.x?

@peterzhuamazon
Copy link
Member Author

peterzhuamazon commented Dec 8, 2023

Hi,

The original setups is assuming there is only 1.x version thus always use the latest one (aka latest patch) as the new template to add components, which is not suitable for now because you cannot use 3.0.0 on 1.x or 2.x.

The original componentfromsource and componentfromdist is useless now as we are not using python to directly call http pull anymore since it is already getting replace with Zelin's incremental build. So that logic is uselss at this point and just add confusing.

The new logic is very simple. If called, get the major version to find the template, copy the entire template and replace version with version, ref with branch. If there is a new entry in the new release, then release manager just add it into the template.

If we dont like the above logic then I would suggest completely remove the template system written by Zelin, and just always pick the latest patch version from the same line.

Thanks.

@rishabh6788
Copy link
Collaborator

Hi,

The original setups is assuming there is only 1.x version thus always use the latest one (aka latest patch) as the new template to add components, which is not suitable for now because you cannot use 3.0.0 on 1.x or 2.x.

The original componentfromsource and componentfromdist is useless now as we are not using python to directly call http pull anymore since it is already getting replace with Zelin's incremental build. So that logic is uselss at this point and just add confusing.

The new logic is very simple. If called, get the major version to find the template, copy the entire template and replace version with version, ref with branch. If there is a new entry in the new release, then release manager just add it into the template.

If we dont like the above logic then I would suggest completely remove the template system written by Zelin, and just always pick the latest patch version from the same line.

Thanks.

What happens when all the other components have not yet updated release version on their respective major version branch, e.g., 2x, do we let the builds for next release version fail for those components?

It is fine for non-critical ones but in case CU or JS don't update their versions on their major branches then even though OS is up-to-date the overall build will keep failing till the critical components also update the release version on their major branches.

If that is the case then we should make sure all the critical components, CU and JS along with Core, also update their versions immediately after release, the rest can follow later.

@gaiksaya
Copy link
Member

gaiksaya commented Jan 4, 2024

It is fine for non-critical ones but in case CU or JS don't update their versions on their major branches then even though OS is up-to-date the overall build will keep failing till the critical components also update the release version on their major branches.

If that is the case then we should make sure all the critical components, CU and JS along with Core, also update their versions immediately after release, the rest can follow later.

+1 I believe even JS CU won't be able to upgrade as almost all plugin's CI dependent on min snapshot artifact and that is only generated once manifest is added to this repo. The flow in current situation looks like this:

  1. OpenSearch repo bumps the version
  2. manifest-update.jenkinsFile detects the change and creates a manifest in build
  3. check-for-build.jenkinsFile detects the change and triggers distribution-build-opensearch job which is responsible for triggering publish-min-snapshot responsible for creating min snapshots that are used in plugin CIs.

Also important note that manifest checks will fail since the code will not be compiled as version increment PRs are not merged.

@peterzhuamazon
Copy link
Member Author

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

Successfully merging this pull request may close these issues.

Add placeholder plugins when auto-generating next version's manifests
4 participants