Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
needed to define an artifact pattern along with ivy pattern to resolv…
…e all transitive dependencies
  • Loading branch information
BryanCutler committed Jun 1, 2016
commit ece86f1e463707433ccdc34cb5ed10a506da80cb
8 changes: 5 additions & 3 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,12 @@ private[spark] object SparkSubmitUtils {
val localIvy = new FileSystemResolver
val localIvyRoot = new File(ivySettings.getDefaultIvyUserDir, "local")
localIvy.setLocal(true)
localIvy.setRepository(new FileRepository(localIvyRoot))
val ivyPattern = Seq("[organisation]", "[module]", "[revision]", "[type]s",
"[artifact](-[classifier]).[ext]").mkString(File.separator)
val ivyPattern = Seq("[organisation]", "[module]", "[revision]", "ivys",
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we need to keep this for the local IvyCache?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's redundant because the filesystem patterns defined below use an absolute path (with the localIvyRoot) and the resolver then ignores the repository root set here. Only if it determines the patterns are using relative paths it will then prefix them with the root. It doesn't hurt anything to leave it in though, if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Everything else being equal, I'm in favor of leaving this. Maybe it's redundant but it might prevent bugs in case someone else comes along and tries to remove the use of absolute paths below (or forgets to use an absolute path in new code).

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not add localIvyRoot.getAbsolutePath to this list also and remove the concatenation in the following statement?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1.

"ivy.xml").mkString(File.separator)
localIvy.addIvyPattern(localIvyRoot.getAbsolutePath + File.separator + ivyPattern)
val artifactPattern = Seq("[organisation]", "[module]", "[revision]", "[type]s",
"[artifact](-[classifier]).[ext]").mkString(File.separator)
localIvy.addArtifactPattern(localIvyRoot.getAbsolutePath + File.separator + artifactPattern)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

localIvy.setName("local-ivy-cache")
cr.add(localIvy)

Expand Down