← 输入框|github.com|刷新
Skip to content

Fix for https://github.com/polynote/polynote/issues/1009 - #1011

Open
jelmerk wants to merge 2 commits into
polynote:masterfrom
jelmerk:issue1009
Open

jelmerk wants to merge 2 commits into
polynote:masterfrom
jelmerk:issue1009

Conversation

@jelmerk

@jelmerk jelmerk commented Dec 27, 2020 •

Copy link
Copy Markdown

Change that resolves #1009

By default polynote will pass the notebook dependencies to spark via the spark.jars property as urls to the repository manager as shown in the screenshot below

image

This pull request introduces a new element in the spark configuration called jars_as_urls
when set to false it will use files instead as shown in the screenshot below

image

@jelmerk
jelmerk force-pushed the issue1009 branch 2 times, most recently from 467d51b to 5095b51 Compare December 27, 2020 10:12
@jelmerk

jelmerk commented Dec 27, 2020

Copy link
Copy Markdown
Author

The build check is currently failing, but even with my changes reverted it still fails on the same test So I am assuming it's unrelated

None,
None
None,
properties.get("jarsAsUrls").map(_.toLowerCase.trim != "false")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you intend for this to be configurable as a "magic" spark configuration? That's what this does.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No to be honest i just looked at how spark submit args worked and emulated that. I see PolynoteConfigSpec still passes even without this. So i'll remove it

@jeremyrsmith

Copy link
Copy Markdown
Contributor

This LGTM for now. Certainly having a way to control that behavior is better than not having a way. Thanks @jelmerk!

@jonathanindig it looks like there's a new (probably unrelated to this change) failure in the PythonInterpreterSpec, could you take a look?

Let me explain the reason for the current behavior and suggest what I'd like to have in the future. The reason we pass the URLs to spark-submit rather than the local JAR paths is so that each executor can grab them from the repository independently rather than all of the executors having to grab them from the driver (which can significantly slow down the executor startup if you have large dependencies).

Ideally, the decision of how to pass the dependencies to spark-submit could be a function of the repository (e.g. artifacts from this repository are available as URIs to the executor, artifacts from that repository aren't). For password-protected artifacts, we could either offer up the driver's copy (as you're doing here) or potentially (for Spark 2.3+ anyway) use the --packages flag with either --repositories (this might have security implications as the credentials are specified in the repository string) or --conf spark.jars.ivySettings where we'd write out a temporary (and protected) ivy settings file with the user's repository configuration.

Both of those options are a lot of hassle, so I'm fine with just an either-or configuration for now.

@jonathanindig

Copy link
Copy Markdown
Collaborator

@jonathanindig it looks like there's a new (probably unrelated to this change) failure in the PythonInterpreterSpec, could you take a look?

Looks like a new version of jedi was released on Christmas 😓

I'll take a look at what changed (and freeze our CI build dependencies)

@jonathanindig

jonathanindig commented Dec 28, 2020 •

Copy link
Copy Markdown
Collaborator

Ideally, the decision of how to pass the dependencies to spark-submit could be a function of the repository (e.g. artifacts from this repository are available as URIs to the executor, artifacts from that repository aren't).

I think this portion alone could be relatively easy to implement, as we already have a repositories section of the configuration. We could add a flag now and do fancier stuff later.

I think this would make more sense than putting the setting in the Spark config, especially as a global setting would affect, say, S3 paths as well as repository paths.

@jonathanindig

Copy link
Copy Markdown
Collaborator

@jonathanindig it looks like there's a new (probably unrelated to this change) failure in the PythonInterpreterSpec, could you take a look?

Looks like a new version of jedi was released on Christmas 😓

I'll take a look at what changed (and freeze our CI build dependencies)

Fixed now.

Jelmer Kuperus added 2 commits January 3, 2021 18:32
@jelmerk

jelmerk commented Jan 3, 2021

Copy link
Copy Markdown
Author

rebased on top of the current master branch and the build is green now

@jelmerk

jelmerk commented Jan 3, 2021

Copy link
Copy Markdown
Author

Ideally, the decision of how to pass the dependencies to spark-submit could be a function of the repository (e.g. artifacts from this repository are available as URIs to the executor, artifacts from that repository aren't).

I think this portion alone could be relatively easy to implement, as we already have a repositories section of the configuration. We could add a flag now and do fancier stuff later.

I think this would make more sense than putting the setting in the Spark config, especially as a global setting would affect, say, S3 paths as well as repository paths.

Is this alternative more to your liking ?

#1019

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloading dependencies from password protected repository managers is broken

3 participants