Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

Commit

Permalink
Resolving startup failure for spark-yarn-task
Browse files Browse the repository at this point in the history
- adding EnvironmentPostProcessor to turn off web environment which seems to be triggered in newer Boot version by a Spark dependency

- updating to Spark 1.6.3

- removing obsolete referende to white-list property class for common properties

Resolves #2
  • Loading branch information
trisberg committed Feb 7, 2017
1 parent 9ff6b93 commit fd100ff
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 12 deletions.
16 changes: 8 additions & 8 deletions spark-yarn-task-app-dependencies/pom.xml
Expand Up @@ -15,7 +15,7 @@
</parent>

<properties>
<spark.version>1.6.2</spark.version>
<spark.version>1.6.3</spark.version>
<spring-data-hadoop.version>2.4.0.RELEASE</spring-data-hadoop.version>
</properties>

Expand All @@ -32,27 +32,27 @@
<version>${spark.version}</version>
<exclusions>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</exclusion>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
</exclusion>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-client</artifactId>
</exclusion>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-app</artifactId>
</exclusion>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-server-web-proxy</artifactId>
</exclusion>
<exclusion>
<groupId> org.apache.hadoop</groupId>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-api</artifactId>
</exclusion>
<exclusion>
Expand All @@ -78,7 +78,7 @@
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profiles>
<profile>
<id>spring</id>
<repositories>
Expand Down
6 changes: 6 additions & 0 deletions spring-cloud-starter-task-spark-yarn/pom.xml
Expand Up @@ -66,6 +66,12 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-hadoop-boot</artifactId>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
Expand Down
@@ -0,0 +1,35 @@
/*
* Copyright 2017 the original author or authors.
*
* Licensed 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.springframework.cloud.task.app.spark.yarn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;

/**
* {@link EnvironmentPostProcessor} implementation that will disable the web environment that seems to be
* triggered by a Spark code dependency.
*
* @author Thomas Risberg
*/
public class SparkYarnEnvironmentPostProcessor implements EnvironmentPostProcessor {

@Override
public void postProcessEnvironment(ConfigurableEnvironment configurableEnvironment, SpringApplication springApplication) {
springApplication.setWebEnvironment(false);
}
}
@@ -1,5 +1,5 @@
#
# Copyright 2016 the original author or authors.
# Copyright 2016-2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,4 @@
# limitations under the License.
#

configuration-properties.classes=org.springframework.cloud.task.app.spark.yarn.SparkYarnTaskProperties, \
org.springframework.cloud.task.sparkapp.common.SparkAppCommonTaskProperties

configuration-properties.classes=org.springframework.cloud.task.app.spark.yarn.SparkYarnTaskProperties
@@ -0,0 +1,17 @@
#
# Copyright 2017 the original author or authors.
#
# Licensed 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.
#

org.springframework.boot.env.EnvironmentPostProcessor=org.springframework.cloud.task.app.spark.yarn.SparkYarnEnvironmentPostProcessor

0 comments on commit fd100ff

Please sign in to comment.