Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19954#discussion_r157631750
--- Diff:
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/InitContainerBootstrap.scala
---
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+package org.apache.spark.deploy.k8s
+
+import scala.collection.JavaConverters._
+
+import io.fabric8.kubernetes.api.model.{ContainerBuilder,
EmptyDirVolumeSource, EnvVarBuilder, PodBuilder, VolumeMount,
VolumeMountBuilder}
+
+import org.apache.spark.{SparkConf, SparkException}
+import org.apache.spark.deploy.k8s.Config._
+import org.apache.spark.deploy.k8s.Constants._
+
+/**
+ * This is separated out from the init-container steps API because this
component can be reused to
+ * set up the init-container for executors as well.
+ */
+private[spark] trait InitContainerBootstrap {
+ /**
+ * Bootstraps an init-container that downloads dependencies to be used
by a main container.
+ */
+ def bootstrapInitContainer(
+ originalPodWithInitContainer: PodWithDetachedInitContainer)
+ : PodWithDetachedInitContainer
+}
+
+private[spark] class InitContainerBootstrapImpl(
+ initContainerImage: String,
+ dockerImagePullPolicy: String,
+ jarsDownloadPath: String,
+ filesDownloadPath: String,
+ downloadTimeoutMinutes: Long,
+ initContainerConfigMapName: String,
+ initContainerConfigMapKey: String,
+ sparkRole: String,
+ sparkConf: SparkConf)
+ extends InitContainerBootstrap {
+
+ override def bootstrapInitContainer(
+ podWithDetachedInitContainer: PodWithDetachedInitContainer):
PodWithDetachedInitContainer = {
--- End diff --
I commented about this in my previous review, but could you try to use
shorter variable names throughout the PR?
For example, here, just repeating the name of the already long type to name
the variable doesn't really help with readability. Imagine if you have two of
those, are you going to start adding counters to the already long name?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]