-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22839][K8S] Remove the use of init-container for downloading remote dependencies #20669
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
Changes from 6 commits
2fefd0e
431a216
1e63ecb
71f4158
9985ee2
a52110a
08def2c
f8f42f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| // scalastyle:off println | ||
| package org.apache.spark.examples | ||
|
|
||
| import java.io.File | ||
|
|
||
| import org.apache.spark.SparkFiles | ||
| import org.apache.spark.sql.SparkSession | ||
|
|
||
| /** Usage: SparkRemoteFileTest [file] */ | ||
| object SparkRemoteFileTest { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, what is the purpose of this specific example?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To test the presence of a remote file being mounted on the executors via the spark-submit being run by the driver. Should I add a Javadoc ( |
||
| def main(args: Array[String]) { | ||
| if (args.length < 1) { | ||
| System.err.println("Usage: SparkRemoteFileTest <file>") | ||
| System.exit(1) | ||
| } | ||
| val spark = SparkSession | ||
| .builder() | ||
| .appName("SparkRemoteFileTest") | ||
| .getOrCreate() | ||
| val sc = spark.sparkContext | ||
| val rdd = sc.parallelize(Seq(1)).map(_ => { | ||
| val localLocation = SparkFiles.get(args(0)) | ||
| println(s"${args(0)} is stored at: $localLocation") | ||
| new File(localLocation).isFile | ||
| }) | ||
| val truthCheck = rdd.collect().head | ||
| println(s"Mounting of ${args(0)} was $truthCheck") | ||
| spark.stop() | ||
| } | ||
| } | ||
| // scalastyle:on println | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason why this is tied to this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, this technically could be a separate PR. I was initially piggy-backing off the work of Marcelo in being able to build Dockerfiles via -f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we separate this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem.