opensearch-project / opensearch-build

🧰 OpenSearch / OpenSearch-Dashboards Build Systems
Apache License 2.0
140 stars 273 forks source link

[Bug]: Distribution incremental build failed on non-supported platform #4545

Closed zelinh closed 2 months ago

zelinh commented 7 months ago

Describe the bug

Recently we noticed this job distribution build job failed on Performance Analyzer on Windows platform. https://build.ci.opensearch.org/blue/organizations/jenkins/distribution-build-opensearch/detail/distribution-build-opensearch/9601/pipeline/75/

2024-03-17 19:09:34 INFO     Removing C:\Users\ContainerAdministrator\tmp34c74y_f

Traceback (most recent call last):

  File "C:\Users\Administrator\jenkins\workspace\distribution-build-opensearch\src\run_build.py", line 112, in <module>

    sys.exit(main())

  File "C:\Users\Administrator\jenkins\workspace\distribution-build-opensearch\src\run_build.py", line 87, in main

    for component in manifest.components.select(focus=components, platform=target.platform):

  File "C:\Users\Administrator\jenkins\workspace\distribution-build-opensearch\src\manifests\input_manifest.py", line 211, in select

    raise ValueError(f"No components matched focus={','.join(focus)}, platform={platform}.")

ValueError: No components matched focus=performance-analyzer, platform=windows.

script returned exit code 1

Performance Analyzer is not supported on windows platform so it shouldn't be built.

Build failure happened when only this non-supported platform component has commits changed when running incremental build.

This one passed https://build.ci.opensearch.org/job/distribution-build-opensearch/9607/ when rebuilding plugins are more than just PA. Plugins for incremental build: ['k-NN', 'performance-analyzer', 'neural-search']

To reproduce

Only one specific plugin has commit changes and run incremental build on this plugin's unsupported platform.

Expected behavior

The build should be skipped if the platform is not supported.

rishabh6788 commented 7 months ago

@zelinh Please take a look.

zelinh commented 6 months ago

There are few ways that I'm thinking could resolve this problem:

  1. We could also add another check in the build_incremental.py class to filter components by the platform. https://github.com/opensearch-project/opensearch-build/blob/4af902438f2faf6aeb7fca6b3e1301c365724589/src/build_workflow/build_incremental.py#L45 In this way, we might need to pass additional platform variable so rebuild_plugins will return a list of components of selected platform.
  2. We could update the select function return here. https://github.com/opensearch-project/opensearch-build/blob/4af902438f2faf6aeb7fca6b3e1301c365724589/src/manifests/input_manifest.py#L211 When the component didn't match because of incompatible platform, this function will log error and fail immediately. We could add a mechanism to pass through.

Personally, I prefer the first approach.

zelinh commented 2 months ago

Closing out this issue as this is resolved.