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

Dynamic Shim Detection for build Process [databricks] #11308

Merged
merged 50 commits into from
Sep 6, 2024

Conversation

razajafri
Copy link
Collaborator

@razajafri razajafri commented Aug 8, 2024

This PR removes most of the profiles from pom.xml that we used to maintain the snapshots and such manually

We now call a Python script that parses the pom.xml and creates the snapshots and non-snapshots releases from the release profiles in pom.xml avoiding maintenance of separate lists of snapshots.buildvers/noSnapshots.buildvers/snapshotsScala213.buildvers/noSnapshotsScala213.buildvers properties in pom.xml

Example: To get noSnapshots run python build/get_buildvers.py no_snapshots pom.xml. To get the same for Scala2.13 we need to point to the right pom.xml in the scala2.13 folder i.e. scala2.13/pom.xml

To display debug info while shimplify.py is running add -Ddyn.shim.trace=true to the build command to display the debug info.

@razajafri razajafri changed the title Dynamic Shim Detection [databricks] Dynamic Shim Detection for build Process [databricks] Aug 8, 2024
build/buildall Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
Copy link
Contributor

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

Has this been tested for a typical developer build where we're just building for one shim? The build appeared to hang for quite a while (~25secs) at the create-release-properties stage, probably because it's invoking Maven from scratch for every release profile which is not fast. It then subsequently fails in the shimplify stage for the same reasons already identified in the CI premerge workflows. Even if it had proceeded, this seems like it would have likely made the overall build time worse, not better.

@razajafri razajafri marked this pull request as draft August 14, 2024 04:50

if "scala2.13" in pomFile:
no_snapshots = list(filter(lambda x: not x.endswith("cdh"), no_snapshots))
db_release = list(filter(lambda x: x.endswith("db"), no_snapshots))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: new line. try reformat the code for better readability 👍



if __name__ == "__main__":
print(_get_expression(sys.argv[2], sys.argv[1]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: it would be nice to include a clear usage message with a if len(sys.argv) != 3 check, as this will be used directly in some scripts

@razajafri
Copy link
Collaborator Author

I have added profiles so as not to break the prescribed way to build in our CONTRIBUTING guide.

@razajafri
Copy link
Collaborator Author

build

1 similar comment
@razajafri
Copy link
Collaborator Author

build

@NvTimLiu
Copy link
Collaborator

NvTimLiu commented Sep 4, 2024

checking, let me verify to make sure it works for pre-merge/nightly CIs


if __name__ == "__main__":
if len(sys.argv) != 3:
print("get_buildvers.py needs a pom_file location and an buildvers as arguments")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Usually tools have a more formal output

Suggested change
print("get_buildvers.py needs a pom_file location and an buildvers as arguments")
print("usage: get_buildvers.py <pom_file> <buildvers>")
print(' supported buildvers: databricks, no_snapshots, ...')

We can also probably get this for free with optparse if needed

dist/pom.xml Outdated
<phase>generate-sources</phase>
<configuration>
<target xmlns:ac="antlib:net.sf.antcontrib">
<exec executable="python" outputproperty="included_buildvers">
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it necessary to rely on external python process? We have previously used jython for portability

<scriptdef name="validateReducedPom" language="jython">

dist/pom.xml Outdated Show resolved Hide resolved
@NvTimLiu
Copy link
Collaborator

NvTimLiu commented Sep 5, 2024

Verified the nightly CI for scala 2.12 got PASS

There're some trivial CI script issue for scala2.13 build and test, I'll fix them today to make it work with this PR

@NvTimLiu
Copy link
Collaborator

NvTimLiu commented Sep 5, 2024

Verified this PR in CI jobs, CI can PASS along with the CI script update: #11427

@razajafri
Copy link
Collaborator Author

@gerashegalov do you have any more concerns here?

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

LGTM

@razajafri
Copy link
Collaborator Author

build

@razajafri razajafri merged commit 4c2203e into NVIDIA:branch-24.10 Sep 6, 2024
45 checks passed
@razajafri razajafri deleted the dynamic-shim-detection branch September 6, 2024 01:06
@sameerz sameerz added the build Related to CI / CD or cleanly building label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to CI / CD or cleanly building
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants