You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by jacek-lewandowski <gi...@git.apache.org> on 2014/12/03 06:04:04 UTC

[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

GitHub user jacek-lewandowski opened a pull request:

    https://github.com/apache/spark/pull/3571

    Spark 3883: SSL support for HttpServer and Akka

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jacek-lewandowski/spark SPARK-3883-master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/3571.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3571
    
----
commit 26ca8ecafa7d8f8550cebf8038ade0ffb4a9e9dc
Author: Jacek Lewandowski <le...@gmail.com>
Date:   2014-10-08T23:41:05Z

    SPARK-3883: SSL support for HttpServer and Akka
    
     - Introduced SSLOptions object
     - SSLOptions is created by SecurityManager
     - SSLOptions configures Akka and Jetty to use SSL
     - SSLOptions uses property file which is node-local to set SSL settings
     - Provided utility methods to determine the proper Akka protocol for Akka requests and to configure SSL socket factory for URL connections
     - Added tests cases for AkkaUtils, FileServer, SSLOptions and SecurityManager
    
    Conflicts:
    	core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
    	core/src/main/scala/org/apache/spark/scheduler/cluster/SparkDeploySchedulerBackend.scala
    	core/src/main/scala/org/apache/spark/util/AkkaUtils.scala
    	core/src/main/scala/org/apache/spark/util/Utils.scala
    	core/src/test/scala/org/apache/spark/FileServerSuite.scala
    	core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala
    	core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala
    	repl/src/main/scala/org/apache/spark/repl/SparkIMain.scala
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala

commit 485d2dab5c42e2ac9a4d202df8375ed388dc0e15
Author: Jacek Lewandowski <le...@gmail.com>
Date:   2014-10-21T10:02:35Z

    SPARK-3883: Fixes after the review
    
    - Removed license header from ssl.conf.template
    - Fixed parameters order in SSLOptions.parse invocation in SecurityManager at L199
    - Replaced org.apache.commons.io with different approaches
    - Removed unused line of code from SecurityManager
    - Changed the default protocol from SSLv3 to TLSv1.2 (POODLE attack)

commit c32230850c7ccd8b828af65f1d1f99f79f7abeeb
Author: Jacek Lewandowski <ja...@datastax.com>
Date:   2014-10-23T20:12:31Z

    SPARK-3883: Added ssl.conf.template to .rat-excludes
    Conflicts:
    	.rat-excludes

commit 54aad3d7ccd5ecef12db8064c10f9372bd601849
Author: Jacek Lewandowski <le...@gmail.com>
Date:   2014-12-02T14:51:54Z

    SPARK-3883: Additional changes after rebasing onto branch-1.2

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69080405
  
    Ahhh !!! That can be the problem, I always tried with Java 7. Thanks @vanzin, I'll try with Java 6 now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813343
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    --- End diff --
    
    nit: the convetion for placing arguments in multiple lines is like this:
    
        private[spark] case class SSLOptions(
            enabled: Boolean = false,
            keyStore: Option[File] = None,
            (etc etc)
    
    Basically, two indent levels past the previous line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036138
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -196,6 +201,43 @@ private[spark] class SecurityManager(sparkConf: SparkConf) extends Logging with
         )
       }
     
    +  private[spark] val sslOptions = SSLOptions.parse(sparkConf, "spark.ssl")
    +
    +  private[spark] val (sslSocketFactory, hostnameVerifier) = if (sslOptions.enabled) {
    +    val trustStoreManagers =
    +      for (trustStore <- sslOptions.trustStore) yield {
    +        val ks = KeyStore.getInstance(KeyStore.getDefaultType)
    +        ks.load(Files.asByteSource(sslOptions.trustStore.get).openStream(),
    +          sslOptions.trustStorePassword.get.toCharArray)
    +
    +        val tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm)
    +        tmf.init(ks)
    +        tmf.getTrustManagers
    +      }
    +
    +    lazy val credulousTrustStoreManagers = Array({
    +      logWarning("Using 'accept-all' trust manager for SSL connections.")
    +      new X509TrustManager {
    +        override def getAcceptedIssuers: Array[X509Certificate] = null
    +
    +        override def checkClientTrusted(x509Certificates: Array[X509Certificate], s: String) {}
    +
    +        override def checkServerTrusted(x509Certificates: Array[X509Certificate], s: String) {}
    +      }: TrustManager
    +    })
    +
    +    val sslContext = SSLContext.getInstance(sslOptions.protocol.getOrElse("Default"))
    +    sslContext.init(null, trustStoreManagers getOrElse credulousTrustStoreManagers, null)
    --- End diff --
    
    nit: missing `.` for the method calls (i.e. "don't use postfix ops")


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72560603
  
    Jenkins, retest this please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69093841
  
    It seems that Java on OSX has some different cipher suite...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72441237
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26510/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69057121
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25166/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72029311
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26317/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72016441
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26314/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72575069
  
    I've fixed the documentation formatting nits myself, so I'm going to merge this into `master` (1.3.0).  Thanks @jacek-lewandowski for all of your hard work on this feature and to @vanzin for your help reviewing this patch!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69090916
  
    If I remove `TLS_RSA_WITH_AES_256_CBC_SHA` from the list of ciphers in `SSLSampleConfigs.scala`, most tests pass for me. "remote fetch ssl on - untrusted server" fails, but that doesn't seem to be because of the code, but because it's expecting the wrong exception (so a test issue).
    
    Another interesting point: if I comment out `spark.ssl.enabledAlgorithms` altogether, then the tests seem to timeout.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70258426
  
      [Test build #25661 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25661/consoleFull) for   PR 3571 at commit [`271d166`](https://github.com/apache/spark/commit/271d16663020386fdc02a6314ee293c9a51bd452).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71112931
  
    @vanzin it is low hanging fruit to achieve that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72551467
  
    Jenkins, retest this please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964277
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -142,9 +148,39 @@ import org.apache.spark.network.sasl.SecretKeyHolder
      *  authentication. Spark will then use that user to compare against the view acls to do
      *  authorization. If not filter is in place the user is generally null and no authorization
      *  can take place.
    + *
    + *  Connection encryption (SSL) configuration is organized hierarchically. The user can configure
    + *  the default SSL settings which will be used for all the supported communication protocols unless
    + *  they are overwritten by protocol specific settings. This way the user can easily provide the
    + *  common settings for all the protocols without disabling the ability to configure each one
    + *  individually.
    + *
    + *  All the SSL settings like `spark.ssl.xxx` where `xxx` is a particular configuration property,
    + *  denote the global configuration for all the supported protocols. In order to override the global
    + *  configuration for the particular protocol, the properties must be overwritten in the
    + *  protocol-specific namespace. Use `spark.ssl.yyy.xxx` settings to overwrite the global
    + *  configuration for particular protocol denoted by `yyy`. Currently `yyy` can be either `akka` for
    + *  Akka based connections or `fs` for broadcast and file server.
    + *
    + *  Refer to [[org.apache.spark.SSLOptions]] documentation for the list of
    + *  options that can be specified.
    + *
    + *  SecurityManager initializes SSLOptions objects for different protocols separately. SSLOptions
    + *  object parses Spark configuration at a given namespace and builds the common representation
    + *  of SSL settings. SSLOptions is the used to provide protocol-specific configuration like TypeSafe
    --- End diff --
    
    "the used" -> "then used"?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70324262
  
    @andrewor14 can you take a look tell me what's next?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67519339
  
    It could work if `DriverWrapper` and `CoarseGrainedExecutorBackend` would load the daemon's configuration file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67978058
  
      [Test build #24741 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24741/consoleFull) for   PR 3571 at commit [`ff5a776`](https://github.com/apache/spark/commit/ff5a776194cbda08461a81b74d62e5107233d970).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67984571
  
    @jacek-lewandowski my understanding is that you don't need the master to know the public key of every executor. The master can either disable cert validation, or have a CA cert in its trust store that can then be used by an admin to sign the user's certificate, which the user can then use in his app.
    
    If you do something like that, a default configuration for apps wouldn't work, because each app can potentially have a different certificate. I can see this being particularly desirable for long-runnning apps such as Spark Streaming.
    
    Also, it seems there are legitimate style check failures in your patch - that's why tests aren't running.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72560136
  
    I don't get why the tests failed. I only added documentation!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72540829
  
    @jacek-lewandowski Thanks for updating this.  I'd like to merge this patch today so that it's included in the first 1.3.0 snapshot / preview.  If you have time, it would be great if you could add some documentation for the new configurations (and update the big block comment at the top of SecurityManager.scala to reflect the changes here).  If you're too busy to do this, though, just let me know and we can merge this without documentation and add it before the first release candidate (this patch touches a bunch of core stuff, so I want the code changes here to be merged so they're exercised during our first rounds of testing).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69087034
  
    The tests create a file `unit-tests.log` it target directory. It would very helpful if I can access that file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69093277
  
      [Test build #25171 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25171/consoleFull) for   PR 3571 at commit [`07396e6`](https://github.com/apache/spark/commit/07396e6652c2bcda109aec98f9e2e833cda107c9).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69085821
  
    How did I get it? I ran the test. I changed it to TLSv1, but that shouldn't make a difference.
    
    Are you absolutely sure you don't have anything in your environment that could be affecting this? Like a `SPARK_*` env variable pointing to some other config, or some file you forgot to add to your repo, or something like that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22921061
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    +                                     keyStorePassword: Option[String] = None,
    +                                     keyPassword: Option[String] = None,
    +                                     trustStore: Option[File] = None,
    +                                     trustStorePassword: Option[String] = None,
    +                                     protocol: Option[String] = None,
    +                                     enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"spark.ssl.enabled", defaultValue = false)
    --- End diff --
    
    They are leftover of the previous namespaces... will fix it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138389
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,119 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import scala.util.Try
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +private[spark] case class SSLOptions(
    +    enabled: Boolean = false,
    +    keyStore: Option[File] = None,
    +    keyStorePassword: Option[String] = None,
    +    keyPassword: Option[String] = None,
    +    trustStore: Option[File] = None,
    +    trustStorePassword: Option[String] = None,
    +    protocol: Option[String] = None,
    +    enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +  override def toString: String = s"SSLOptions{enabled=$enabled, " +
    +      s"keyStore=$keyStore, keyStorePassword=${keyStorePassword.map(_ => "xxx")}, " +
    +      s"trustStore=$trustStore, trustStorePassword=${trustStorePassword.map(_ => "xxx")}, " +
    +      s"protocol=$protocol, enabledAlgorithms=$enabledAlgorithms}"
    +
    +}
    +
    +object SSLOptions extends Logging {
    --- End diff --
    
    This object should also be `private[spark]`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72549420
  
    @jacek-lewandowski Thanks for adding docs; I'll look over them now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69791868
  
    Yes, the framework can distribute the files, but if would be nice for Spark to automatically do it if SSL is enabled, instead of requiring the user to manually list the files in the spark-submit command line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138589
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala ---
    @@ -20,30 +20,48 @@ package org.apache.spark.deploy.master
     import akka.actor.Address
     import org.scalatest.FunSuite
     
    -import org.apache.spark.SparkException
    +import org.apache.spark.{SparkConf, SparkException}
     
     class MasterSuite extends FunSuite {
     
       test("toAkkaUrl") {
    -    val akkaUrl = Master.toAkkaUrl("spark://1.2.3.4:1234")
    +    val conf = new SparkConf(loadDefaults = false)
    --- End diff --
    
    `loadDefaults = false` is a nice touch; we should probably do this in more of our unit tests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72544044
  
    @JoshRosen I've just added the documentation. I hope there is enough of it :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69098911
  
      [Test build #25174 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25174/consoleFull) for   PR 3571 at commit [`23a834d`](https://github.com/apache/spark/commit/23a834d7ea90c8908fd326e202dd93faa0fd6ac2).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67722678
  
    Hi @jacek-lewandowski ,
    
    I think that's an improvement (assuming that you'd remove all the code dealing with the separate ssl.conf, which is still there), but there's still something I'm no seeing. How are the SSL properties propagated from the launcher to the executors?
    
    If I set different options in my launcher that do not match those in the worker's configuration, it seems that things will fail with your new code.
    
    The reason why I pointed out the Yarn code is because that's exactly what it does. The properties you set *in your launch process* are used by the executors. You don't need to configure anything on the edge nodes. In standalone mode, of course you need to configure the worker daemons themselves, but you don't need to manage *client* configuration in every worker node.
    
    Anyway, it seems you're not planning to handle Yarn in this change at all (I didn't notice any changes there?), so we can always treat that as a future enhancement. I'll let other reviewers chime in on whether they think this limitation is acceptable in standalone mode. If I misunderstood something about your code, apologies, and please correct me!
    
    Looking at just the last commit, the only comment I had was the somehow confouding use of `SparkModule` and `namespace`. It doesn't seem like the `SparkModule` type is adding much functionality here... also, I'd rather keep the config for master/worker and the config for the history server in separate namespaces, although that's not a big deal (since you can use different config files to achieve the same thing).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69061231
  
      [Test build #25165 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25165/consoleFull) for   PR 3571 at commit [`b50e7dc`](https://github.com/apache/spark/commit/b50e7dc034bfee3d31541093882166469639cd90).
     * This patch **fails Spark unit tests**.
     * This patch **does not merge cleanly**.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67998860
  
    @vanzin what about this failure? This what was thrown before and I have no idea what is the reason because I cannot replicate it locally.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138694
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    --- End diff --
    
    Nit: put the Scalatest import in its own section.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69142272
  
      [Test build #25203 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25203/consoleFull) for   PR 3571 at commit [`b5c965d`](https://github.com/apache/spark/commit/b5c965defa64c8e68f530ab5806104bd448829ce).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813518
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    +                                     keyStorePassword: Option[String] = None,
    +                                     keyPassword: Option[String] = None,
    +                                     trustStore: Option[File] = None,
    +                                     trustStorePassword: Option[String] = None,
    +                                     protocol: Option[String] = None,
    +                                     enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"spark.ssl.enabled", defaultValue = false)
    +    val keyStore = Try(conf.get(s"$ns.keyStore")).toOption.map(new File(_))
    +    val keyStorePassword = Try(conf.get(s"$ns.keyStorePassword")).toOption
    +    val keyPassword = Try(conf.get(s"$ns.keyPassword")).toOption
    +    val trustStore = Try(conf.get(s"$ns.trustStore")).toOption.map(new File(_))
    +    val trustStorePassword = Try(conf.get(s"$ns.trustStorePassword")).toOption
    +    val protocol = Try(conf.get(s"$ns.protocol")).toOption
    +    val enabledAlgorithms = Try(conf.get(s"$ns.enabledAlgorithms")).toOption
    --- End diff --
    
    nit: `toOption` is probably redundant here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70131914
  
    @jacek-lewandowski I can only review the code, you need a committer to be able to move forward. e.g. @andrewor14 @JoshRosen 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69154552
  
      [Test build #25215 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25215/consoleFull) for   PR 3571 at commit [`937d839`](https://github.com/apache/spark/commit/937d8399b6c171368f5cca8345b13da0fa68d744).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-68003411
  
    The only files I'm using are keystores which are located in test resources of core. Actually the other SSL tests (file server) seem to work...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036715
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala ---
    @@ -347,10 +347,10 @@ private[spark] class Worker(
                 }.toSeq
               }
               appDirectories(appId) = appLocalDirs
    -
    -          val manager = new ExecutorRunner(appId, execId, appDesc, cores_, memory_,
    -            self, workerId, host, sparkHome, executorDir, akkaUrl, conf, appLocalDirs,
    -            ExecutorState.LOADING)
    +          val manager = new ExecutorRunner(appId, execId,
    +            appDesc.copy(command = Worker.maybeUpdateSSLSettings(appDesc.command, conf)),
    --- End diff --
    
    Hmmm... why do you need the copy? A quick overlook of `ExecutorRunner` doesn't seem to indicate it modifies this object in any way...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67627471
  
      [Test build #24640 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24640/consoleFull) for   PR 3571 at commit [`71599b5`](https://github.com/apache/spark/commit/71599b59ed61aef3025881072e92e03b40a8aad8).
     * This patch **does not merge cleanly**.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23417469
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/ApplicationDescription.scala ---
    @@ -28,5 +28,14 @@ private[spark] class ApplicationDescription(
     
       val user = System.getProperty("user.name", "<unknown>")
     
    +  def copy(
    --- End diff --
    
    Well... I was wondering why it isn't a case class, but it has a mutable field. I hope it will become a case class at some point, and then the copy method will be just removed, but I would not mix here such refactoring. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036539
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/SimrSchedulerBackend.scala ---
    @@ -18,6 +18,7 @@
     package org.apache.spark.scheduler.cluster
     
     import org.apache.hadoop.fs.{Path, FileSystem}
    +import org.apache.spark.util.AkkaUtils
    --- End diff --
    
    nit: group with other spark imports.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69045609
  
      [Test build #25165 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25165/consoleFull) for   PR 3571 at commit [`b50e7dc`](https://github.com/apache/spark/commit/b50e7dc034bfee3d31541093882166469639cd90).
     * This patch **does not merge cleanly**.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70112958
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25603/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72569177
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26556/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22921648
  
    --- Diff: core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala ---
    @@ -0,0 +1,72 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.google.common.io.Files
    +import org.apache.spark.util.Utils
    +import org.scalatest.{BeforeAndAfterAll, FunSuite}
    +
    +class SSLOptionsSuite extends FunSuite with BeforeAndAfterAll {
    +
    +  @transient var tmpDir: File = _
    +
    +  override def beforeAll() {
    +    super.beforeAll()
    +
    +    tmpDir = Files.createTempDir()
    --- End diff --
    
    that's right


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964120
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,175 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +/** SSLOptions class is a common container for SSL configuration options. It offers methods to
    +  * generate specific objects to configure SSL for different communication protocols.
    +  *
    +  * SSLOptions is intended to provide the maximum common set of SSL settings, which are supported
    +  * by the protocol, which it can generate the configuration for. Since Akka doesn't support client
    +  * authentication with SSL, SSLOptions cannot support it either.
    +  *
    +  * @param enabled             enables or disables SSL; if it is set to false, the rest of the
    +  *                            settings are disregarded
    +  * @param keyStore            a path to the key-store file
    +  * @param keyStorePassword    a password to access the key-store file
    +  * @param keyPassword         a password to access the private key in the key-store
    +  * @param trustStore          a path to the trust-store file
    +  * @param trustStorePassword  a password to access the trust-store file
    +  * @param protocol            SSL protocol (remember that SSLv3 was compromised) supported by Java
    +  * @param enabledAlgorithms   a set of encryption algorithms to use
    +  */
    +private[spark] case class SSLOptions(
    +    enabled: Boolean = false,
    +    keyStore: Option[File] = None,
    +    keyStorePassword: Option[String] = None,
    +    keyPassword: Option[String] = None,
    +    trustStore: Option[File] = None,
    +    trustStorePassword: Option[String] = None,
    +    protocol: Option[String] = None,
    +    enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /** Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +    */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /** Creates an Akka configuration object which contains all the SSL settings represented by this
    +    * object. It can be used then to compose the ultimate Akka configuration.
    +    */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /** Returns a string representation of this SSLOptions with all the passwords masked. */
    --- End diff --
    
    Masking the passwords here was a nice touch!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138609
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    +
    +class WorkerTest extends FunSuite with Matchers {
    --- End diff --
    
    I think we should name this `WorkerSuite`, since that's more consistent with the naming convention in the rest of our tests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138756
  
    --- Diff: core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala ---
    @@ -209,4 +213,171 @@ class AkkaUtilsSuite extends FunSuite with LocalSparkContext with ResetSystemPro
         slaveSystem.shutdown()
       }
     
    +  test("remote fetch ssl on") {
    +    val conf = sparkSSLConfig()
    +    val securityManager = new SecurityManager(conf)
    +
    +    val hostname = "localhost"
    +    val (actorSystem, boundPort) = AkkaUtils.createActorSystem("spark", hostname, 0,
    +      conf = conf, securityManager = securityManager)
    +    System.setProperty("spark.hostPort", hostname + ":" + boundPort)
    +
    +    assert(securityManager.isAuthenticationEnabled() === false)
    +
    +    val masterTracker = new MapOutputTrackerMaster(conf)
    +    masterTracker.trackerActor = actorSystem.actorOf(
    +      Props(new MapOutputTrackerMasterActor(masterTracker, conf)), "MapOutputTracker")
    +
    +    val slaveConf = sparkSSLConfig()
    +    val securityManagerBad = new SecurityManager(slaveConf)
    +
    +    val (slaveSystem, _) = AkkaUtils.createActorSystem("spark-slave", hostname, 0,
    +      conf = slaveConf, securityManager = securityManagerBad)
    +    val slaveTracker = new MapOutputTrackerWorker(conf)
    +    val selection = slaveSystem.actorSelection(
    +      AkkaUtils.address("spark", "localhost", boundPort, "MapOutputTracker", conf))
    +    val timeout = AkkaUtils.lookupTimeout(conf)
    +    slaveTracker.trackerActor = Await.result(selection.resolveOne(timeout), timeout)
    +
    +    assert(securityManagerBad.isAuthenticationEnabled() === false)
    +
    +    masterTracker.registerShuffle(10, 1)
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L))
    +    masterTracker.registerMapOutput(10, 0,
    +      MapStatus(BlockManagerId("a", "hostA", 1000), Array(1000L)))
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    // this should succeed since security off
    +    assert(slaveTracker.getServerStatuses(10, 0).toSeq ===
    +      Seq((BlockManagerId("a", "hostA", 1000), size1000)))
    +
    +    actorSystem.shutdown()
    +    slaveSystem.shutdown()
    +  }
    +
    +
    +  test("remote fetch ssl on and security enabled") {
    +    val conf = sparkSSLConfig()
    +    conf.set("spark.authenticate", "true")
    +    conf.set("spark.authenticate.secret", "good")
    +    val securityManager = new SecurityManager(conf)
    +
    +    val hostname = "localhost"
    +    val (actorSystem, boundPort) = AkkaUtils.createActorSystem("spark", hostname, 0,
    +      conf = conf, securityManager = securityManager)
    +    System.setProperty("spark.hostPort", hostname + ":" + boundPort)
    +
    +    assert(securityManager.isAuthenticationEnabled() === true)
    +
    +    val masterTracker = new MapOutputTrackerMaster(conf)
    +    masterTracker.trackerActor = actorSystem.actorOf(
    +      Props(new MapOutputTrackerMasterActor(masterTracker, conf)), "MapOutputTracker")
    +
    +    val slaveConf = sparkSSLConfig()
    +    slaveConf.set("spark.authenticate", "true")
    +    slaveConf.set("spark.authenticate.secret", "good")
    +    val securityManagerBad = new SecurityManager(slaveConf)
    +
    +    val (slaveSystem, _) = AkkaUtils.createActorSystem("spark-slave", hostname, 0,
    +      conf = slaveConf, securityManager = securityManagerBad)
    +    val slaveTracker = new MapOutputTrackerWorker(conf)
    +    val selection = slaveSystem.actorSelection(
    +      AkkaUtils.address("spark", "localhost", boundPort, "MapOutputTracker", conf))
    +    val timeout = AkkaUtils.lookupTimeout(conf)
    +    slaveTracker.trackerActor = Await.result(selection.resolveOne(timeout), timeout)
    +
    +    assert(securityManagerBad.isAuthenticationEnabled() === true)
    +
    +    masterTracker.registerShuffle(10, 1)
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L))
    +    masterTracker.registerMapOutput(10, 0,
    +      MapStatus(BlockManagerId("a", "hostA", 1000), Array(1000L)))
    +    masterTracker.incrementEpoch()
    +    slaveTracker.updateEpoch(masterTracker.getEpoch)
    +
    +    // this should succeed since security off
    --- End diff --
    
    This is the "remote fetch ssl on and security enabled" test, so this comment seems wrong.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69081078
  
    According to the first point - would it ever compile if it was an issue?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67574517
  
    Which property file would they load? You want them to load the property file defined when launching the application, not the default file installed on the node since (i) it may not exist or (ii) it may differ from the one used to launch the job.
    
    So while it would be great to be able to make them load *a* property file, it feels like a separate feature.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72008176
  
    Since you accepted my changes, I squashed them and rebased the PR. The second commit is for what I mentioned in the previous comment - the sample usage is in the test suite. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71127655
  
      [Test build #25982 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25982/consoleFull) for   PR 3571 at commit [`4eda60c`](https://github.com/apache/spark/commit/4eda60c6fa84fbd740268c63ee863ad35caa7a69).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70477943
  
    @JoshRosen thanks a lot for your review and comments - will apply them soon. I've been waiting with the documentation until someone accept this approach. 
    
    For Spark UI SSL support - I didn't do that because there is https://github.com/apache/spark/pull/1980 (actually mentioned by you in https://github.com/apache/spark/pull/2739). However the answer for your question is yes - SSLOptions can be created at different namespace and, since it can configure Jetty (`createJettySslContextFactory` method), it can be used for Spark UI as well. Actually, I considered `spark.ssl.xxx` for Akka and internal HttpServer (for file sharing) and `spark.ui.ssl.xxx` for UI. We would just need to add:
    ```scala
    private[spark] val sslUIOptions = SSLOptions.parse(sparkConf, "spark.ui.ssl")
    ```
    to the SecurityManager class. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69929995
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25548/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71929324
  
      [Test build #26260 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26260/consoleFull) for   PR 3571 at commit [`4eda60c`](https://github.com/apache/spark/commit/4eda60c6fa84fbd740268c63ee863ad35caa7a69).
     * This patch **does not merge cleanly**.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71120126
  
      [Test build #25982 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25982/consoleFull) for   PR 3571 at commit [`4eda60c`](https://github.com/apache/spark/commit/4eda60c6fa84fbd740268c63ee863ad35caa7a69).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964066
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,175 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +/** SSLOptions class is a common container for SSL configuration options. It offers methods to
    +  * generate specific objects to configure SSL for different communication protocols.
    +  *
    +  * SSLOptions is intended to provide the maximum common set of SSL settings, which are supported
    +  * by the protocol, which it can generate the configuration for. Since Akka doesn't support client
    +  * authentication with SSL, SSLOptions cannot support it either.
    +  *
    +  * @param enabled             enables or disables SSL; if it is set to false, the rest of the
    +  *                            settings are disregarded
    +  * @param keyStore            a path to the key-store file
    +  * @param keyStorePassword    a password to access the key-store file
    +  * @param keyPassword         a password to access the private key in the key-store
    +  * @param trustStore          a path to the trust-store file
    +  * @param trustStorePassword  a password to access the trust-store file
    +  * @param protocol            SSL protocol (remember that SSLv3 was compromised) supported by Java
    +  * @param enabledAlgorithms   a set of encryption algorithms to use
    +  */
    +private[spark] case class SSLOptions(
    +    enabled: Boolean = false,
    +    keyStore: Option[File] = None,
    +    keyStorePassword: Option[String] = None,
    +    keyPassword: Option[String] = None,
    +    trustStore: Option[File] = None,
    +    trustStorePassword: Option[String] = None,
    +    protocol: Option[String] = None,
    +    enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /** Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    --- End diff --
    
    Same minor style nit here; put this comment on its own line with a single `*`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69084905
  
    I mentioned that in my second bullet. Java 6 doesn't have TLSv1.2. After I fix that I get something like this:
    
        Exception in thread "Thread-40" java.lang.IllegalStateException: Trying to deserialize a serialized ActorRef without an ActorSystem in scope. Use 'akka.serialization.Serialization.currentSystem.withValue(system) { ... }'
        	at akka.actor.SerializedActorRef.readResolve(ActorRef.scala:407)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69048255
  
      [Test build #25166 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25166/consoleFull) for   PR 3571 at commit [`82a9faa`](https://github.com/apache/spark/commit/82a9faab83af6eb2140cc94dfc7901b906070f23).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69093329
  
    Haha, I found probably the same thing :) (https://groups.google.com/forum/#!topic/akka-user/x07N35BH7es)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70391071
  
    Actually @JoshRosen - can you take a look at this one?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72441234
  
      [Test build #26510 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26510/consoleFull) for   PR 3571 at commit [`b7ba4c7`](https://github.com/apache/spark/commit/b7ba4c78fb2a5c9b92de0a0d249bff1672843682).
     * This patch **fails to build**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69142278
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25203/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69891425
  
    I'd leave distributing key stores for a separate ticket. It should cover Yarn, Mesos and standalone installation. It seems to be trivial for Yarn according to what we said. I don't know yet how it would work for Mesos and I do know that it wouldn't work for standalone because the files are fetched too late (by SparkContext). So the implementation of a versatile solution wouldn't be trivial. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69085572
  
      [Test build #25171 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25171/consoleFull) for   PR 3571 at commit [`07396e6`](https://github.com/apache/spark/commit/07396e6652c2bcda109aec98f9e2e833cda107c9).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813955
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala ---
    @@ -66,6 +66,22 @@ private[spark] class DriverRunner(
         def sleep(seconds: Int): Unit = (0 until seconds).takeWhile(f => {Thread.sleep(1000); !killed})
       }
     
    +  // Grab all the SSL settings from the worker configuration
    +  private val workerSecurityProps =
    --- End diff --
    
    Feels like the right thing would be to update `SparkConf.isExecutorStartupConf` and use it here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813757
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    +                                     keyStorePassword: Option[String] = None,
    +                                     keyPassword: Option[String] = None,
    +                                     trustStore: Option[File] = None,
    +                                     trustStorePassword: Option[String] = None,
    +                                     protocol: Option[String] = None,
    +                                     enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"spark.ssl.enabled", defaultValue = false)
    +    val keyStore = Try(conf.get(s"$ns.keyStore")).toOption.map(new File(_))
    +    val keyStorePassword = Try(conf.get(s"$ns.keyStorePassword")).toOption
    +    val keyPassword = Try(conf.get(s"$ns.keyPassword")).toOption
    +    val trustStore = Try(conf.get(s"$ns.trustStore")).toOption.map(new File(_))
    +    val trustStorePassword = Try(conf.get(s"$ns.trustStorePassword")).toOption
    +    val protocol = Try(conf.get(s"$ns.protocol")).toOption
    +    val enabledAlgorithms = Try(conf.get(s"$ns.enabledAlgorithms")).toOption
    +      .map(_.trim.dropWhile(_ == '[')
    +      .takeWhile(_ != ']')).map(_.split(",").map(_.trim).toSet)
    --- End diff --
    
    So, this is a little weird. Why force people to write the configuration like `[ FOO, BAR ]` instead of just saying `FOO,BAR`?
    
    Your code would probably fail if there's a space before the `[`, for example.
    
    Simpler version:
    
        Try(conf.get(s"$ns.enabledAlgorithms"))
          .map(_.split(","))
          .collect {
            case c if !c.trim().isEmpty() => c.trim()
          }.toSet
    
    Or something like that.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70258127
  
    @vanzin I've applied your comments. I've tested on a 3 node Spark cluster, tried to submit application from OSX to Linux cluster in both client and cluster deploy mode (in standalone mode). Everything seems working fine.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69106547
  
      [Test build #25174 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25174/consoleFull) for   PR 3571 at commit [`23a834d`](https://github.com/apache/spark/commit/23a834d7ea90c8908fd326e202dd93faa0fd6ac2).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69045861
  
    @vanzin I read about Yarn and Mesos deployments and found that making those namespaces does not make much sense because you cannot have different configurations in a single actor system. 
    
    For standalone deployment, it will work as I said before - the user can provide his own configuration in SparkConf, but to fetch it, the worker configuration will be used and then it will be overridden by the user configuration.
    
    For YARN, we still need some settings to fetch the configuration from the driver. What I did was to repeat the same solution as it is applied for spark.auth namespace - SSL settings are required before the actual configuration is applied (the same for secret token - as it is implemented right now).
    
    What do you think? I really want to move this PR forward. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72551055
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26544/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138399
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,119 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import scala.util.Try
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +private[spark] case class SSLOptions(
    +    enabled: Boolean = false,
    +    keyStore: Option[File] = None,
    +    keyStorePassword: Option[String] = None,
    +    keyPassword: Option[String] = None,
    +    trustStore: Option[File] = None,
    +    trustStorePassword: Option[String] = None,
    +    protocol: Option[String] = None,
    +    enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +  override def toString: String = s"SSLOptions{enabled=$enabled, " +
    +      s"keyStore=$keyStore, keyStorePassword=${keyStorePassword.map(_ => "xxx")}, " +
    +      s"trustStore=$trustStore, trustStorePassword=${trustStorePassword.map(_ => "xxx")}, " +
    +      s"protocol=$protocol, enabledAlgorithms=$enabledAlgorithms}"
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"$ns.enabled", defaultValue = false)
    +    val keyStore = Try(conf.get(s"$ns.keyStore")).toOption.map(new File(_))
    --- End diff --
    
    I think you can use `SparkConf.getOption` in place of `Try().toOption`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72551755
  
    Overall, this looks good to me, so I'm going to just wait for Jenkins to pass then pull this in for 1.3.  We can fix any documentation touch-ups or other things during the QA period.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036936
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala ---
    @@ -523,10 +525,31 @@ private[spark] object Worker extends Logging {
         val securityMgr = new SecurityManager(conf)
         val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port,
           conf = conf, securityManager = securityMgr)
    -    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl)
    +    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl(_, conf))
         actorSystem.actorOf(Props(classOf[Worker], host, boundPort, webUiPort, cores, memory,
           masterAkkaUrls, systemName, actorName,  workDir, conf, securityMgr), name = actorName)
         (actorSystem, boundPort)
       }
     
    +  private[spark] def isUseLocalNodeSSLConfig(cmd: Command): Boolean = {
    +    val pattern = """\-Dspark\.ssl\.useNodeLocalConf\=(.+)""".r
    +    val result = cmd.javaOpts.collectFirst {
    +      case pattern(_result) => _result.toBoolean
    +    }
    +    result.getOrElse(false)
    +  }
    +
    +  private[spark] def maybeUpdateSSLSettings(cmd: Command, conf: SparkConf): Command = {
    +    val prefix = "spark.ssl."
    +    val useLNCPrefix = "spark.ssl.useNodeLocalConf"
    --- End diff --
    
    nit: for consistency, append `.` to the prefix?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813428
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    +                                     keyStorePassword: Option[String] = None,
    +                                     keyPassword: Option[String] = None,
    +                                     trustStore: Option[File] = None,
    +                                     trustStorePassword: Option[String] = None,
    +                                     protocol: Option[String] = None,
    +                                     enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"spark.ssl.enabled", defaultValue = false)
    --- End diff --
    
    nit: in lots of places you use interpolated strings (`s"..."`) that don't reference any variables. We generally avoid that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036002
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -196,6 +201,43 @@ private[spark] class SecurityManager(sparkConf: SparkConf) extends Logging with
         )
       }
     
    +  private[spark] val sslOptions = SSLOptions.parse(sparkConf, "spark.ssl")
    +
    +  private[spark] val (sslSocketFactory, hostnameVerifier) = if (sslOptions.enabled) {
    +    val trustStoreManagers =
    +      for (trustStore <- sslOptions.trustStore) yield {
    +        val ks = KeyStore.getInstance(KeyStore.getDefaultType)
    +        ks.load(Files.asByteSource(sslOptions.trustStore.get).openStream(),
    --- End diff --
    
    Don't you need to close the stream at some point?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22814224
  
    --- Diff: core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala ---
    @@ -0,0 +1,72 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.google.common.io.Files
    +import org.apache.spark.util.Utils
    +import org.scalatest.{BeforeAndAfterAll, FunSuite}
    +
    +class SSLOptionsSuite extends FunSuite with BeforeAndAfterAll {
    +
    +  @transient var tmpDir: File = _
    +
    +  override def beforeAll() {
    +    super.beforeAll()
    +
    +    tmpDir = Files.createTempDir()
    --- End diff --
    
    I'd use `Utils.createTempDir` instead, but not a big deal.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71993756
  
    @JoshRosen I'll add a way to create `SSLOptions` which treats another `SSLOptions` as a set of defaults. I don't expect any API changes since the only thing you will have to do is to create another `SSLOptions` objects in `SecurityManager`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72455836
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26512/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70100458
  
      [Test build #25603 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25603/consoleFull) for   PR 3571 at commit [`a703c9b`](https://github.com/apache/spark/commit/a703c9b58d23894ad92619c05ac4968445208373).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69060989
  
    @vanzin the logs are available now - could you help with this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72544031
  
      [Test build #26544 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26544/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70268740
  
      [Test build #25661 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25661/consoleFull) for   PR 3571 at commit [`271d166`](https://github.com/apache/spark/commit/271d16663020386fdc02a6314ee293c9a51bd452).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70268752
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25661/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138668
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    +
    +class WorkerTest extends FunSuite with Matchers {
    +
    +  def cmd(javaOpts: String*) = Command("", Seq.empty, Map.empty, Seq.empty, Seq.empty, Seq(javaOpts:_*))
    +  def conf(opts: (String, String)*) = new SparkConf(loadDefaults = false).setAll(opts)
    +
    +  test("test isUseLocalNodeSSLConfig") {
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dasdf=dfgh")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=true")) shouldBe true
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=false")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=")) shouldBe false
    +  }
    +
    +  test("test maybeUpdateSSLSettings") {
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dasdf=dfgh", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    +          "-Dasdf=dfgh", "-Dspark.ssl.opt1=x")
    +
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dspark.ssl.useNodeLocalConf=false", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    --- End diff --
    
    Just curious, but was there a reason why you used `theSameElementsInOrderAs` instead of `should be Seq(..)`?  I had to look up the former to confirm what it did.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72440499
  
    Ok @JoshRosen I've found a way to do this. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70112945
  
      [Test build #25603 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25603/consoleFull) for   PR 3571 at commit [`a703c9b`](https://github.com/apache/spark/commit/a703c9b58d23894ad92619c05ac4968445208373).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138448
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -196,6 +201,49 @@ private[spark] class SecurityManager(sparkConf: SparkConf) extends Logging with
         )
       }
     
    +  private[spark] val sslOptions = SSLOptions.parse(sparkConf, "spark.ssl")
    --- End diff --
    
    The `SecurityManager` class itself is `private[spark]`, so I think methods for Spark internal use can just be public.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71127661
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25982/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69929989
  
      [Test build #25548 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25548/consoleFull) for   PR 3571 at commit [`60caf8c`](https://github.com/apache/spark/commit/60caf8cd1720d0d661035ec8c32cda8c4c427222).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22814270
  
    --- Diff: core/src/test/scala/org/apache/spark/SSLOptionsSuite.scala ---
    @@ -0,0 +1,72 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.google.common.io.Files
    +import org.apache.spark.util.Utils
    +import org.scalatest.{BeforeAndAfterAll, FunSuite}
    +
    +class SSLOptionsSuite extends FunSuite with BeforeAndAfterAll {
    +
    +  @transient var tmpDir: File = _
    +
    +  override def beforeAll() {
    +    super.beforeAll()
    +
    +    tmpDir = Files.createTempDir()
    --- End diff --
    
    In fact, it doesn't seem like you're using `tmpDir` at all.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964514
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -142,9 +148,39 @@ import org.apache.spark.network.sasl.SecretKeyHolder
      *  authentication. Spark will then use that user to compare against the view acls to do
      *  authorization. If not filter is in place the user is generally null and no authorization
      *  can take place.
    + *
    + *  Connection encryption (SSL) configuration is organized hierarchically. The user can configure
    + *  the default SSL settings which will be used for all the supported communication protocols unless
    + *  they are overwritten by protocol specific settings. This way the user can easily provide the
    + *  common settings for all the protocols without disabling the ability to configure each one
    + *  individually.
    + *
    + *  All the SSL settings like `spark.ssl.xxx` where `xxx` is a particular configuration property,
    + *  denote the global configuration for all the supported protocols. In order to override the global
    + *  configuration for the particular protocol, the properties must be overwritten in the
    + *  protocol-specific namespace. Use `spark.ssl.yyy.xxx` settings to overwrite the global
    + *  configuration for particular protocol denoted by `yyy`. Currently `yyy` can be either `akka` for
    + *  Akka based connections or `fs` for broadcast and file server.
    + *
    + *  Refer to [[org.apache.spark.SSLOptions]] documentation for the list of
    + *  options that can be specified.
    + *
    + *  SecurityManager initializes SSLOptions objects for different protocols separately. SSLOptions
    + *  object parses Spark configuration at a given namespace and builds the common representation
    + *  of SSL settings. SSLOptions is the used to provide protocol-specific configuration like TypeSafe
    + *  configuration for Akka or SSLContextFactory for Jetty.
    + *  SSL must be configured on each node and configured for each component involved in
    + *  communication using the particular protocol. In YARN clusters, the key-store can be prepared on
    + *  the client side then distributed and used by the executors as the part of the application
    + *  (YARN allows the user to deploy files before the application is started).
    + *  In standalone deployment, the user needs to provide key-stores and configuration
    + *  options for master and workers. In this mode, the user may allow the executors to use the SSL
    --- End diff --
    
    I realize this is kind of pedantic, but is the difference between YARN and Standalone that standalone users have to handle key _distribution_ themselves whereas YARN handles it automatically?  If I understand correctly, the user is still responsible for generating the key-stores in both modes and the only difference is whether there's a secure distribution mechanism for those stores.  If this is the case, maybe we can state this a bit more explicitly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71928967
  
    Jenkins, retest this please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22926549
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala ---
    @@ -66,6 +66,22 @@ private[spark] class DriverRunner(
         def sleep(seconds: Int): Unit = (0 until seconds).takeWhile(f => {Thread.sleep(1000); !killed})
       }
     
    +  // Grab all the SSL settings from the worker configuration
    +  private val workerSecurityProps =
    --- End diff --
    
    This made me sad because I realised that I didn't considered all the cases. 
    
    I think there should be two cases supported:
    1) The user provides a configuration which works for all the nodes, that is, for client node and for worker nodes especially when the client node == worker node because we have the same files, paths and so on. Then, the SSL configuration passed in SparkConf can be used to start an executor and then by this executor. 
    2) The user wants to use server SSL configuration by executors and by driver if running in cluster mode. Why? For example, because the location of key stores is different in client machine and the worker machine - suppose you have AWS cluster and you want to submit jobs from Windows machine.
    
    Given that, I'll add one more option to SSL configuration - `spark.ssl.useNodeLocalConfig`, which if set, will force the executors and the driver to use inherited SSL configuration from the worker. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69919534
  
      [Test build #25548 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25548/consoleFull) for   PR 3571 at commit [`60caf8c`](https://github.com/apache/spark/commit/60caf8cd1720d0d661035ec8c32cda8c4c427222).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70706882
  
    > private[spark] val sslUIOptions = SSLOptions.parse(sparkConf, "spark.ui.ssl")
    
    In a previous version of the patch, we talked about how to have namespaced options and also a fallback "global" config. That seems more flexible (e.g., `spark.ssl.enabled = true` would apply also for the UI, and you could use `spark.ssl.ui.enabled = false` to disable SSL only for the UI).
    
    From what I remember from my last read, that is not possible with the current code, right? You'd need to explicitly set both the global and the `spark.ui.ssl.*` options to be able to enable SSL for both.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69081278
  
    No, it wouldn't. I think the jenkins builders might be using Java 7 (bad jenkins!). I had to modify your code to compile it locally.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69061243
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25165/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67991523
  
      [Test build #24743 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24743/consoleFull) for   PR 3571 at commit [`c4838b8`](https://github.com/apache/spark/commit/c4838b8c883809d9ece3b608d1e27fdc3f6b89ad).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf, SparkModule.Client), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71943364
  
      [Test build #26260 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26260/consoleFull) for   PR 3571 at commit [`4eda60c`](https://github.com/apache/spark/commit/4eda60c6fa84fbd740268c63ee863ad35caa7a69).
     * This patch **passes all tests**.
     * This patch **does not merge cleanly**.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69057109
  
      [Test build #25166 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25166/consoleFull) for   PR 3571 at commit [`82a9faa`](https://github.com/apache/spark/commit/82a9faab83af6eb2140cc94dfc7901b906070f23).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138526
  
    --- Diff: core/src/main/scala/org/apache/spark/util/AkkaUtils.scala ---
    @@ -228,9 +230,22 @@ private[spark] object AkkaUtils extends Logging {
           actorSystem: ActorSystem): ActorRef = {
         val executorActorSystemName = SparkEnv.executorActorSystemName
         Utils.checkHost(host, "Expected hostname")
    -    val url = s"akka.tcp://$executorActorSystemName@$host:$port/user/$name"
    +    val url = address(executorActorSystemName, host, port, name, conf)
         val timeout = AkkaUtils.lookupTimeout(conf)
         logInfo(s"Connecting to $name: $url")
         Await.result(actorSystem.actorSelection(url).resolveOne(timeout), timeout)
       }
    +
    +  def protocol(conf: SparkConf): String = {
    +    if (conf.getBoolean("spark.ssl.enabled", defaultValue = false)) {
    +      "akka.ssl.tcp"
    +    } else {
    +      "akka.tcp"
    +    }
    +  }
    +
    +  def address(systemName: String, host: String, port: Any, actorName: String,
    --- End diff --
    
    Minor style issue: if the arguments won't fit on one line, then wrap them one per line, e.g.
    
    ```
    def address(
        systemName: String,
        host: String,
        [...]
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-65633106
  
    @pwendell is it possible to access log file somehow? I don't know how to replicate the problems - what is the operating system Jenkins is running on?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-65755350
  
    @vanzin I just rebased it and fixed so that the tests passes. I'd like to figure out why Jenkins tests fail and then continue the changes. However, I saw in Spark code that it uses SparkConf now in master and worker.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67991531
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24743/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/3571


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72446123
  
      [Test build #26512 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26512/consoleFull) for   PR 3571 at commit [`2532668`](https://github.com/apache/spark/commit/2532668fbffb6e4b6a8340c4b2748f45083d3f13).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70435538
  
    Hi @jacek-lewandowski,
    
    Thanks for bringing this up to date.  I took a quick pass through and left some minor comments.
    
    Just to clarify: this only adds SSL support for internal HttpServer and Akka traffic, and not the Spark web UI?  When we last discussed this in #2739, I think the idea was that SSLOptions could use namespaced configs in order to allow the web UI to use different SSL configurations than, say, Akka.  I see that there's some namespace support built into this patch (the `ns` argument to `parse`); is this support sufficient to support HTTPs in the UI?  Also, does it support scenarios where I want to enable SSL only for the UI or only for Akka?  Settings like `spark.ssl.enabled` sound like they're systemwide settings, so we should think through how these might interact with different UI configurations, etc.  I'm not asking to implement SSL for the UI in this patch, but I'd like to just make sure that the SSLOptions configuration code will be compatible with it.
    
    It would be great if you could add a short summary of this PR's changes to the PR description, since that description will become this PR's commit message.
    
    There's a big block comment at the top of `SecurityManager.scala` which should be updated to reflect this PR's changes (it currently says " We currently do not support SSL (https) ...").
    
    It would also be great to add a small section to the security documentation (`docs/security.md`) to mention how to configure this.  The documentation should mention the relevant Spark options, describe how/why someone would use the `useNodeLocalConf` setting, etc.  It could also contain a pointer to external instructions for generating your own keystore / truststores, etc., since this isn't a trivial process.  The new configuration options should also be documented in `docs/configuration.md` alongside the other security configurations.  In addition, the documentation should describe how the key stores are / aren't distributed depending on the choice of cluster manager.  If this works in fundamentally different ways on different cluster managers, then the docs should make this clear so users know what to expect.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67627560
  
      [Test build #24640 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24640/consoleFull) for   PR 3571 at commit [`71599b5`](https://github.com/apache/spark/commit/71599b59ed61aef3025881072e92e03b40a8aad8).
     * This patch **fails Scala style tests**.
     * This patch **does not merge cleanly**.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964014
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,175 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +/** SSLOptions class is a common container for SSL configuration options. It offers methods to
    --- End diff --
    
    Minor style nit, but do you mind placing the `/**` on its own line?  All of the Java/Scaladoc comments should generally look like
    
    ```
    /**
     * comments comments comments [...]
     */
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67628122
  
    Ok, I think I've found a solution, which is somehow based to what you've shown me. I've pushed some changes for you to take a look before I continue. 
    
    The idea for `CoarseGrainedExecutorBackend` is to use SSL settings from "executor" namespace, defined in worker's properties file - I mean, these settings will be inherited from Spark worker configuration. They will be used by `CoarseGrainedExecutorBackend` in order to connect to the driver and fetch the application configuration. Once the application configuration is fetched, the settings inherited from the worker will be used as defaults and can be overridden by the application settings.
    
    Similar approach for `DriverWrapper` (which is used when you run the application in `cluster` mode). There are two differences - we use "driver" namespace for SSL configuration, and the way how the configuration options are applied. However the final result is similar.
    
    Initially, I wanted to use "daemon" settings as defaults ("daemon" namespace is used to configure SSL for all daemon processes, like Master and Worker). However, it could introduce some vulnerability because the application could access keystores of those daemon processes. 
    
    So, in short - the administration will have to configure SSL in at least two namespaces on each node: daemon and executor. It is also recommended to configure it in "driver" namespace to provide good defaults. In the environment, where authentication is not required, all the namespaces can be configured with the same settings. 
    
    What do you think @vanzin ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138701
  
    --- Diff: core/src/test/scala/org/apache/spark/util/AkkaUtilsSuite.scala ---
    @@ -27,6 +29,8 @@ import org.apache.spark._
     import org.apache.spark.scheduler.MapStatus
     import org.apache.spark.storage.BlockManagerId
     
    +import SSLSampleConfigs._
    --- End diff --
    
    Can you change this to `import org.apache.spark.SSLSampleConfigs._` and place it with the other imports?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138477
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/ApplicationDescription.scala ---
    @@ -28,5 +28,14 @@ private[spark] class ApplicationDescription(
     
       val user = System.getProperty("user.name", "<unknown>")
     
    +  def copy(
    --- End diff --
    
    Is there a reason why we shouldn't just make `ApplicationDescription` into a case class, since that will implicitly give us a `copy` method?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72561237
  
      [Test build #26556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26556/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72559835
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26548/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67627564
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24640/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67564831
  
    Is it any reason why `CoarseGrainedExecutorBackend` and `DriverWrapper` do not load properties file? The loaded properties would be overridden by application configuration anyway?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69086227
  
    Will check, however, as you may see, SSL with Jetty test passes and it uses the same configuration. What OS do you have? I'm gonna test it on a separate machine, or even setup a clean VM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71127718
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25979/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72132146
  
    AFAIK TypeSafe configuration notify about missing properties by throwing an exception. That's why this `Try`. I just thought that this is cleaner form than `try...catch` block.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138679
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    +
    +class WorkerTest extends FunSuite with Matchers {
    +
    +  def cmd(javaOpts: String*) = Command("", Seq.empty, Map.empty, Seq.empty, Seq.empty, Seq(javaOpts:_*))
    +  def conf(opts: (String, String)*) = new SparkConf(loadDefaults = false).setAll(opts)
    +
    +  test("test isUseLocalNodeSSLConfig") {
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dasdf=dfgh")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=true")) shouldBe true
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=false")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=")) shouldBe false
    +  }
    +
    +  test("test maybeUpdateSSLSettings") {
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dasdf=dfgh", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    +          "-Dasdf=dfgh", "-Dspark.ssl.opt1=x")
    +
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dspark.ssl.useNodeLocalConf=false", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    +          "-Dspark.ssl.useNodeLocalConf=false", "-Dspark.ssl.opt1=x")
    +
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dspark.ssl.useNodeLocalConf=true", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsAs Seq(
    --- End diff --
    
    Similarly, can this just be `.javaOpts.toSet should be Set(...` ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70101711
  
    @vanzin can we move forward with this PR ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67985287
  
    About style checks - I know... I've pushed it too fast



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138482
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/DriverDescription.scala ---
    @@ -25,5 +25,13 @@ private[spark] class DriverDescription(
         val command: Command)
       extends Serializable {
     
    +  def copy(
    --- End diff --
    
    Similarly, why don't we make this into a case class as well?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71119847
  
    @JoshRosen I've applied your comments but the documentation sutff (which i'm working on). Could you tell we whether it you gonna merge it eventually into master?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67728376
  
    @vanzin the executor configuration set on the edge nodes is considered a default and the one which is used to connect to driver to fetch the configuration set in launcher. If the launcher configuration override the settings in "executor" namespace, the new settings will be used. 
    
    However, still I have some doubts about custom SSL settings on executors. Imagine the following situation: Say you want to have separate keys for executors, the executors communicate with the Master. It is not a problem to add Master public key to the trust store of the executor. However, how would you add the executor public key to the trust store of the master? You'd need to reconfigure it and restart, or I'm missing something.
    
    According to Yarn mode, I'll provide support for it. Now this is my primary task so I'll work on this ticket full time :)
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23035825
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,119 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import scala.util.Try
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +private[spark] case class SSLOptions(
    +    enabled: Boolean = false,
    +    keyStore: Option[File] = None,
    +    keyStorePassword: Option[String] = None,
    +    keyPassword: Option[String] = None,
    +    trustStore: Option[File] = None,
    +    trustStorePassword: Option[String] = None,
    +    protocol: Option[String] = None,
    +    enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +  override def toString: String = s"SSLOptions{enabled=$enabled, " +
    +      s"keyStore=$keyStore, keyStorePassword=${keyStorePassword.map(_ => "xxx")}, " +
    +      s"trustStore=$trustStore, trustStorePassword=${trustStorePassword.map(_ => "xxx")}, " +
    +      s"protocol=$protocol, enabledAlgorithms=$enabledAlgorithms}"
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean("spark.ssl.enabled", defaultValue = false)
    --- End diff --
    
    Shouldn't this also use `$ns`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23964702
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -142,9 +148,39 @@ import org.apache.spark.network.sasl.SecretKeyHolder
      *  authentication. Spark will then use that user to compare against the view acls to do
      *  authorization. If not filter is in place the user is generally null and no authorization
      *  can take place.
    + *
    + *  Connection encryption (SSL) configuration is organized hierarchically. The user can configure
    + *  the default SSL settings which will be used for all the supported communication protocols unless
    + *  they are overwritten by protocol specific settings. This way the user can easily provide the
    + *  common settings for all the protocols without disabling the ability to configure each one
    + *  individually.
    + *
    + *  All the SSL settings like `spark.ssl.xxx` where `xxx` is a particular configuration property,
    + *  denote the global configuration for all the supported protocols. In order to override the global
    + *  configuration for the particular protocol, the properties must be overwritten in the
    + *  protocol-specific namespace. Use `spark.ssl.yyy.xxx` settings to overwrite the global
    + *  configuration for particular protocol denoted by `yyy`. Currently `yyy` can be either `akka` for
    + *  Akka based connections or `fs` for broadcast and file server.
    + *
    + *  Refer to [[org.apache.spark.SSLOptions]] documentation for the list of
    + *  options that can be specified.
    + *
    + *  SecurityManager initializes SSLOptions objects for different protocols separately. SSLOptions
    + *  object parses Spark configuration at a given namespace and builds the common representation
    + *  of SSL settings. SSLOptions is the used to provide protocol-specific configuration like TypeSafe
    + *  configuration for Akka or SSLContextFactory for Jetty.
    + *  SSL must be configured on each node and configured for each component involved in
    + *  communication using the particular protocol. In YARN clusters, the key-store can be prepared on
    + *  the client side then distributed and used by the executors as the part of the application
    + *  (YARN allows the user to deploy files before the application is started).
    + *  In standalone deployment, the user needs to provide key-stores and configuration
    + *  options for master and workers. In this mode, the user may allow the executors to use the SSL
    --- End diff --
    
    Actually, this is already covered pretty well in `configuration.md`, so we might be able to disregard that here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69092555
  
    If you're curious you could try to use `-Djavax.net.debug=all` to see what's going on; both ciphers seem to exist in 1.6 so it's weird that the second one is causing problems.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71127709
  
      [Test build #25979 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25979/consoleFull) for   PR 3571 at commit [`054c3d8`](https://github.com/apache/spark/commit/054c3d8653029ee4dae949baa59f28dc30f8c46b).
     * This patch **fails Spark unit tests**.
     * This patch **does not merge cleanly**.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23418026
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    +
    +class WorkerTest extends FunSuite with Matchers {
    +
    +  def cmd(javaOpts: String*) = Command("", Seq.empty, Map.empty, Seq.empty, Seq.empty, Seq(javaOpts:_*))
    +  def conf(opts: (String, String)*) = new SparkConf(loadDefaults = false).setAll(opts)
    +
    +  test("test isUseLocalNodeSSLConfig") {
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dasdf=dfgh")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=true")) shouldBe true
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=false")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=")) shouldBe false
    +  }
    +
    +  test("test maybeUpdateSSLSettings") {
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dasdf=dfgh", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    +          "-Dasdf=dfgh", "-Dspark.ssl.opt1=x")
    +
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dspark.ssl.useNodeLocalConf=false", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    --- End diff --
    
    of course... I can change it if it doesn't conform the requirements of Spark test suites


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69783408
  
    Thanks @vanzin for the review. I'll apply your comments promptly.
    
    Key/trust stores can be distributed by attaching these files to the application - am I right? The framework (Yarn in this case) should take care of distribution of them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23036580
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala ---
    @@ -21,6 +21,8 @@ import java.io.File
     import java.util.{List => JList}
     import java.util.Collections
     
    +import org.apache.spark.util.AkkaUtils
    --- End diff --
    
    nit: spark imports come last


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69162117
  
      [Test build #25215 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25215/consoleFull) for   PR 3571 at commit [`937d839`](https://github.com/apache/spark/commit/937d8399b6c171368f5cca8345b13da0fa68d744).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71164426
  
    @JoshRosen what is going on with these test? I can see that Jenkins run them twice and the second comment says they failed, however it has a lower build number than the previously mentioned build which passed the tests. Also the failing tests seems to have nothing to do with this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69162123
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25215/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-65682860
  
    @jacek-lewandowski from a quick look at the diff, it seems you didn't change anything w.r.t. the configuration. In master, there's no need to add a new config file nor all the different ways of loading it - all daemons should be loading spark-defaults.conf and so you could just use SparkConf for everything like I suggested in the old PR.
    
    Did you have a chance to look at that?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-66739820
  
    @vanzin I'm going to finish it very soon; will you be available to help me with those failing tests?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72008609
  
      [Test build #26314 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26314/consoleFull) for   PR 3571 at commit [`1a1ea89`](https://github.com/apache/spark/commit/1a1ea89cc66b0147bcebe73d293e3fe0f85de606).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71943372
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26260/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22814082
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/ExecutorRunner.scala ---
    @@ -51,6 +51,19 @@ private[spark] class ExecutorRunner(
         var state: ExecutorState.Value)
       extends Logging {
     
    +  // Grab all the SSL settings from the worker configuration
    +  private val workerSecurityProps =
    --- End diff --
    
    This may not be needed if you update `SparkConf.isExecutorStartupConf`. See `SparkDeploySchedulerBackend.scala`, where it's used.
    
    (Separately, it would probably be good for Yarn to use that same call instead of having it's own separate whitelist...)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138535
  
    --- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocator.scala ---
    @@ -21,6 +21,8 @@ import java.util.concurrent._
     import java.util.concurrent.atomic.AtomicInteger
     import java.util.regex.Pattern
     
    +import org.apache.spark.util.AkkaUtils
    --- End diff --
    
    This should be grouped with the other Spark imports a few lines down.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72440613
  
      [Test build #26510 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26510/consoleFull) for   PR 3571 at commit [`b7ba4c7`](https://github.com/apache/spark/commit/b7ba4c78fb2a5c9b92de0a0d249bff1672843682).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72551042
  
      [Test build #26544 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26544/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23037152
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala ---
    @@ -523,10 +525,31 @@ private[spark] object Worker extends Logging {
         val securityMgr = new SecurityManager(conf)
         val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port,
           conf = conf, securityManager = securityMgr)
    -    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl)
    +    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl(_, conf))
         actorSystem.actorOf(Props(classOf[Worker], host, boundPort, webUiPort, cores, memory,
           masterAkkaUrls, systemName, actorName,  workDir, conf, securityMgr), name = actorName)
         (actorSystem, boundPort)
       }
     
    +  private[spark] def isUseLocalNodeSSLConfig(cmd: Command): Boolean = {
    +    val pattern = """\-Dspark\.ssl\.useNodeLocalConf\=(.+)""".r
    +    val result = cmd.javaOpts.collectFirst {
    +      case pattern(_result) => _result.toBoolean
    +    }
    +    result.getOrElse(false)
    +  }
    +
    +  private[spark] def maybeUpdateSSLSettings(cmd: Command, conf: SparkConf): Command = {
    +    val prefix = "spark.ssl."
    +    val useLNCPrefix = "spark.ssl.useNodeLocalConf"
    +    if (isUseLocalNodeSSLConfig(cmd)) {
    +      val newJavaOpts = cmd.javaOpts
    +          .filterNot(opt => opt.startsWith(s"-D$prefix") && !opt.startsWith(s"-D$useLNCPrefix=")) ++
    --- End diff --
    
    nit: could you use `filter`? My brain gets into a knot trying to negate the condition here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23417992
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/worker/WorkerTest.scala ---
    @@ -0,0 +1,56 @@
    +/*
    + * 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.worker
    +
    +import org.apache.spark.SparkConf
    +import org.apache.spark.deploy.Command
    +import org.scalatest.{Matchers, FunSuite}
    +
    +class WorkerTest extends FunSuite with Matchers {
    +
    +  def cmd(javaOpts: String*) = Command("", Seq.empty, Map.empty, Seq.empty, Seq.empty, Seq(javaOpts:_*))
    +  def conf(opts: (String, String)*) = new SparkConf(loadDefaults = false).setAll(opts)
    +
    +  test("test isUseLocalNodeSSLConfig") {
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dasdf=dfgh")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=true")) shouldBe true
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=false")) shouldBe false
    +    Worker.isUseLocalNodeSSLConfig(cmd("-Dspark.ssl.useNodeLocalConf=")) shouldBe false
    +  }
    +
    +  test("test maybeUpdateSSLSettings") {
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dasdf=dfgh", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    +          "-Dasdf=dfgh", "-Dspark.ssl.opt1=x")
    +
    +    Worker.maybeUpdateSSLSettings(
    +      cmd("-Dspark.ssl.useNodeLocalConf=false", "-Dspark.ssl.opt1=x"),
    +      conf("spark.ssl.opt1" -> "y", "spark.ssl.opt2" -> "z"))
    +        .javaOpts should contain theSameElementsInOrderAs Seq(
    --- End diff --
    
    It is just more generic - in this test i'm interested only whether the elements in the resulting collection are the same and are in the same order - not what exact collection implementation is used.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22921171
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    +
    +private[spark] case class SSLOptions(enabled: Boolean = false,
    +                                     keyStore: Option[File] = None,
    +                                     keyStorePassword: Option[String] = None,
    +                                     keyPassword: Option[String] = None,
    +                                     trustStore: Option[File] = None,
    +                                     trustStorePassword: Option[String] = None,
    +                                     protocol: Option[String] = None,
    +                                     enabledAlgorithms: Set[String] = Set.empty) {
    +
    +  /**
    +   * Creates a Jetty SSL context factory according to the SSL settings represented by this object.
    +   */
    +  def createJettySslContextFactory(): Option[SslContextFactory] = {
    +    if (enabled) {
    +      val sslContextFactory = new SslContextFactory()
    +
    +      keyStore.foreach(file => sslContextFactory.setKeyStorePath(file.getAbsolutePath))
    +      trustStore.foreach(file => sslContextFactory.setTrustStore(file.getAbsolutePath))
    +      keyStorePassword.foreach(sslContextFactory.setKeyStorePassword)
    +      trustStorePassword.foreach(sslContextFactory.setTrustStorePassword)
    +      keyPassword.foreach(sslContextFactory.setKeyManagerPassword)
    +      protocol.foreach(sslContextFactory.setProtocol)
    +      sslContextFactory.setIncludeCipherSuites(enabledAlgorithms.toSeq: _*)
    +
    +      Some(sslContextFactory)
    +    } else {
    +      None
    +    }
    +  }
    +
    +  /**
    +   * Creates an Akka configuration object which contains all the SSL settings represented by this
    +   * object. It can be used then to compose the ultimate Akka configuration.
    +   */
    +  def createAkkaConfig: Option[Config] = {
    +    import scala.collection.JavaConversions._
    +    if (enabled) {
    +      Some(ConfigFactory.empty()
    +        .withValue("akka.remote.netty.tcp.security.key-store",
    +          ConfigValueFactory.fromAnyRef(keyStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-store-password",
    +          ConfigValueFactory.fromAnyRef(keyStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store",
    +          ConfigValueFactory.fromAnyRef(trustStore.map(_.getAbsolutePath).getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.trust-store-password",
    +          ConfigValueFactory.fromAnyRef(trustStorePassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.key-password",
    +          ConfigValueFactory.fromAnyRef(keyPassword.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.random-number-generator",
    +          ConfigValueFactory.fromAnyRef(""))
    +        .withValue("akka.remote.netty.tcp.security.protocol",
    +          ConfigValueFactory.fromAnyRef(protocol.getOrElse("")))
    +        .withValue("akka.remote.netty.tcp.security.enabled-algorithms",
    +          ConfigValueFactory.fromIterable(enabledAlgorithms.toSeq))
    +        .withValue("akka.remote.netty.tcp.enable-ssl",
    +          ConfigValueFactory.fromAnyRef(true)))
    +    } else {
    +      None
    +    }
    +  }
    +
    +}
    +
    +object SSLOptions extends Logging {
    +
    +  /**
    +   * Resolves SSLOptions settings from a given Spark configuration object at a given namespace.
    +   * The parent directory of that location is used as a base directory to resolve relative paths
    +   * to keystore and truststore.
    +   */
    +  def parse(conf: SparkConf, ns: String): SSLOptions = {
    +    val enabled = conf.getBoolean(s"spark.ssl.enabled", defaultValue = false)
    +    val keyStore = Try(conf.get(s"$ns.keyStore")).toOption.map(new File(_))
    +    val keyStorePassword = Try(conf.get(s"$ns.keyStorePassword")).toOption
    +    val keyPassword = Try(conf.get(s"$ns.keyPassword")).toOption
    +    val trustStore = Try(conf.get(s"$ns.trustStore")).toOption.map(new File(_))
    +    val trustStorePassword = Try(conf.get(s"$ns.trustStorePassword")).toOption
    +    val protocol = Try(conf.get(s"$ns.protocol")).toOption
    +    val enabledAlgorithms = Try(conf.get(s"$ns.enabledAlgorithms")).toOption
    +      .map(_.trim.dropWhile(_ == '[')
    +      .takeWhile(_ != ']')).map(_.split(",").map(_.trim).toSet)
    --- End diff --
    
    No, it will not, because the whole string is trimmed.
    
    I wanted it to be compatible with Akka way of passing lists of values. But, now I see that it doesn't make much sense. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71929033
  
    @jacek-lewandowski I think that we may have had an intermittent period of flakiness on Jenkins or a possible build-break, so I'm retesting it now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-70083255
  
    @vanzin I found one bug in my recent changes which I will fix in few hours


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72016434
  
      [Test build #26314 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26314/consoleFull) for   PR 3571 at commit [`1a1ea89`](https://github.com/apache/spark/commit/1a1ea89cc66b0147bcebe73d293e3fe0f85de606).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67999920
  
    Not sure without digging through the code and trying it out myself. Make sure you don't have a configuration file lying around in your `$SPARK_HOME/conf` that is not available in jenkins for some reason.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72029299
  
      [Test build #26317 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26317/consoleFull) for   PR 3571 at commit [`37d8221`](https://github.com/apache/spark/commit/37d82219b96215a6cc02693216b37e7a0b0e2d24).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69091223
  
    BTW that cipher is not listed here: https://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72569171
  
      [Test build #26556 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26556/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23038107
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala ---
    @@ -523,10 +525,31 @@ private[spark] object Worker extends Logging {
         val securityMgr = new SecurityManager(conf)
         val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port,
           conf = conf, securityManager = securityMgr)
    -    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl)
    +    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl(_, conf))
         actorSystem.actorOf(Props(classOf[Worker], host, boundPort, webUiPort, cores, memory,
           masterAkkaUrls, systemName, actorName,  workDir, conf, securityMgr), name = actorName)
         (actorSystem, boundPort)
       }
     
    +  private[spark] def isUseLocalNodeSSLConfig(cmd: Command): Boolean = {
    +    val pattern = """\-Dspark\.ssl\.useNodeLocalConf\=(.+)""".r
    +    val result = cmd.javaOpts.collectFirst {
    +      case pattern(_result) => _result.toBoolean
    +    }
    +    result.getOrElse(false)
    +  }
    +
    +  private[spark] def maybeUpdateSSLSettings(cmd: Command, conf: SparkConf): Command = {
    +    val prefix = "spark.ssl."
    +    val useLNCPrefix = "spark.ssl.useNodeLocalConf"
    --- End diff --
    
    Actually it is not a prefix - renamed the constant


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67985290
  
      [Test build #24743 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24743/consoleFull) for   PR 3571 at commit [`c4838b8`](https://github.com/apache/spark/commit/c4838b8c883809d9ece3b608d1e27fdc3f6b89ad).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67978159
  
      [Test build #24741 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24741/consoleFull) for   PR 3571 at commit [`ff5a776`](https://github.com/apache/spark/commit/ff5a776194cbda08461a81b74d62e5107233d970).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class SSLOptions(enabled: Boolean = false,`
      * `    val classServer                                   = new HttpServer(outputDir, new SecurityManager(conf, SparkModule.Client), classServerPort, "HTTP class server", conf)`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72042566
  
    @vanzin @JoshRosen wdyt about the recent changes?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72019082
  
      [Test build #26317 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26317/consoleFull) for   PR 3571 at commit [`37d8221`](https://github.com/apache/spark/commit/37d82219b96215a6cc02693216b37e7a0b0e2d24).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22813243
  
    --- Diff: core/src/main/scala/org/apache/spark/SSLOptions.scala ---
    @@ -0,0 +1,115 @@
    +/*
    + * 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
    +
    +import java.io.File
    +
    +import com.typesafe.config.{Config, ConfigFactory, ConfigValueFactory}
    +import org.eclipse.jetty.util.ssl.SslContextFactory
    +
    +import scala.util.Try
    --- End diff --
    
    nit: scala imports should be grouped together after java, before com/org/etc


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67530393
  
    Hi @jacek-lewandowski ,
    
    Yes, that's an issue. That's why I suggested in your original PR to use Yarn's approach here:
    https://github.com/apache/spark/pull/2739#discussion_r19165851
    
    Code has moved, here's the code in master now:
    https://github.com/apache/spark/blob/master/yarn/src/main/scala/org/apache/spark/deploy/yarn/ExecutorRunnableUtil.scala#L74


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69084850
  
    Let me try once again...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69138025
  
      [Test build #25203 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25203/consoleFull) for   PR 3571 at commit [`b5c965d`](https://github.com/apache/spark/commit/b5c965defa64c8e68f530ab5806104bd448829ce).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69076697
  
    @jacek-lewandowski I was able to hit something that looks like the error Jenkins hit locally. While I try to take a look, there are two other issues I ran into:
    
    - You're using `File.toPath()` which was added in Java 7, and Spark needs to work against Java 6
    - The tests configure SSL to use TLSv1.2, while Java 6 only seems to have TLSv1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67518861
  
    @vanzin I did some changes but I'm not sure about using Spark configuration in this case. At least it can be not so clear. I mean such cases as running executors. `CoarseGrainedExecutorBackend` needs SSL configuration to connect to the driver and fetch the real application configuration. In other words, it doesn't have any information about the configuration and it doesn't load the property file. I suppose the same problem would be with `DriverWrapper` which is used when the driver is run by the worker.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69093286
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25171/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71118034
  
      [Test build #25979 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25979/consoleFull) for   PR 3571 at commit [`054c3d8`](https://github.com/apache/spark/commit/054c3d8653029ee4dae949baa59f28dc30f8c46b).
     * This patch **does not merge cleanly**.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23138520
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/SimrSchedulerBackend.scala ---
    @@ -38,11 +39,9 @@ private[spark] class SimrSchedulerBackend(
       override def start() {
         super.start()
     
    -    val driverUrl = "akka.tcp://%s@%s:%s/user/%s".format(
    -      SparkEnv.driverActorSystemName,
    -      sc.conf.get("spark.driver.host"),
    -      sc.conf.get("spark.driver.port"),
    -      CoarseGrainedSchedulerBackend.ACTOR_NAME)
    +    val driverUrl = AkkaUtils.address(SparkEnv.driverActorSystemName,
    --- End diff --
    
    Minor readability nit, but I think this would be a little easier to parse if you split it with one argument per line, as you've done in SparkDeploySchedulerBackend.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69088483
  
    Ok, I've replicated on a different machine with different OS


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72559826
  
      [Test build #26548 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26548/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69919177
  
    I had to rebase and force push


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22814188
  
    --- Diff: core/src/test/scala/org/apache/spark/LocalSparkContext.scala ---
    @@ -38,6 +38,7 @@ trait LocalSparkContext extends BeforeAndAfterEach with BeforeAndAfterAll { self
       }
     
       def resetSparkContext() = {
    +    System.clearProperty("spark.ssl.configFile")
    --- End diff --
    
    Is this still needed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22814325
  
    --- Diff: core/src/test/scala/org/apache/spark/SecurityManagerSuite.scala ---
    @@ -125,6 +126,39 @@ class SecurityManagerSuite extends FunSuite {
     
       }
     
    +  test("ssl on setup") {
    +    val conf = SSLSampleConfigs.sparkSSLConfig()
    +
    +    val securityManager = new SecurityManager(conf)
    +
    +    assert(securityManager.sslOptions.enabled === true)
    +    assert(securityManager.sslSocketFactory.isDefined === true)
    +    assert(securityManager.hostnameVerifier.isDefined === true)
    +
    +    assert(securityManager.sslOptions.trustStore.isDefined === true)
    +    assert(securityManager.sslOptions.trustStore.get.getName === "truststore")
    +    assert(securityManager.sslOptions.keyStore.isDefined === true)
    +    assert(securityManager.sslOptions.keyStore.get.getName === "keystore")
    +    assert(securityManager.sslOptions.trustStorePassword === Some("password"))
    +    assert(securityManager.sslOptions.keyStorePassword === Some("password"))
    +    assert(securityManager.sslOptions.keyPassword === Some("password"))
    +    assert(securityManager.sslOptions.protocol === Some("TLSv1"))
    +    assert(securityManager.sslOptions.enabledAlgorithms === Set("TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_DES_CBC_SHA"))
    --- End diff --
    
    nit: line is too long.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23035899
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -18,7 +18,11 @@
     package org.apache.spark
     
     import java.net.{Authenticator, PasswordAuthentication}
    +import java.security.KeyStore
    +import java.security.cert.X509Certificate
    +import javax.net.ssl._
    --- End diff --
    
    nit: `java.net` before `java.security`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-67978163
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24741/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69106553
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25174/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r23037199
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala ---
    @@ -523,10 +525,31 @@ private[spark] object Worker extends Logging {
         val securityMgr = new SecurityManager(conf)
         val (actorSystem, boundPort) = AkkaUtils.createActorSystem(systemName, host, port,
           conf = conf, securityManager = securityMgr)
    -    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl)
    +    val masterAkkaUrls = masterUrls.map(Master.toAkkaUrl(_, conf))
         actorSystem.actorOf(Props(classOf[Worker], host, boundPort, webUiPort, cores, memory,
           masterAkkaUrls, systemName, actorName,  workDir, conf, securityMgr), name = actorName)
         (actorSystem, boundPort)
       }
     
    +  private[spark] def isUseLocalNodeSSLConfig(cmd: Command): Boolean = {
    +    val pattern = """\-Dspark\.ssl\.useNodeLocalConf\=(.+)""".r
    +    val result = cmd.javaOpts.collectFirst {
    +      case pattern(_result) => _result.toBoolean
    +    }
    +    result.getOrElse(false)
    +  }
    +
    +  private[spark] def maybeUpdateSSLSettings(cmd: Command, conf: SparkConf): Command = {
    +    val prefix = "spark.ssl."
    +    val useLNCPrefix = "spark.ssl.useNodeLocalConf"
    --- End diff --
    
    wait: is this a prefix at all? or is it a single config?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-65356861
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-66812224
  
    Test logs are gone, so an admin would have to re-trigger them. I'm a little short on time to be able to test this myself at the moment...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72552049
  
      [Test build #26548 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26548/consoleFull) for   PR 3571 at commit [`9ef4ed1`](https://github.com/apache/spark/commit/9ef4ed13bdbee4363ba27d2e6bf5abad15ab7c84).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72018888
  
    After thinking more about this, I decided to refactor things a little bit to make it more consistent.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69085085
  
    How did you get this? I changed to SSLv3 (only for the tests) and AkkaUtilsTest passed...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69084003
  
    Well.. I get a different exception with Java 6 : `java.security.NoSuchAlgorithmException: TLSv1.2 SSLContext not available`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by jacek-lewandowski <gi...@git.apache.org>.
Github user jacek-lewandowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3571#discussion_r22921556
  
    --- Diff: core/src/test/scala/org/apache/spark/LocalSparkContext.scala ---
    @@ -38,6 +38,7 @@ trait LocalSparkContext extends BeforeAndAfterEach with BeforeAndAfterAll { self
       }
     
       def resetSparkContext() = {
    +    System.clearProperty("spark.ssl.configFile")
    --- End diff --
    
    no


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-72455832
  
      [Test build #26512 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26512/consoleFull) for   PR 3571 at commit [`2532668`](https://github.com/apache/spark/commit/2532668fbffb6e4b6a8340c4b2748f45083d3f13).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-69629292
  
    @jacek-lewandowski this is looking good and tests now pass! I left a few minor comments. On the yarn side, it would be nice to automatically distribute the key/trust store files to the containers, but that can be done separately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: Spark 3883: SSL support for HttpServer and Akk...

Posted by JoshRosen <gi...@git.apache.org>.
Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/3571#issuecomment-71931041
  
    The SSL changes themselves here look good, so I think the last major thing to resolve is how we're going to handle tiered configurations.  I like @vanzin's idea of having the global `spark.ssl` setting be overridden by component-specific configurations, since this will be future-proof in terms of adding new components (e.g. if we add new network pieces, they'll be covered by the umbrella SSL configuration).
    
    If we take care of that and the documentation, then I think we should be able to pull this in.
    
    I think the idea of having per-component overrides is backwards-compatible with the approach here, so unless you anticipate any API-breakage that would result from adding that change later, I think it might be fine to stick with the global "all-or-nothing" SSL configuration then enhance it later with the per-component overrides.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org