Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aws-POC merge to develop #1632

Merged
merged 38 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
18cb47f
1422 and 1423 Remove HDFS and Oozie from Menas
Zejnilovic Jul 2, 2020
dcde55e
#1422 Fix HDFS location validation
Zejnilovic Jul 13, 2020
a817cfe
#1424 Add Menas Dockerfile
Zejnilovic Jul 13, 2020
e4432d1
Merge branch 'develop' into aws-poc
dk1844 Aug 13, 2020
ff10529
Merge pull request #1484 from AbsaOSS/aws-poc-update-from-develop-2.1…
dk1844 Aug 13, 2020
60d2948
#1416 hadoop-aws 2.8.5 + s3 aws sdk 2.13.65 compiles.
dk1844 Aug 5, 2020
d41cc7e
#1416 - enceladus on S3:
dk1844 Aug 12, 2020
67e4012
#1416 - enceladus on S3 - (crude) conformance works on s3 (s3 std inp…
dk1844 Aug 12, 2020
ac0785d
ref issue = 1416
dk1844 Aug 13, 2020
a8d53f9
related test cases ignored (issue reference added)
dk1844 Aug 13, 2020
85570d7
PR updates
dk1844 Aug 17, 2020
7be3afb
Merge spline 0.5.3 into aws-poc
Zejnilovic Aug 19, 2020
aa69593
Update spline to 0.5.4 for AWS PoC
Zejnilovic Aug 24, 2020
0bd704c
Merge branch 'aws-poc' into feature/1416-aws-emr-poc
dk1844 Aug 24, 2020
0b60b1a
Merge pull request #1483 from AbsaOSS/feature/1416-aws-emr-poc
dk1844 Aug 24, 2020
0450459
#1503 Remove HDFS url Validation
Zejnilovic Aug 27, 2020
2b3c39c
New dockerfile - smaller image
Zejnilovic Aug 27, 2020
5dfc40f
s3 persistence (atum, sdk fs usage, ...) (#1526)
dk1844 Oct 16, 2020
5b5628e
Feature/1556 file access PoC using Hadoop FS API (#1586)
dk1844 Nov 9, 2020
4598946
1554 Tomcat with TLS in Docker container (#1585)
AdrianOlosutean Nov 13, 2020
a9efecd
#1499 Add authentication to /lineage + update spline to 0.5.5
Adrian-Olosutean Nov 23, 2020
5da8e36
Merge pull request #1606 from AbsaOSS/feature/1499-spline-in-menas-aws
lokm01 Nov 24, 2020
34aefbb
#1618 - fixes failing spline 0.5.5 integration by providing compatibl…
dk1844 Dec 14, 2020
b4debed
Merge branch 'aws-poc' into aws-merge-to-develop
Zejnilovic Dec 22, 2020
c6094e1
WIP fixing merge issues
Zejnilovic Dec 22, 2020
9d39ca0
* Merge compiles
benedeki Dec 29, 2020
9e277b2
* put back HDFS browser
benedeki Jan 7, 2021
4689308
* AWS SDK Exclusion
benedeki Jan 8, 2021
0d95c42
* New ATUM version
benedeki Jan 11, 2021
267a457
* Adding missing files
benedeki Jan 11, 2021
105904b
Merge branch 'develop' into aws-merge-to-develop
benedeki Jan 11, 2021
8702f88
1622: Merge of aws-poc to develop brach
benedeki Jan 20, 2021
7999644
Merge branch 'develop' into aws-merge-to-develop
benedeki Jan 20, 2021
2391788
* comments improvement
benedeki Jan 22, 2021
3050cbc
1434 Add new way of serving properties to Docker
Zejnilovic Jan 25, 2021
88bcd9a
Merge branch 'develop' into aws-merge-to-develop
benedeki Jan 28, 2021
d0af27b
* Scopt 4.0.0
benedeki Jan 29, 2021
8b0634d
Merge branch 'aws-merge-to-develop' of https://github.com/AbsaOSS/enc…
benedeki Jan 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ case class Dataset(name: String,
def setHDFSPath(newPath: String): Dataset = this.copy(hdfsPath = newPath)
def setHDFSPublishPath(newPublishPath: String): Dataset = this.copy(hdfsPublishPath = newPublishPath)
def setConformance(newConformance: List[ConformanceRule]): Dataset = this.copy(conformance = newConformance)
def setSchedule(newSchedule: Option[OozieSchedule]): Dataset = this.copy(schedule = newSchedule)
override def setParent(newParent: Option[MenasReference]): Dataset = this.copy(parent = newParent)

def propertiesAsMap: Map[String, String] = properties.getOrElse(Map.empty)
Expand All @@ -88,11 +89,10 @@ case class Dataset(name: String,

private def substituteMappingConformanceRuleCharacter(dataset: Dataset, from: Char, to: Char): Dataset = {
val conformanceRules = dataset.conformance.map {
case m: MappingConformanceRule => {
case m: MappingConformanceRule =>
m.copy(attributeMappings = m.attributeMappings.map(key => {
(key._1.replace(from, to), key._2)
}))
}
case c: ConformanceRule => c
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2018 ABSA Group Limited
*
* 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 za.co.absa.enceladus.model.menas

case class HDFSFolder
(
path: String,
name: String,
children: Option[Seq[HDFSFolder]]
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package za.co.absa.enceladus.model.dataFrameFilter

import org.scalatest.FunSuite
import org.apache.spark.sql.functions.{col, lit, not => columnNot}
import org.apache.spark.sql.types._
import org.scalatest.funsuite.AnyFunSuite

class DataFrameFilterSuite extends FunSuite {
class DataFrameFilterSuite extends AnyFunSuite {
test("Filter for equal value") {
val filterExpr = EqualsFilter("column1", "v").filter.expr
val expected = (col("column1") === lit("v")).expr
Expand Down
16 changes: 11 additions & 5 deletions menas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@
<artifactId>webjars-locator-core</artifactId>
<version>${webjars.locator.version}</version>
</dependency>
<dependency>
<groupId>za.co.absa.spline</groupId>
<artifactId>client-ui</artifactId>
<version>${spline.ui.version}</version>
</dependency>
<dependency>
<groupId>org.apache.oozie</groupId>
<artifactId>oozie-client</artifactId>
Expand Down Expand Up @@ -270,6 +265,17 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>za.co.absa</groupId>
<artifactId>atum_${scala.compat.version}</artifactId>
<version>${atum.version}</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
49 changes: 47 additions & 2 deletions menas/src/main/resources/application.properties.template
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ menas.environment=Dev

menas.spark.master=local[1]

# The api gateway for Lineage (Spline) display. If empty Lineage button is not shown.
# The template for Lineage (Spline) display. If empty Lineage button is not shown.
# Avoiding the http(s) protocol will cause that the same protocol will be used as for Menas itself, avoiding issues
menas.lineage.readApiUrl=//localhost:8080/spline-gw/consumer
spline.urlTemplate=//localhost:8080/spline/dataset/lineage/_search?path=%s&application_id=%s

#system-wide time zone
timezone=UTC
Expand All @@ -99,6 +99,51 @@ management.health.jms.enabled=false
# Limit on the number of documents to be fetch in a single mongodb query and shown in UI
menas.monitoring.fetch.limit=500

#--------Oozie
#menas.oozie.oozieUrl=http://localhost:11000/oozie/

#Path where oozie coordinators and workflows are stored on HDFS
#menas.oozie.schedule.hdfs.path=/tmp
#menas.oozie.timeZone=Africa/Ceuta

#This is passed into oozie.action.sharelib.for.spark
#This ensures that schedules are run with correct version of spark without updating oozie sharelibs globally
menas.oozie.sharelibForSpark=spark-menas

#This parameter disables sharelibForSpark. It's the absolute path to a location containing all relevant spark sharelibs
#menas.oozie.libpath=/some/path/libpath

#Enceladus jars are going to be loaded into this location
menas.oozie.enceladusJarLocation=hdfs:///tmp/enceladus-jars

#Maven repo from which to resolve enceladus jars.. Can be local repo, maven central, nexus
menas.oozie.mavenRepoLocation=https://repo.maven.apache.org/maven2/

#standardization and conformance path in the repo
menas.oozie.mavenSparkJobsJarLocation=/za/co/absa/enceladus/spark-jobs/@project.version@/[email protected]@.jar

#Menas URL for submitted std and conf jobs
menas.oozie.menasApiURL=http://menasHostname:8080/menas/api

#Mongo address for spline for the submitted jobs
menas.oozie.splineMongoURL=mongodb://localhost:27017

#In some cases extra driver options need to be surrounded by double quotes
#This seems to depend of the version of oozie
#menas.oozie.sparkConf.surroundingQuoteChar="

#Configure the following three parameters to use oozie impersonation
#menas.oozie.proxyUser=oozieProxyUser
#menas.oozie.proxyGroup=oozieProxyGroup
#menas.oozie.proxyUserKeytab=/path/to/keytab

#The following property allows customization of the error message presented to the user if they're missing the impersonation group
#menas.oozie.customImpersonationExceptionMessage="Please add the system user into the '${menas.oozie.proxyGroup}' group to use this feature."

#Provide optional spark config options to be passed onto standardization and conformance jobs
#menas.oozie.extraSparkConfigs={"spark.eventLog.dir" : "hdfs:///spark2-history/", \
#"spark.history.fs.logDirectory": "hdfs:///spark2-history" }

#----------- Schema Registry
# URL of schema registry [optional]:
# when unset, the ability to load schema by subject name from the schema repository will not be present
Expand Down

This file was deleted.

19 changes: 4 additions & 15 deletions menas/src/main/scala/za/co/absa/enceladus/menas/MvcConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,13 @@

package za.co.absa.enceladus.menas

import org.springframework.context.annotation.{Bean, Configuration}
import org.springframework.web.servlet.config.annotation.{ResourceHandlerRegistry, ViewControllerRegistry, WebMvcConfigurer}
import org.webjars.WebJarAssetLocator
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
class MvcConfig extends WebMvcConfigurer {
@Bean
def webJarAssetLocator: WebJarAssetLocator = new WebJarAssetLocator()

override def addResourceHandlers(registry: ResourceHandlerRegistry) {
registry
.addResourceHandler(LineageConfig.resourceHandler)
.addResourceLocations(LineageConfig.resourceLocation)
.resourceChain(true)
.addResolver(new WebJarsResourceFuzzyResolver(webJarAssetLocator))
}

override def addViewControllers(registry: ViewControllerRegistry) {
def addViewControllers(registry: ViewControllerRegistry) {
registry.addViewController("/login").setViewName("login")
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package za.co.absa.enceladus.menas.controllers

import org.springframework.beans.factory.annotation.Value
import org.springframework.web.bind.annotation.{GetMapping, RequestMapping, RestController}
import za.co.absa.enceladus.menas.LineageConfig

@RestController
@RequestMapping(Array("/api/configuration"))
Expand All @@ -29,9 +28,4 @@ class ConfigurationController extends BaseController {
def getEnvironment(): String = {
menasEnvironment
}

@GetMapping(path = Array("/lineageExecutionIdApiTemplate"))
def getLineageExecutionIdApiTemplate(): String = {
LineageConfig.executionIdApiTemplate.getOrElse("")
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep
import za.co.absa.enceladus.menas.exceptions._
import za.co.absa.enceladus.menas.models.RestError
import za.co.absa.enceladus.menas.models.rest.RestResponse
import za.co.absa.enceladus.model.properties.propertyType.PropertyTypeValidationException
import za.co.absa.enceladus.model.{UsedIn, Validation}
import za.co.absa.enceladus.menas.models.Validation
import za.co.absa.enceladus.menas.models.rest.errors.{RemoteSchemaRetrievalError, RequestTimeoutExpiredError, SchemaFormatError, SchemaParsingError}
import za.co.absa.enceladus.menas.models.rest.exceptions.{RemoteSchemaRetrievalException, SchemaFormatException, SchemaParsingException}
import za.co.absa.enceladus.model.UsedIn
import za.co.absa.enceladus.model.properties.propertyType.PropertyTypeValidationException
import za.co.absa.enceladus.model.{UsedIn, Validation}

@ControllerAdvice(annotations = Array(classOf[RestController]))
class RestExceptionHandler {

@Value("${menas.oozie.customImpersonationExceptionMessage:}")
val oozieImpersonationExceptionMessage: String = ""

@Value("${menas.oozie.proxyGroup:}")
val oozieProxyGroup: String = ""

private val logger = LoggerFactory.getLogger(this.getClass)

@ExceptionHandler(value = Array(classOf[AsyncRequestTimeoutException]))
Expand Down Expand Up @@ -105,4 +109,24 @@ class RestExceptionHandler {
ResponseEntity.notFound().build[Any]()
}

@ExceptionHandler(Array(classOf[OozieActionException]))
def handleOozieActionException(ex: OozieActionException): ResponseEntity[RestError] = {
val err = RestError(ex.getMessage)
logger.error(s"Exception: $err", ex)
new ResponseEntity(err, HttpStatus.INTERNAL_SERVER_ERROR)
}

@ExceptionHandler(Array(classOf[OozieClientException]))
def handleOozieClientException(ex: OozieClientException): ResponseEntity[RestError] = {
val err = if (ex.getMessage.toLowerCase.contains("unauthorized proxyuser")) {
val message = if (oozieImpersonationExceptionMessage.nonEmpty) oozieImpersonationExceptionMessage else
s"Please add the system user into ${oozieProxyGroup} group to use this feature."
RestError(message)
} else {
RestError(ex.getMessage)
}

logger.error(s"Exception: $err", ex)
new ResponseEntity(err, HttpStatus.INTERNAL_SERVER_ERROR)
}
}
Loading