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 all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ myTestCheckpoints
**/main/resources/application.yml
**/main/resources/spline.properties
**/main/resources/kafka.properties
**/menas/*/main/resources/*.properties
**/enceladus_env.sh
*.config
*.keytab
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package za.co.absa.enceladus.dao.auth
import com.typesafe.config.ConfigFactory
import org.apache.spark.sql.SparkSession
import sun.security.krb5.internal.ktab.KeyTab
import za.co.absa.enceladus.utils.fs.FileSystemVersionUtils
import za.co.absa.enceladus.utils.fs.{FileSystemUtils, HadoopFsUtils}

sealed abstract class MenasCredentials {
val username: String
Expand All @@ -40,9 +40,9 @@ object MenasPlainCredentials {
* @return An instance of Menas Credentials.
*/
def fromFile(path: String)(implicit spark: SparkSession): MenasPlainCredentials = {
val fsUtils = new FileSystemVersionUtils(spark.sparkContext.hadoopConfiguration)
val fs = FileSystemUtils.getFileSystemFromPath(path)(spark.sparkContext.hadoopConfiguration)

val conf = ConfigFactory.parseString(fsUtils.getFileContent(path))
val conf = ConfigFactory.parseString(HadoopFsUtils.getOrCreate(fs).getLocalOrDistributedFileContent(path))
MenasPlainCredentials(conf.getString("username"), conf.getString("password"))
}
}
Expand All @@ -55,9 +55,9 @@ object MenasKerberosCredentials {
* @return An instance of Menas Credentials.
*/
def fromFile(path: String)(implicit spark: SparkSession): MenasKerberosCredentials = {
val fsUtils = new FileSystemVersionUtils(spark.sparkContext.hadoopConfiguration)
val fs = FileSystemUtils.getFileSystemFromPath(path)(spark.sparkContext.hadoopConfiguration)

val localKeyTabPath = fsUtils.getLocalPathToFile(path)
val localKeyTabPath = HadoopFsUtils.getOrCreate(fs).getLocalPathToFileOrCopyToLocal(path)
val keytab = KeyTab.getInstance(localKeyTabPath)
val username = keytab.getOneName.getName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@

package za.co.absa.enceladus.dao.rest

import org.scalatest.mockito.MockitoSugar
import org.scalatest.{BeforeAndAfter, Matchers, WordSpec}
import org.mockito.scalatest.MockitoSugar
import org.scalatest.wordspec.AnyWordSpec
import org.scalatest.BeforeAndAfter
import org.scalatest.matchers.should.Matchers

abstract class BaseTestSuite extends WordSpec
abstract class BaseTestSuite extends AnyWordSpec
with Matchers
with MockitoSugar
with BeforeAndAfter
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

package za.co.absa.enceladus.dao.rest

import org.scalatest.{Matchers, WordSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import za.co.absa.enceladus.dao.UnauthorizedException
import za.co.absa.enceladus.dao.auth.{InvalidMenasCredentials, MenasKerberosCredentials, MenasPlainCredentials}

class RestDaoFactorySuite extends WordSpec with Matchers {
class RestDaoFactorySuite extends AnyWordSpec with Matchers {

private val menasApiBaseUrls = List("http://localhost:8080/menas/api")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
package za.co.absa.enceladus.dao.rest.auth

import org.mockito.stubbing.OngoingStubbing
import org.scalatest.mockito.MockitoSugar
import org.scalatest.{BeforeAndAfter, Matchers, WordSpec}
import org.scalatest.matchers.should.Matchers
import org.mockito.scalatest.MockitoSugar
import org.scalatest.wordspec.AnyWordSpec
import org.scalatest.BeforeAndAfter
import org.springframework.http.{HttpHeaders, ResponseEntity}
import org.springframework.util.LinkedMultiValueMap
import org.springframework.web.client.RestTemplate
import za.co.absa.enceladus.dao.UnauthorizedException
import za.co.absa.enceladus.dao.rest.{ApiCaller, ApiCallerStub, AuthClient}

abstract class AuthClientSuite() extends WordSpec
abstract class AuthClientSuite() extends AnyWordSpec
with Matchers
with MockitoSugar
with BeforeAndAfter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

package za.co.absa.enceladus.dao.rest.auth

import org.scalatest.WordSpec
import org.scalatest.wordspec.AnyWordSpec
import za.co.absa.enceladus.dao.auth.MenasPlainCredentials
import za.co.absa.enceladus.utils.fs.FileSystemVersionUtils
import za.co.absa.enceladus.utils.fs.LocalFsUtils
import za.co.absa.enceladus.utils.testUtils.SparkTestBase

class MenasPlainCredentialsSuite extends WordSpec with SparkTestBase {
class MenasPlainCredentialsSuite extends AnyWordSpec with SparkTestBase {

"MenasPlainCredentials" should {
"be read from *.conf" in {
Expand All @@ -42,9 +42,7 @@ class MenasPlainCredentialsSuite extends WordSpec with SparkTestBase {
val homeDir = System.getProperty("user.home")
val expected = s"$homeDir/dir/file"

val fsUtils = new FileSystemVersionUtils(spark.sparkContext.hadoopConfiguration)

val actual = fsUtils.replaceHome("~/dir/file")
val actual = LocalFsUtils.replaceHome("~/dir/file")
assert(actual == expected)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,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
Expand Up @@ -15,10 +15,10 @@

package za.co.absa.enceladus.model

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite
import za.co.absa.enceladus.model.conformanceRule.LiteralConformanceRule

class DatasetTest extends FunSuite {
class DatasetTest extends AnyFunSuite {
private val conformanceRule1 = LiteralConformanceRule(
order = 0,
controlCheckpoint = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

package za.co.absa.enceladus.model

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite

class MappingTableTest extends FunSuite {

class MappingTableTest extends AnyFunSuite {
private val defaultValue1 = DefaultValue("someColumn", "alfa")
private val defaultValue2 = DefaultValue("otherColumn", "beta")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

package za.co.absa.enceladus.model

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite
import za.co.absa.enceladus.model.properties.PropertyDefinition
import za.co.absa.enceladus.model.properties.essentiality.Mandatory
import za.co.absa.enceladus.model.properties.propertyType.{EnumPropertyType, PropertyTypeValidationException, StringPropertyType}

class PropertyDefinitionTest extends FunSuite {
class PropertyDefinitionTest extends AnyFunSuite {

private val modelVersion = ModelVersion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

package za.co.absa.enceladus.model

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite

class SchemaFieldTest extends FunSuite {
class SchemaFieldTest extends AnyFunSuite {
private val schemaFieldChildSecondLevel = SchemaField(
name = "String",
`type` = "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

package za.co.absa.enceladus.model

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite

class SchemaTest extends FunSuite {
class SchemaTest extends AnyFunSuite {
private val schemaField = SchemaField(
name = "someField",
`type` = "StringType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package za.co.absa.enceladus.model.conformanceRule

import com.fasterxml.jackson.databind.{ObjectMapper, SerializationFeature}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import org.scalatest.{Matchers, WordSpec}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class ConformanceRuleTest extends WordSpec with Matchers {
class ConformanceRuleTest extends AnyWordSpec with Matchers {

private val objectMapper = new ObjectMapper()
.registerModule(DefaultScalaModule)
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

package za.co.absa.enceladus.model.menas.audit

import org.scalatest.FunSuite
import org.scalatest.funsuite.AnyFunSuite
import za.co.absa.enceladus.model.Dataset
import za.co.absa.enceladus.model.conformanceRule.{DropConformanceRule, LiteralConformanceRule}
import za.co.absa.enceladus.model.conformanceRule.ConformanceRule

class AuditableTest extends FunSuite {
class AuditableTest extends AnyFunSuite {
val obj1 = Dataset(name = "Test DS",
version = 0,
hdfsPath = "oldPath",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import za.co.absa.enceladus.examples.interpreter.rules.custom.UppercaseCustomCon
import za.co.absa.enceladus.model.Dataset
import za.co.absa.enceladus.utils.time.TimeZoneNormalizer

object CustomRuleSample1 {
object CustomRuleSample1 extends CustomRuleSampleFs {

case class ExampleRow(id: Int, makeUpper: String, leave: String)
case class OutputRow(id: Int, makeUpper: String, leave: String, doneUpper: String)
Expand Down Expand Up @@ -78,7 +78,7 @@ object CustomRuleSample1 {
.setCatalystWorkaroundEnabled(isCatalystWorkaroundEnabled)
.setControlFrameworkEnabled(enableCF)

val outputData: DataFrame = DynamicInterpreter.interpret(conformanceDef, inputData)
val outputData: DataFrame = DynamicInterpreter().interpret(conformanceDef, inputData)

outputData.show(false)
//scalastyle:on magicnumber
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import za.co.absa.enceladus.examples.interpreter.rules.custom.LPadCustomConforma
import za.co.absa.enceladus.model.Dataset
import za.co.absa.enceladus.utils.time.TimeZoneNormalizer

object CustomRuleSample2 {
object CustomRuleSample2 extends CustomRuleSampleFs {

case class ExampleRow(id: Int, addPad: String, leave: String)
case class OutputRow(id: Int, addPad: String, leave: String, donePad: String)
Expand Down Expand Up @@ -81,7 +81,7 @@ object CustomRuleSample2 {
.setCatalystWorkaroundEnabled(isCatalystWorkaroundEnabled)
.setControlFrameworkEnabled(enableCF)

val outputData: DataFrame = DynamicInterpreter.interpret(conformanceDef, inputData)
val outputData: DataFrame = DynamicInterpreter().interpret(conformanceDef, inputData)

outputData.show(false)
// scalastyle:on magic.number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import za.co.absa.enceladus.examples.interpreter.rules.custom.{LPadCustomConform
import za.co.absa.enceladus.model.Dataset
import za.co.absa.enceladus.utils.time.TimeZoneNormalizer

object CustomRuleSample3 {
object CustomRuleSample3 extends CustomRuleSampleFs {
implicit val spark: SparkSession = SparkSession.builder
.master("local[*]")
.appName("CustomRuleSample3")
Expand Down Expand Up @@ -79,7 +79,7 @@ object CustomRuleSample3 {
.setCatalystWorkaroundEnabled(isCatalystWorkaroundEnabled)
.setControlFrameworkEnabled(enableCF)

val outputData: DataFrame = DynamicInterpreter.interpret(conformanceDef, inputData)
val outputData: DataFrame = DynamicInterpreter().interpret(conformanceDef, inputData)

outputData.show()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import za.co.absa.enceladus.examples.interpreter.rules.custom.{LPadCustomConform
import za.co.absa.enceladus.model.Dataset
import za.co.absa.enceladus.utils.time.TimeZoneNormalizer

object CustomRuleSample4 {
object CustomRuleSample4 extends CustomRuleSampleFs {
TimeZoneNormalizer.normalizeJVMTimeZone() //normalize JVM time zone as soon as possible

/**
Expand Down Expand Up @@ -135,9 +135,10 @@ object CustomRuleSample4 {
result
}

implicit val spark: SparkSession = buildSparkSession()

def main(args: Array[String]): Unit = {
val cmd: CmdConfigLocal = getCmdLineArguments(args)
implicit val spark: SparkSession = buildSparkSession()

val conf = ConfigFactory.load()
val menasBaseUrls = MenasConnectionStringParser.parse(conf.getString("menas.rest.uri"))
Expand Down Expand Up @@ -186,7 +187,7 @@ object CustomRuleSample4 {
.setCatalystWorkaroundEnabled(true)
.setControlFrameworkEnabled(false)

val outputData: DataFrame = DynamicInterpreter.interpret(conformanceDef, inputData)
val outputData: DataFrame = DynamicInterpreter().interpret(conformanceDef, inputData)
outputData.show()
saveToCsv(outputData, cmd.outPath)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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.examples

import org.apache.hadoop.fs.FileSystem
import org.apache.spark.sql.SparkSession
import za.co.absa.enceladus.utils.fs.HadoopFsUtils

trait CustomRuleSampleFs {
def spark: SparkSession

implicit val fs: FileSystem = FileSystem.get(spark.sparkContext.hadoopConfiguration)
implicit val fsUtils: HadoopFsUtils = HadoopFsUtils.getOrCreate(fs)
}
Loading