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

Document a safe unshimming algorithm [skip ci] #6555

Merged
merged 5 commits into from
Sep 14, 2022

Conversation

gerashegalov
Copy link
Collaborator

It is a guide for developers and it should be further automated as the dist jar verification for correct placement of public classes

Current validation for bitwise-identity is just an approximation.

Signed-off-by: Gera Shegalov gera@apache.org

It is a guide for developers and it should be further automated
as the dist jar verification for correct placement of public classes

Current validation for bitwise-identity is just an apporoximation.

Signed-off-by: Gera Shegalov <gera@apache.org>
@gerashegalov gerashegalov added the documentation Improvements or additions to documentation label Sep 13, 2022
@gerashegalov gerashegalov added this to the Sep 5 - Sep 23 milestone Sep 13, 2022
@gerashegalov gerashegalov self-assigned this Sep 13, 2022
@gerashegalov gerashegalov changed the title This PR documents a safe unshimming algorithm This PR documents a safe unshimming algorithm [skip ci] Sep 13, 2022
@gerashegalov
Copy link
Collaborator Author

build

@gerashegalov gerashegalov changed the title This PR documents a safe unshimming algorithm [skip ci] Document a safe unshimming algorithm [skip ci] Sep 14, 2022
Signed-off-by: Gera Shegalov <gera@apache.org>
Copy link
Member

@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.

Thanks for writing up this complicated procedure. For the long-term, would it make sense to:

  • Create a new Maven module that houses our public classes (ShimLoader, SQLPlugin, providers, etc,.).
  • Existing sql-plugin module depends on the new module and no longer supports unshimmed classes (those must be in the new module)

Code in the new module must use ShimLoader to access any sql-plugin classes because they are parallel-world, but sql-plugin code can access the unshimmed classes. This also has the advantage of making it much clearer in the source which classes are publicly advertised and which are hidden in parallel-world.

docs/dev/shims.md Outdated Show resolved Hide resolved
docs/dev/shims.md Outdated Show resolved Hide resolved
docs/dev/shims.md Outdated Show resolved Hide resolved
gerashegalov and others added 3 commits September 14, 2022 08:45
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
Co-authored-by: Jason Lowe <jlowe@nvidia.com>
@gerashegalov
Copy link
Collaborator Author

gerashegalov commented Sep 14, 2022

Thanks for writing up this complicated procedure. For the long-term, would it make sense to:
Hopefully some complexity will go away once fully automated.

  • Create a new Maven module that houses our public classes (ShimLoader, SQLPlugin, providers, etc,.).
  • Existing sql-plugin module depends on the new module and no longer supports unshimmed classes (those must be in the new module)

Code in the new module must use ShimLoader to access any sql-plugin classes because they are parallel-world, but sql-plugin code can access the unshimmed classes. This also has the advantage of making it much clearer in the source which classes are publicly advertised and which are hidden in parallel-world.

Definite +1 on having a separate module without dependencies on the rest of the project for the entry point classes.

This doc will be helpful in creating this API module (#6556) . I would also suggest that we look at the sccmap strongly connected components to create more granular packages, so not everything is in the kitchen sinks like com.nvidia.spark.rapids.

Furthermore, based on the tool derived from this doc, we should create another dynamic list of the unshimmed classes that is pushed into the conventional top location of the jar when the entire connected component is within spark3xx-common. I think the fewer classes we have in the parallel-worlds. the more classes will be defined via the parent classloader, and the fewer are the chances of running into the clasloading issues.

@gerashegalov
Copy link
Collaborator Author

build

@gerashegalov gerashegalov merged commit 771a35d into NVIDIA:branch-22.10 Sep 14, 2022
@gerashegalov gerashegalov deleted the documentUnshimming branch September 14, 2022 18:58
gerashegalov added a commit that referenced this pull request Sep 14, 2022
Fixes formatting bug from #6555 

Signed-off-by: Gera Shegalov <gera@apache.org>
gerashegalov added a commit that referenced this pull request Sep 15, 2022
- Fixes formatting bug from #6555
- Addresses linter issues

Signed-off-by: Gera Shegalov <gera@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants