You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by junyangq <gi...@git.apache.org> on 2016/08/22 21:01:39 UTC
[GitHub] spark pull request #14761: [SparkR][Minor] Add installation message for remo...
GitHub user junyangq opened a pull request:
https://github.com/apache/spark/pull/14761
[SparkR][Minor] Add installation message for remote master mode and improve other messages
## What changes were proposed in this pull request?
This PR tries to give informative message to users when they connect to a remote master but don't have Spark package in their local machine.
For now, automatic installation will only happen if they start SparkR in R console (rather than from sparkr-shell) and connect to local master. In the remote master mode, local Spark package is still needed, but different from local mode, we will not trigger the install.spark function because the versions have to match those on the cluster, which involves more user input. Instead, we provide detailed message that may help the users.
Some of the previous messages have also been slightly changed.
## How was this patch tested?
Manual test.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/junyangq/spark SPARK-16579-V1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14761.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 #14761
----
commit 8740e76c1cda447afd8bb153a4dec36495a82fea
Author: Junyang Qian <ju...@databricks.com>
Date: 2016-08-22T20:43:39Z
Give more detailed instruction and message for installation.
----
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64236 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64236/consoleFull)** for PR 14761 at commit [`8740e76`](https://github.com/apache/spark/commit/8740e76c1cda447afd8bb153a4dec36495a82fea).
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64315 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64315/consoleFull)** for PR 14761 at commit [`4dc8b1e`](https://github.com/apache/spark/commit/4dc8b1e5f2ed47b9007a10c8b762a33056919775).
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64294 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64294/consoleFull)** for PR 14761 at commit [`da276bb`](https://github.com/apache/spark/commit/da276bb741cef111f45cc8806786c751cd0e5ec9).
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on the issue:
https://github.com/apache/spark/pull/14761
Thanks @mengxr
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:
https://github.com/apache/spark/pull/14761
LGTM
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75851005
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+installInstruction <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "SparkR package is compatible with Spark 2.0.0.",
--- End diff --
can you get this off of `packageVersion("SparkR")`
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Merged build finished. 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64315/
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75782708
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+instructionForInstall <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "Currently only Spark 2.0 is supported. ",
--- End diff --
is there a way to not hardcode this?
`install.spark` is in branch-2.0 so this could be running Spark 2.0.1?
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64294 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64294/consoleFull)** for PR 14761 at commit [`da276bb`](https://github.com/apache/spark/commit/da276bb741cef111f45cc8806786c751cd0e5ec9).
* This patch **fails R style 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64236 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64236/consoleFull)** for PR 14761 at commit [`8740e76`](https://github.com/apache/spark/commit/8740e76c1cda447afd8bb153a4dec36495a82fea).
* 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Merged build finished. 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Merged build finished. 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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75786183
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+instructionForInstall <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "Currently only Spark 2.0 is supported. ",
--- End diff --
I don't have a good solution to this... Do you have any idea in mind?
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75783153
--- Diff: R/pkg/R/install.R ---
@@ -125,20 +127,24 @@ robust_download_tar <- function(mirrorUrl, version, hadoopVersion, packageName,
message(msg)
success <- direct_download_tar(mirrorUrl, version, hadoopVersion,
packageName, packageLocalPath)
- if (success) return()
+ if (success) {
+ return()
+ } else {
+ message(paste0("Unable to download from mirrorUrl: ", mirrorUrl))
+ }
--- End diff --
we continue to try other options if failed at this step.
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64270 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64270/consoleFull)** for PR 14761 at commit [`39c34da`](https://github.com/apache/spark/commit/39c34dac40943da5e74af3cfc0d3fb69ebe1c8ac).
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75921626
--- Diff: R/pkg/R/sparkR.R ---
@@ -550,3 +532,27 @@ processSparkPackages <- function(packages) {
}
splittedPackages
}
+
+# Utility function that checks and install Spark to local folder if not found
+#
+# Installation will not be triggered if it's called from sparkR shell
+# or if the master url is not local
+sparkLocalInstall <- function(sparkHome, master) {
+ if (!isSparkRShell()) {
+ if (!is.na(file.info(sparkHome)$isdir)) {
+ msg <- paste0("Spark package found in SPARK_HOME: ", sparkHome)
+ message(msg)
+ } else {
+ if (!nzchar(master) || isMasterLocal(master)) {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome)
+ message(msg)
+ packageLocalDir <- install.spark()
+ } else {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome, "\n", installInstruction("remote"))
+ stop(msg)
+ }
+ }
+ }
--- End diff --
nit: perhaps be more specific what's being returned?
also it could help to have @param / @return in the comment block above this function - no need for `#'` since we are not publishing 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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75782412
--- Diff: R/pkg/R/sparkR.R ---
@@ -367,19 +367,21 @@ sparkR.session <- function(
overrideEnvs(sparkConfigMap, paramMap)
}
# do not download if it is run in the sparkR shell
- if (!nzchar(master) || is_master_local(master)) {
- if (!is_sparkR_shell()) {
- if (is.na(file.info(sparkHome)$isdir)) {
+ if (!is_sparkR_shell()) {
+ if (!is.na(file.info(sparkHome)$isdir)) {
+ msg <- paste0("Spark package found in SPARK_HOME: ", sparkHome)
+ message(msg)
--- End diff --
I'm thinking this message is a bit chatty - should we cache this check (sparkR.session() can be called multiple times) or, perhaps we should not message if Spark is found?
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64269 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64269/consoleFull)** for PR 14761 at commit [`95fec8b`](https://github.com/apache/spark/commit/95fec8be7d69a7478d1ff7ffbd4853073d17d0e0).
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64269 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64269/consoleFull)** for PR 14761 at commit [`95fec8b`](https://github.com/apache/spark/commit/95fec8be7d69a7478d1ff7ffbd4853073d17d0e0).
* 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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75782928
--- Diff: R/pkg/R/install.R ---
@@ -125,20 +127,24 @@ robust_download_tar <- function(mirrorUrl, version, hadoopVersion, packageName,
message(msg)
success <- direct_download_tar(mirrorUrl, version, hadoopVersion,
packageName, packageLocalPath)
- if (success) return()
+ if (success) {
+ return()
+ } else {
+ message(paste0("Unable to download from mirrorUrl: ", mirrorUrl))
+ }
--- End diff --
```
if (!success) {
message(paste0("Unable to download from mirrorUrl: ", mirrorUrl))
}
```
ie. no return?
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75851065
--- Diff: R/pkg/R/sparkR.R ---
@@ -366,25 +366,28 @@ sparkR.session <- function(
}
overrideEnvs(sparkConfigMap, paramMap)
}
- # do not download if it is run in the sparkR shell
- if (!nzchar(master) || is_master_local(master)) {
+
+ if (!exists(".sparkRjsc", envir = .sparkREnv)) {
+ # do not download if it is run in the sparkR shell
if (!is_sparkR_shell()) {
--- End diff --
could you refactor out this block into a helper function?
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64270/
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Merged build finished. 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64294/
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75921988
--- Diff: R/pkg/R/sparkR.R ---
@@ -550,3 +532,27 @@ processSparkPackages <- function(packages) {
}
splittedPackages
}
+
+# Utility function that checks and install Spark to local folder if not found
+#
+# Installation will not be triggered if it's called from sparkR shell
+# or if the master url is not local
+sparkLocalInstall <- function(sparkHome, master) {
+ if (!isSparkRShell()) {
+ if (!is.na(file.info(sparkHome)$isdir)) {
+ msg <- paste0("Spark package found in SPARK_HOME: ", sparkHome)
+ message(msg)
+ } else {
+ if (!nzchar(master) || isMasterLocal(master)) {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome)
+ message(msg)
+ packageLocalDir <- install.spark()
+ } else {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome, "\n", installInstruction("remote"))
+ stop(msg)
+ }
+ }
+ }
--- End diff --
this would probably get rid of the lint-r warning too.
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75786649
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+instructionForInstall <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "Currently only Spark 2.0 is supported. ",
--- End diff --
Or should I say "from 2.0" or something?
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/14761
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75797228
--- Diff: R/pkg/R/sparkR.R ---
@@ -367,19 +367,21 @@ sparkR.session <- function(
overrideEnvs(sparkConfigMap, paramMap)
}
# do not download if it is run in the sparkR shell
- if (!nzchar(master) || is_master_local(master)) {
- if (!is_sparkR_shell()) {
- if (is.na(file.info(sparkHome)$isdir)) {
+ if (!is_sparkR_shell()) {
+ if (!is.na(file.info(sparkHome)$isdir)) {
+ msg <- paste0("Spark package found in SPARK_HOME: ", sparkHome)
+ message(msg)
--- End diff --
Agree that if there exist an existing session, we shouldn't repeat the same message. But it would be useful to have this message for the first time to help debugging. I can imagine users hit issues due to wrong env variables or search path.
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:
https://github.com/apache/spark/pull/14761
@mengxr do you have any other comment? I'll merge to master & branch-2.0 otherwise.
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the issue:
https://github.com/apache/spark/pull/14761
I'm making a pass.
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75902901
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+installInstruction <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "SparkR package is compatible with Spark 2.0.0.",
--- End diff --
Good catch. Thanks!
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/14761
**[Test build #64315 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/64315/consoleFull)** for PR 14761 at commit [`4dc8b1e`](https://github.com/apache/spark/commit/4dc8b1e5f2ed47b9007a10c8b762a33056919775).
* 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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75851193
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+installInstruction <- function(mode) {
--- End diff --
if it's only useful in install.R, consider moving this helper function there.
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by junyangq <gi...@git.apache.org>.
Github user junyangq commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75970587
--- Diff: R/pkg/R/sparkR.R ---
@@ -550,3 +532,27 @@ processSparkPackages <- function(packages) {
}
splittedPackages
}
+
+# Utility function that checks and install Spark to local folder if not found
+#
+# Installation will not be triggered if it's called from sparkR shell
+# or if the master url is not local
+sparkLocalInstall <- function(sparkHome, master) {
+ if (!isSparkRShell()) {
+ if (!is.na(file.info(sparkHome)$isdir)) {
+ msg <- paste0("Spark package found in SPARK_HOME: ", sparkHome)
+ message(msg)
+ } else {
+ if (!nzchar(master) || isMasterLocal(master)) {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome)
+ message(msg)
+ packageLocalDir <- install.spark()
+ } else {
+ msg <- paste0("Spark not found in SPARK_HOME: ",
+ sparkHome, "\n", installInstruction("remote"))
+ stop(msg)
+ }
+ }
+ }
--- End diff --
Sounds good. Thanks!
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75797308
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
}
+
+instructionForInstall <- function(mode) {
+ if (mode == "remote") {
+ paste0("Connecting to a remote Spark master. ",
+ "Please make sure Spark package is also installed in this machine.\n",
+ "- If there is one, set the path in sparkHome parameter or ",
+ "environment variable SPARK_HOME.\n",
+ "- If not, you may run install.spark function to do the job. ",
+ "Please make sure the Spark and the Hadoop versions ",
+ "match the versions on the cluster. ",
+ "Currently only Spark 2.0 is supported. ",
--- End diff --
SparkR version should the same as the Spark version. So instead of saying `only Spark 2.0`, we can say the current `SparkR package is compatible with Spark x.x.x`.
---
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75851444
--- Diff: R/pkg/R/install.R ---
@@ -180,7 +186,7 @@ get_preferred_mirror <- function(version, packageName) {
direct_download_tar <- function(mirrorUrl, version, hadoopVersion, packageName, packageLocalPath) {
packageRemotePath <- paste0(
file.path(mirrorUrl, version, packageName), ".tgz")
- fmt <- paste("Downloading Spark %s for Hadoop %s from:\n- %s")
+ fmt <- paste("Downloading %s for Hadoop %s from:\n- %s")
--- End diff --
nit: we don't need to call paste() 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64236/
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 #14761: [SparkR][Minor] Add installation message for remo...
Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/14761#discussion_r75851299
--- Diff: R/pkg/R/utils.R ---
@@ -697,3 +697,20 @@ is_master_local <- function(master) {
is_sparkR_shell <- function() {
--- End diff --
also btw, I think we are mixing function name style here - consider naming `isMasterLocal` and `isSparkRShell`
---
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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Merged build finished. 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 issue #14761: [SparkR][Minor] Add installation message for remote mast...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/14761
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/64269/
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