Skip to content

Fix spark.kubernetes.file.upload.path permission #7148

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ class KyuubiOnKubernetesWithClusterSparkTestsSuite
override def beforeAll(): Unit = {
super.beforeAll()
val fs = FileSystem.get(getHadoopConf)
fs.mkdirs(
FileSystem.mkdirs(
fs,
new Path("/spark"),
new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL))
fs.setPermission(new Path("/"), new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL))
fs.setPermission(new Path("/spark"), new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL))
fs.copyFromLocalFile(new Path(driverTemplate.getPath), new Path("/spark/driver.yml"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ class SparkProcessBuilder(
fs = path.getFileSystem(hadoopConf)
if (!fs.exists(path)) {
info(s"Try creating $KUBERNETES_FILE_UPLOAD_PATH: $uploadPath")
fs.mkdirs(path, KUBERNETES_UPLOAD_PATH_PERMISSION)
// SPARK-30860: use the class method to avoid the umask causing permission issues
FileSystem.mkdirs(fs, path, KUBERNETES_UPLOAD_PATH_PERMISSION)
}
} catch {
case ioe: IOException =>
Expand Down Expand Up @@ -410,7 +411,8 @@ object SparkProcessBuilder {
final val INTERNAL_RESOURCE = "spark-internal"

final val KUBERNETES_FILE_UPLOAD_PATH = "spark.kubernetes.file.upload.path"
final val KUBERNETES_UPLOAD_PATH_PERMISSION = new FsPermission(Integer.parseInt("777", 8).toShort)
final val KUBERNETES_UPLOAD_PATH_PERMISSION =
FsPermission.createImmutable(Integer.parseInt("777", 8).toShort)

final val YEAR_FMT = DateTimeFormatter.ofPattern("yyyy")
final val MONTH_FMT = DateTimeFormatter.ofPattern("MM")
Expand Down
Loading