Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
406 commits
Select commit Hold shift + click to select a range
7029f03
Use older scalatest which is compatible with current scalamock
Sep 6, 2016
cfa7017
Avoid temporary files on s3
Sep 6, 2016
4a30c2d
Merge branch 'branch-2.0' of github.com:chaordic/ignition-core into b…
Sep 6, 2016
30ea544
Fixed doc error
Sep 6, 2016
796a15e
Merge pull request #87 from chaordic/branch-2.0
douglaz Sep 13, 2016
85f920d
Added logging factor to groupByKeyAndTake
Sep 20, 2016
a3d5f50
Merge pull request #88 from chaordic/limit_logging
douglaz Sep 20, 2016
2b3231c
make provided s3 dependencies
Sep 22, 2016
9d0b51f
Merge pull request #89 from fparisotto/make-provided-s3-dependencies
douglaz Sep 22, 2016
ee0ed1e
classpath fix revert
Sep 22, 2016
df3dcf4
Merge pull request #90 from chaordic/classpath-fix2
fparisotto Sep 22, 2016
98ef724
Added Future.withTimeout
Sep 27, 2016
81c4d75
Merge pull request #91 from chaordic/future_timeout
douglaz Sep 27, 2016
34afa42
Moved async http to core
Sep 29, 2016
733731b
Add test script
Sep 30, 2016
7bfcc86
Merge pull request #92 from chaordic/async_move
douglaz Sep 30, 2016
a1f1c38
retry on cluster health check
Sep 30, 2016
b667ce6
Set host with correct port and ssl support
Sep 30, 2016
b5e16a9
Merge pull request #93 from fparisotto/retry-healthcheck
fparisotto Oct 3, 2016
caf4022
Merge pull request #94 from chaordic/host_setup
douglaz Oct 3, 2016
e0457bb
Allow a granular fallback to external configuration
Oct 3, 2016
5269943
Move telemetry cache to core
Oct 3, 2016
23a0f78
Merge pull request #95 from chaordic/http_conf
douglaz Oct 4, 2016
cce2d16
Merge branch 'telemetry_cache' of github.com:chaordic/ignition-core i…
Oct 4, 2016
4d7f613
Merge pull request #96 from chaordic/telemetry_cache
douglaz Oct 4, 2016
d89a08e
Make retry configurable
Oct 19, 2016
c180e30
Merge pull request #97 from chaordic/better_retry
douglaz Oct 20, 2016
a7ee8d4
Multiple level cache: local with remote fallback
Oct 21, 2016
e07fe16
Now it implements async updates
Oct 26, 2016
5018bf9
Added spray cache and minor improvements
Oct 26, 2016
7518278
Make remoteLockTTL a parameter, change ttl to FiniteDuration and expl…
Oct 27, 2016
14ff519
Add ec to setLock
Oct 27, 2016
60db77c
Minor stuff
Oct 27, 2016
5f6ace3
Add sanity test
Oct 27, 2016
c863849
support for setting headers in http client request
Oct 31, 2016
046e4a8
enable new spark version 2.0.1
Oct 31, 2016
3bfe4d8
update to spark-2.0.1
Oct 31, 2016
c22b70f
Merge pull request #99 from chaordic/httpclient-support-headers
fparisotto Oct 31, 2016
4465883
Merge pull request #100 from chaordic/update-spark-2.0.1
fparisotto Oct 31, 2016
612c642
Added elapsed time and some new metrics
Oct 31, 2016
dc2a704
Merge branch 'master' of github.com:chaordic/ignition-core into remot…
Oct 31, 2016
b47a54b
Make local cache optional, do a backoff on retries
Nov 1, 2016
5b3cfa0
Added set method
Nov 1, 2016
6b450cb
Rename ExpiringMultipleLevelCache to ExpiringMultiLevelCache
Nov 1, 2016
b421352
Better put the scheduler on each method than on constructor
Nov 1, 2016
1b1ad65
Added sanity check feature
Nov 3, 2016
1f7dbbf
Improve sanity check and use UTC dates on timestamped values
Nov 4, 2016
fed5257
Merge pull request #98 from chaordic/remote_cache
douglaz Nov 7, 2016
daf6eab
Fallback on remote not found while in sanity check
Nov 7, 2016
b6fbd21
suport for x1 instance type
Nov 7, 2016
362fb9e
Merge pull request #102 from fparisotto/x1-ec2-instance
fparisotto Nov 7, 2016
aa55e11
rename private Entry class to avoid assembly issues
Nov 8, 2016
d0b220b
Merge pull request #103 from fparisotto/avoid-conflict-assembly
fparisotto Nov 8, 2016
9b08575
Remove close dates report because it is too much trouble for nothing
Nov 11, 2016
64c65a6
Smart and lazy s3 list
Nov 18, 2016
5d89279
Merge pull request #105 from chaordic/smart
douglaz Nov 19, 2016
5881afe
Removed custom boto because having 2 boto versions is confusing and u…
Nov 19, 2016
b23af6c
Merge pull request #106 from chaordic/remove_custom_boto
douglaz Nov 19, 2016
002c38f
fix date filter
fparisotto Nov 20, 2016
4434073
Merge pull request #107 from fparisotto/fix-date-filter
fparisotto Nov 20, 2016
31ace49
Fix date validation for paths without files
Nov 21, 2016
b77b9db
Merge pull request #108 from chaordic/date_fix
douglaz Nov 21, 2016
4ecd942
Performs date validation only if there are files to be validated
Nov 22, 2016
ec76c6d
Merge pull request #109 from chaordic/date_validation_again
douglaz Nov 22, 2016
6e1cb5e
to string for IntBag
Nov 24, 2016
2d1bee4
Merge pull request #110 from fparisotto/tosrt-intbag
fparisotto Nov 24, 2016
135a753
Avoid checking too early the job
Nov 29, 2016
a448261
Merge pull request #111 from chaordic/check
douglaz Nov 29, 2016
8b91ee3
Updated spark
Dec 7, 2016
f712f06
Added spark 2.0.2
Dec 7, 2016
5fb4067
Create an uri along the request to guarantee the request is valid
Dec 29, 2016
958898b
Merge pull request #112 from chaordic/early_uri
douglaz Dec 29, 2016
b243713
request uri sanitization effort
fernandors87 Jan 5, 2017
fbc2812
Merge pull request #113 from chaordic/sane_request_url
fernandors87 Jan 11, 2017
2a8ff5f
URLUtils
fernandors87 Jan 17, 2017
4a166e9
Merge pull request #114 from chaordic/url_utils
fernandors87 Jan 18, 2017
51119b1
Replace spark-ec2 by flintrock as cluster launcher
Feb 2, 2017
2b3c7a3
Avoid changing permissions of .ssh directory
Feb 6, 2017
16c1e34
Merge pull request #115 from chaordic/flintrock_migration
douglaz Feb 13, 2017
5861066
make parseUri return a Try (#116)
fernandors87 Feb 14, 2017
21f9136
Make it possible to save job execution
Mar 1, 2017
efbf31b
Make EBS root size be configurable
Mar 14, 2017
f07b9c9
Merge pull request #117 from chaordic/root_ebs
douglaz Mar 14, 2017
2f57ac4
updating flintrock version (#118)
fernandors87 Apr 3, 2017
d15fca4
Improve flintrock sanity check and minor stuff
Apr 3, 2017
2b9c6b6
Merge pull request #119 from chaordic/improvements
douglaz Apr 4, 2017
a8d8a22
Use master flintrock
Apr 4, 2017
66b16c5
Create README.md
rafaelzimmermann Jun 15, 2017
4861be7
disable verbose spark logging for tests
Jul 7, 2017
42145ee
Merge pull request #121 from fparisotto/disable-logging-for-tests
fparisotto Jul 10, 2017
c628ed5
Fix weird await on test
hensg Jul 19, 2017
c8fcc3e
Add log4j configuration to avoid annoying test log
hensg Jul 19, 2017
ce4cfb5
Fix wrong file name
hensg Jul 19, 2017
bd174ed
Merge pull request #122 from chaordic/hotfix/disable-annoying-test-logs
hensg Jul 20, 2017
34a13f8
update dependencies
Jul 25, 2017
2fd4875
update spark and flintrock
Jul 27, 2017
a7e2f73
Merge branch 'master' of github.com:chaordic/ignition-core into big-u…
Aug 1, 2017
766ab9c
update flintrock
Aug 1, 2017
5141aa7
fix versions
Aug 1, 2017
0c0d986
ExpiringMultiLevelCache: caching 404
Aug 18, 2017
36c1448
ExpiringMultiLevelCache: caching errors when only LocalCache
Aug 22, 2017
131f6ba
ExpiringMultiLevelCache: some improvement in tests
Aug 24, 2017
bf04dc6
ExpiringMultiLevelCache: optional support to cache error with differr…
Aug 24, 2017
44651b4
ExpiringMultiLevelCache: testing ttl
Aug 24, 2017
14a5ca2
ExpiringMultiLevelCache: refactoring after code review
Aug 28, 2017
4952a61
ExpiringMultiLevelCache: Using Try properly with Future.fromTry
Aug 31, 2017
55f5dcf
Merge pull request #124 from chaordic/caching-404
Sep 4, 2017
907c4e0
Merge pull request #123 from fparisotto/big-update
fparisotto Sep 5, 2017
4cff432
I hope now we fixed those tests random failures
Oct 17, 2017
ce0e6f2
and here we go...
Oct 17, 2017
3f885eb
random programming...
Oct 18, 2017
e9d4703
simple version...
Oct 18, 2017
6a52e19
sync this too
Oct 18, 2017
e63171c
Merge pull request #125 from chaordic/ihaveadream
fparisotto Oct 18, 2017
979a899
fix too many open files (#126)
fernandors87 Nov 6, 2017
6a9f7a8
changing ulimit -n to an usual value (#127)
fernandors87 Nov 8, 2017
7c5ebfd
moving this class to a better scope
Nov 23, 2017
ce9d356
using java8
Nov 23, 2017
6e11cda
Merge pull request #128 from chaordic/fix-filesizeestimator
fparisotto Nov 23, 2017
cc08dce
Update zeppelin to latest version and spark memory parameter
hensg Feb 19, 2018
92599ce
Workaround to use private vpc
hensg Mar 8, 2018
4c118a1
Fix DNS names for launching on private subnet
hensg Mar 8, 2018
ca1fee2
Merge pull request #130 from chaordic/hotfix/zeppeling
hensg Mar 9, 2018
67ac87a
Improve stderr and cluster destroy (#132)
roeckandre Mar 14, 2018
d30f140
flintrok with private vpc support
Apr 3, 2018
8238819
Merge pull request #133 from chaordic/wa/vpc-private-flintrock
fparisotto Apr 3, 2018
f5e74bd
Merge pull request #131 from chaordic/wa/vpc-private
fparisotto Apr 3, 2018
306cd39
update flintrock
Apr 10, 2018
f350096
Merge pull request #134 from chaordic/update-flintrock
fparisotto Apr 10, 2018
6ced247
update spark and hadoop
Apr 24, 2018
3591fdb
script to create ami
Apr 25, 2018
040b7e6
update to a new ami
Apr 25, 2018
144f240
update flintrock
Apr 25, 2018
fedf0eb
reverting commented lines by mistake
Apr 25, 2018
78a5ce3
flintrock updates
May 2, 2018
ea1fc34
flintrock update
May 3, 2018
fe8a500
Merge pull request #135 from chaordic/update-hadoop2.7.6-spark2.3.0
fparisotto May 3, 2018
37735f7
passing forward to sync the file size estimator
Jun 7, 2018
2b012e7
Merge pull request #136 from chaordic/fix-filesizeestimator-parameter
fparisotto Jun 7, 2018
db7125d
update spark 2.3.1, hadoop 2.8.4, flintrock with support for spark wi…
Jun 15, 2018
74c3cb3
update flintrock
Jun 19, 2018
134ebca
Merge pull request #137 from chaordic/spark-hadoop-update
fparisotto Jun 19, 2018
6350c67
increase ulimit open files, to help in big shuffles
Jun 22, 2018
8b58235
update flintrok with nvme support
Jun 22, 2018
d7d2f14
Merge pull request #138 from chaordic/bigger-ulimit
fparisotto Jun 25, 2018
0b6c0c5
rollback hadoop to 2.7.6, because of issues with spark sql
Jun 26, 2018
2aba31e
Merge pull request #139 from chaordic/rollback-hadoop-2.7.6
fparisotto Jun 26, 2018
eed5d1a
Merge branch 'master' of github.com:chaordic/ignition-core into updat…
Jun 29, 2018
36140c0
Merge pull request #140 from chaordic/update-flintrok-nvme-support
fparisotto Jun 29, 2018
83ed71d
update zeppeling 0.8.0
Jul 2, 2018
dc4683c
Merge pull request #141 from chaordic/zeppelin-update
fparisotto Jul 2, 2018
6f9f219
update flintrock
Jul 4, 2018
6b35854
Merge pull request #142 from chaordic/update-flintrock
fparisotto Jul 4, 2018
cb3f518
Allow to IAM and other credentials to work on s3 listing
Sep 19, 2018
8aaf860
yarn support
Sep 20, 2018
4652865
Added remaining options
douglaz Sep 21, 2018
77fb7a7
Make YARN jobs finish successfully
Sep 21, 2018
033d947
Merge branch 'all_credentials' of github.com:chaordic/ignition-core i…
Sep 21, 2018
175594f
Merge pull request #120 from rafaelzimmermann/patch-1
douglaz Sep 21, 2018
fa6d32f
Update AMI
hensg Sep 24, 2018
0aaa007
Merge pull request #144 from chaordic/hotfix/use-platform-public-api
hensg Sep 25, 2018
709d508
support for jupyter with pyspark
Sep 26, 2018
9ba1e71
Avoid explicit spark context stopping
Sep 26, 2018
cc71992
fixed memory calculation and added executor cores
Sep 26, 2018
f7babee
Merge pull request #145 from chaordic/jupyter-pyspark
fparisotto Sep 26, 2018
bfb364a
tail it :)
Sep 27, 2018
3741fed
Merge pull request #143 from chaordic/all_credentials
douglaz Sep 27, 2018
4382974
exec shell in cluster
Sep 28, 2018
4e900d9
by default, install python3 and pip also tmux
Sep 28, 2018
9bfa59b
fix commentary description
Sep 28, 2018
1f4adc8
Merge pull request #147 from chaordic/default-install-python3-tmux
fparisotto Sep 28, 2018
881892b
Get latest asssembly (lexicographically)
douglaz Oct 1, 2018
2211584
Merge pull request #148 from chaordic/latest_assembly
douglaz Oct 2, 2018
2d5c63b
Enable hive support
Oct 2, 2018
8c71e33
Merge pull request #149 from chaordic/hive_support
douglaz Oct 3, 2018
d67b7f4
Get latest assembly by time
Oct 4, 2018
14fec38
Merge pull request #150 from chaordic/sort_time
douglaz Oct 5, 2018
d7e635a
Added options to conf yarn
Oct 9, 2018
f7468e1
Update submodule - Change ebs to delete on termination (#152)
malfattif Oct 10, 2018
4974ada
Merge pull request #151 from chaordic/conf_yarn
douglaz Oct 10, 2018
0d519ad
Merge branch 'master' into exec-shell-in-cluster
douglaz Oct 16, 2018
1c3644f
Support sudo, avoid loop break on failures
douglaz Oct 17, 2018
bb5e6ad
update to spark 2.3.2
Oct 26, 2018
a9c8274
Merge pull request #153 from chaordic/update-spark-2.3.2
fparisotto Oct 26, 2018
f489fd2
Make cluster.py compatible with python3
Nov 21, 2018
cc510d8
making compatible
Nov 22, 2018
e91eb17
Merge pull request #154 from chaordic/python3
douglaz Nov 27, 2018
e8ec4d6
Lightweight core (#155)
fparisotto Nov 27, 2018
e40cf6b
fix runtime classnotfound issue (#156)
fparisotto Nov 28, 2018
ca56cf6
python3 compatibility
douglaz Nov 29, 2018
b1d5ae0
The quiet flag makes debugging some issues pretty hard
douglaz Dec 4, 2018
0158240
Fixes
douglaz Dec 10, 2018
b93a59e
Merge pull request #157 from chaordic/new-exec-shell-in-cluster
douglaz Dec 10, 2018
ba3b39f
Added RDD-like .values
douglaz Dec 19, 2018
04964c0
Fix extra data cluster saving so scripts like job runner can reuse th…
Dec 20, 2018
61a573e
Merge pull request #158 from chaordic/save_extra_data_fix
douglaz Dec 20, 2018
debd6af
Added new command and made remove files from collect a parameter
Jan 9, 2019
d584c84
Merge pull request #159 from chaordic/collect
douglaz Jan 10, 2019
1ad9969
Make extra args really be usable
Jan 29, 2019
5c4bd76
Merge pull request #160 from chaordic/extra_args
douglaz Jan 30, 2019
0eb6a18
Added singleton to ExecutionRetry
Feb 11, 2019
e7e7a76
install toree (#161)
fparisotto Mar 12, 2019
2225f89
Added Timestamp comparison
Mar 20, 2019
153bd3a
Merge pull request #162 from chaordic/timestamp
douglaz Mar 20, 2019
71d94ca
update to spark=2.4.3, scala=2.12.8 and some compiler fixes (#163)
fparisotto Jun 26, 2019
d1c02ee
rollback to scala 2.11 (#164)
fparisotto Jun 27, 2019
c9f09dd
rollback to spark with hadoop (#165)
fparisotto Jun 27, 2019
0d94bdc
Optional AWS credentials propagation (#166)
renecouto Sep 24, 2019
e2adf96
Wait termination on destroy unsuccessful cluster
flaviozantut May 16, 2022
a063f28
Merge pull request #186 from chaordic/fix/wait-termination-on-destroy…
alexopss May 17, 2022
54c5fae
Fix/circleci
alexopss May 17, 2022
2ab6c46
Merge pull request #187 from chaordic/Fix/circleci
alexopss May 17, 2022
3b5f93f
Updated config.yml
chaordic-automation May 17, 2022
a55ffe7
Add shutting-down state to active instances
flaviozantut May 30, 2022
9223c02
Update CI
flaviozantut Jun 1, 2022
1d0cc7c
Merge pull request #188 from chaordic/fix/add-shutting-down-state-to-…
jpericoco Jun 1, 2022
2ee8f07
updated destroy function inside module cluster.py
allanrolli Jun 8, 2022
dee4d21
Update cluster.py
allanrolli Jun 8, 2022
5cf960a
Update utils.py
allanrolli Jun 10, 2022
5148803
Update cluster.py
allanrolli Jun 10, 2022
268e6d0
Fixing the destroy function on flintrock.
emersonfcamara Jun 15, 2022
5692e45
Creating new methods to manage the destroy cluster before try to crea…
emersonfcamara Jun 20, 2022
16e427b
feat: new flintrock option for create cluster
esseitalo Jun 21, 2022
51c8fdf
Merge pull request #189 from chaordic/feat/destroy-function
alexopss Jun 22, 2022
0744454
Merge branch 'master' into feat/fleet-options
esseitalo Jun 27, 2022
ce1f19d
feat: removing the zone parameter, due to multi az flintrock
esseitalo Jul 8, 2022
9280c4c
Change installation and launch user from root to ec2-user
flaviozantut Jul 13, 2022
aa39bb5
feat: add a function to delete Flintrock SG rules in dev environment
esseitalo Jul 13, 2022
ce109e4
refactor: add new blank line at the end
esseitalo Jul 13, 2022
c81c362
Update tools/revoke_sg_rules.py
Jul 14, 2022
12737d0
refactor: fixing identation, style and add new function
esseitalo Jul 14, 2022
bb8c938
fix: the while check was taking too long to return
esseitalo Jul 14, 2022
1cff8dc
Merge pull request #191 from chaordic/feat/fleet-options
alexopss Jul 18, 2022
d2bb1ea
Merge pull request #193 from chaordic/feat/revoke-dev-sg-rules
PedroGimenezSilva Jul 18, 2022
9e9ba1c
refactor: rename the function to destroy by request id and change in …
esseitalo Jul 20, 2022
c6418c7
feat: now destroy the cluster by fleet id
esseitalo Jul 20, 2022
0df5898
feat: script in python 3 to handle the fleet delete
esseitalo Jul 20, 2022
909bc58
Merge branch 'master' into fix/destroy-function
Jul 21, 2022
85d40c4
Merge pull request #194 from chaordic/fix/destroy-function
alexopss Jul 26, 2022
26cd862
hotfix: fix the output when there is no json file with fleet id
esseitalo Jul 28, 2022
421f959
added javaagent parameter (spark-submit) to enable metrics by jmx pro…
dldantas Jul 29, 2022
1b8791e
Merge pull request #196 from chaordic/hotfix/delete-fleet
alexopss Aug 1, 2022
d59d3fa
Merge pull request #192 from chaordic/feat/change-installation-and-la…
alexopss Aug 2, 2022
ec8a2ef
added parameter spark.metrics.conf
dldantas Aug 3, 2022
82f7fd8
added conf spark.metrics.conf
dldantas Aug 3, 2022
a039e99
Merge branch 'master' into feat/prometheus-script
dldantas Aug 4, 2022
fbb8128
added --packages parameter in spark-submit command
dldantas Aug 5, 2022
44bece6
removed spark.metrics.conf parameter from spark-submit
dldantas Aug 9, 2022
98594ff
removed --repositories and --packages parameters from spark-submit
dldantas Aug 9, 2022
90983fb
removed javaagent parameter
dldantas Aug 15, 2022
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
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2.1

# Define the jobs we want to run for this project
jobs:
build:
docker:
- image: openjdk:8-jdk-oraclelinux7
steps:
- run: echo "build job is not implemented"

# Orchestrate our job run sequence
workflows:
build:
jobs:
- build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ project/plugins/project/

# Node
node_modules

# Spark-ec2 boto
tools/spark-ec2/lib
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "tools/flintrock"]
path = tools/flintrock
url = git@github.com:chaordic/flintrock.git
branch = ignition_v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ It also provides many utilities for Spark jobs and Scala programs in general.
It should be used inside a project as a submodule. See https://github.com/chaordic/ignition-template for an example.

# Getting started
See http://monkeys.chaordic.com.br/start-using-spark-with-ignition/ for quick-start tutorial
See [Start using Spark with Ignition!](http://monkeys.chaordic.com.br/2015/03/22/start-using-spark-with-ignition.html) for quick-start tutorial
32 changes: 13 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,31 @@ name := "Ignition-Core"

version := "1.0"

scalaVersion := "2.10.4"
scalaVersion := "2.11.12"

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings")

ideaExcludeFolders += ".idea"

ideaExcludeFolders += ".idea_modules"
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings", "-Xlint", "-Ywarn-dead-code", "-Xmax-classfile-name", "130")

// Because we can't run two spark contexts on same VM
parallelExecution in Test := false

libraryDependencies += ("org.apache.spark" %% "spark-core" % "1.3.0" % "provided").exclude("org.apache.hadoop", "hadoop-client")

libraryDependencies += ("org.apache.hadoop" % "hadoop-client" % "2.0.0-cdh4.7.1" % "provided")
test in assembly := {}

libraryDependencies += "com.github.nscala-time" %% "nscala-time" % "0.8.0"
libraryDependencies += "org.apache.spark" %% "spark-sql" % "2.4.3" % "provided"

libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0"
libraryDependencies += "org.apache.hadoop" % "hadoop-client" % "2.7.6" % "provided"

libraryDependencies += "org.scalaj" %% "scalaj-http" % "0.3.16"
libraryDependencies += "org.apache.hadoop" % "hadoop-aws" % "2.7.6" % "provided"

libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.0.6"
libraryDependencies += "com.amazonaws" % "aws-java-sdk" % "1.7.4" % "provided"

libraryDependencies += "com.github.scopt" %% "scopt" % "3.2.0"
libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.27"

libraryDependencies += "net.java.dev.jets3t" % "jets3t" % "0.7.1"
libraryDependencies += "com.github.scopt" %% "scopt" % "3.6.0"

resolvers += "Akka Repository" at "http://repo.akka.io/releases/"
libraryDependencies += "joda-time" % "joda-time" % "2.9.9"

resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/"
libraryDependencies += "org.joda" % "joda-convert" % "1.8.2"

resolvers += "Cloudera Repository" at "https://repository.cloudera.com/artifactory/cloudera-repos/"
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.25"

resolvers += Resolver.sonatypeRepo("public")
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.3"
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.5
sbt.version=1.2.6
5 changes: 0 additions & 5 deletions project/plugins.sbt

This file was deleted.

60 changes: 53 additions & 7 deletions remote_hook.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash


# We suppose we are in a subdirectory of the root project
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand All @@ -11,6 +12,8 @@ CONTROL_DIR="${5?Please give the Control Directory}"
SPARK_MEM_PARAM="${6?Please give the Job Memory Size to use}"
USE_YARN="${7?Please tell if we should use YARN (yes/no)}"
NOTIFY_ON_ERRORS="${8?Please tell if we will notify on errors (yes/no)}"
DRIVER_HEAP_SIZE="${9?Please tell driver heap size to use}"
shift 9

JOB_WITH_TAG=${JOB_NAME}.${JOB_TAG}
JOB_CONTROL_DIR="${CONTROL_DIR}/${JOB_WITH_TAG}"
Expand All @@ -20,10 +23,18 @@ MY_USER=$(whoami)
sudo mkdir -p "${JOB_CONTROL_DIR}"
sudo chown $MY_USER "${JOB_CONTROL_DIR}"


RUNNING_FILE="${JOB_CONTROL_DIR}/RUNNING"
# This should be the first thing in the script to avoid the wait remote job thinking we died
echo $$ > "${RUNNING_FILE}"



# Let us read the spark home even when the image doesn't give us the permission
sudo chmod o+rx /home/ec2-user
sudo chmod -R o+rx /home/ec2-user/spark

mkdir -p /media/tmp/spark-events

notify_error_and_exit() {
description="${1}"
echo "Exiting because: ${description}"
Expand All @@ -48,6 +59,37 @@ on_trap_exit() {
rm -f "${RUNNING_FILE}"
}

install_and_run_zeppelin() {
if [[ ! -d "zeppelin" ]]; then
wget "http://www-us.apache.org/dist/zeppelin/zeppelin-0.8.0/zeppelin-0.8.0-bin-all.tgz" -O zeppelin.tar.gz
mkdir zeppelin
tar xvzf zeppelin.tar.gz -C zeppelin --strip-components 1 > /tmp/zeppelin_install.log
fi
if [[ -f "zeppelin/bin/zeppelin.sh" ]]; then
export MASTER="${JOB_MASTER}"
export ZEPPELIN_PORT="8081"
export SPARK_HOME=$(get_first_present /root/spark /opt/spark ~/spark*/)
export SPARK_SUBMIT_OPTIONS="--jars ${JAR_PATH} --executor-memory ${SPARK_MEM_PARAM}"
zeppelin/bin/zeppelin.sh
else
notify_error_and_exit "Zeppelin installation not found"
fi
}

install_and_run_jupyter() {
sudo yum -y install python3 python3-pip
sudo pip3 install jupyter pandas boto3 matplotlib numpy sklearn scipy toree
export SPARK_HOME=$(get_first_present /root/spark /opt/spark ~/spark*/)
export HADOOP_HOME=$(get_first_present /root/hadoop /opt/hadoop ~/hadoop*/)
export SPARK_CONF_DIR="${SPARK_HOME}/conf"
export HADOOP_CONF_DIR="${HADOOP_HOME}/conf"
export JOB_MASTER=${MASTER:-spark://${SPARK_MASTER_HOST}:7077}
export PYSPARK_PYTHON=$(which python3)
export PYSPARK_DRIVER_PYTHON=$(which jupyter)
export PYSPARK_DRIVER_PYTHON_OPTS="notebook --allow-root --ip=${SPARK_MASTER_HOST} --no-browser --port=8888"
sudo $(which jupyter) toree install --spark_home="${SPARK_HOME}" --spark_opts="--master ${JOB_MASTER} --executor-memory ${SPARK_MEM_PARAM} --driver-memory ${DRIVER_HEAP_SIZE}"
${SPARK_HOME}/bin/pyspark --master "${JOB_MASTER}" --executor-memory "${SPARK_MEM_PARAM}" --driver-memory "${DRIVER_HEAP_SIZE}"
}

trap "on_trap_exit" EXIT

Expand All @@ -58,12 +100,14 @@ MAIN_CLASS="ignition.jobs.Runner"

cd "${DIR}" || notify_error_and_exit "Internal script error for job ${JOB_WITH_TAG}"

JAR_PATH_SRC=$(echo "${DIR}"/*assembly*.jar)
JAR_PATH_SRC=$(ls -t "${DIR}"/*assembly*.jar | head -1) # most recent jar
JAR_PATH="${JOB_CONTROL_DIR}/Ignition.jar"

cp ${JAR_PATH_SRC} ${JAR_PATH}

export JOB_MASTER=${MASTER}
# If no $MASTER, then build a url using $SPARK_MASTER_HOST
export JOB_MASTER=${MASTER:-spark://${SPARK_MASTER_HOST}:7077}


if [[ "${USE_YARN}" == "yes" ]]; then
export YARN_MODE=true
Expand All @@ -73,14 +117,16 @@ if [[ "${USE_YARN}" == "yes" ]]; then
export SPARK_WORKER_MEMORY=${SPARK_MEM_PARAM}
fi


if [[ "${JOB_NAME}" == "shell" ]]; then
export ADD_JARS=${JAR_PATH}
sudo -E ${SPARK_HOME}/bin/spark-shell || notify_error_and_exit "Execution failed for shell"
${SPARK_HOME}/bin/spark-shell --master "${JOB_MASTER}" --jars ${JAR_PATH} --driver-memory "${DRIVER_HEAP_SIZE}" --driver-java-options "-Djava.io.tmpdir=/media/tmp -verbose:gc -XX:-PrintGCDetails -XX:+PrintGCTimeStamps" --executor-memory "${SPARK_MEM_PARAM}" || notify_error_and_exit "Execution failed for shell"
elif [[ "${JOB_NAME}" == "zeppelin" ]]; then
install_and_run_zeppelin
elif [[ "${JOB_NAME}" == "jupyter" ]]; then
install_and_run_jupyter
else
JOB_OUTPUT="${JOB_CONTROL_DIR}/output.log"
tail -F "${JOB_OUTPUT}" &
sudo -E "${SPARK_HOME}/bin/spark-submit" --master "${JOB_MASTER}" --driver-memory 25000M --driver-java-options "-Djava.io.tmpdir=/mnt -verbose:gc -XX:-PrintGCDetails -XX:+PrintGCTimeStamps" --class "${MAIN_CLASS}" ${JAR_PATH} "${JOB_NAME}" --runner-date "${JOB_DATE}" --runner-tag "${JOB_TAG}" --runner-user "${JOB_USER}" --runner-master "${JOB_MASTER}" --runner-executor-memory "${SPARK_MEM_PARAM}" >& "${JOB_OUTPUT}" || notify_error_and_exit "Execution failed for job ${JOB_WITH_TAG}"
${SPARK_HOME}/bin/spark-submit --master "${JOB_MASTER}" --driver-memory "${DRIVER_HEAP_SIZE}" --driver-java-options "-Djava.io.tmpdir=/media/tmp -verbose:gc -XX:-PrintGCDetails -XX:+PrintGCTimeStamps " --class "${MAIN_CLASS}" ${JAR_PATH} "${JOB_NAME}" --runner-date "${JOB_DATE}" --runner-tag "${JOB_TAG}" --runner-user "${JOB_USER}" --runner-master "${JOB_MASTER}" --runner-executor-memory "${SPARK_MEM_PARAM}" "$@" >& "${JOB_OUTPUT}" || notify_error_and_exit "Execution failed for job ${JOB_WITH_TAG}"
fi

touch "${JOB_CONTROL_DIR}/SUCCESS"
70 changes: 49 additions & 21 deletions src/main/scala/ignition/core/jobs/CoreJobRunner.scala
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
package ignition.core.jobs

import org.apache.spark.{SparkConf, SparkContext}
import org.joda.time.{DateTimeZone, DateTime}
import org.apache.spark.SparkContext
import org.apache.spark.sql.SparkSession
import org.joda.time.{DateTime, DateTimeZone}
import org.slf4j.{Logger, LoggerFactory}

import scala.util.Try
import scala.concurrent.Future

object CoreJobRunner {

val logger: Logger = LoggerFactory.getLogger(getClass)

case class RunnerContext(sparkContext: SparkContext,
sparkSession: SparkSession,
config: RunnerConfig)


// Used to provide contextual logging
def setLoggingContextValues(config: RunnerConfig): Unit = {
org.slf4j.MDC.put("setupName", config.setupName)
org.slf4j.MDC.put("tag", config.tag)
org.slf4j.MDC.put("user", config.user)
try { // yes, this may fail but we don't want everything to shut down
org.slf4j.MDC.put("setupName", config.setupName)
org.slf4j.MDC.put("tag", config.tag)
org.slf4j.MDC.put("user", config.user)
} catch {
case e: Throwable =>
// cry
}
}

case class RunnerConfig(setupName: String = "nosetup",
Expand All @@ -24,7 +34,7 @@ object CoreJobRunner {
user: String = "nouser",
master: String = "local[*]",
executorMemory: String = "2G",
additionalArgs: Map[String, String] = Map.empty)
extraArgs: Map[String, String] = Map.empty)

def runJobSetup(args: Array[String], jobsSetups: Map[String, (CoreJobRunner.RunnerContext => Unit, Map[String, String])], defaultSparkConfMap: Map[String, String]) {
val parser = new scopt.OptionParser[RunnerConfig]("Runner") {
Expand All @@ -49,8 +59,8 @@ object CoreJobRunner {
c.copy(executorMemory = x)
}

opt[(String, String)]('w', "runner-with-arg") unbounded() action { (x, c) =>
c.copy(additionalArgs = c.additionalArgs ++ Map(x))
opt[(String, String)]('w', "runner-extra") unbounded() action { (x, c) =>
c.copy(extraArgs = c.extraArgs ++ Map(x))
}
}

Expand All @@ -65,27 +75,39 @@ object CoreJobRunner {
val appName = s"${config.setupName}.${config.tag}"


val sparkConf = new SparkConf()
sparkConf.set("spark.executor.memory", config.executorMemory)
val builder = SparkSession.builder
builder.config("spark.executor.memory", config.executorMemory)

builder.config("spark.eventLog.dir", "file:///media/tmp/spark-events")

builder.master(config.master)
builder.appName(appName)

sparkConf.setMaster(config.master)
sparkConf.setAppName(appName)

defaultSparkConfMap.foreach { case (k, v) => sparkConf.set(k, v) }
builder.config("spark.hadoop.mapred.output.committer.class", classOf[DirectOutputCommitter].getName())

jobConf.foreach { case (k, v) => sparkConf.set(k, v) }
defaultSparkConfMap.foreach { case (k, v) => builder.config(k, v) }

jobConf.foreach { case (k, v) => builder.config(k, v) }

// Add logging context to driver
setLoggingContextValues(config)

val sc = new SparkContext(sparkConf)

try {
builder.enableHiveSupport()
} catch {
case t: Throwable => logger.warn("Failed to enable HIVE support", t)
}

val session = builder.getOrCreate()

val sc = session.sparkContext
// Also try to propagate logging context to workers
// TODO: find a more efficient and bullet-proof way
val configBroadCast = sc.broadcast(config)

sc.parallelize(Range(1, 2000), numSlices = 2000).foreachPartition(_ => setLoggingContextValues(configBroadCast.value))

val context = RunnerContext(sc, config)
val context = RunnerContext(sc, session, config)

try {
jobSetup.apply(context)
Expand All @@ -94,8 +116,14 @@ object CoreJobRunner {
t.printStackTrace()
System.exit(1) // force exit of all threads
}
Try { sc.stop() }
System.exit(0) // force exit of all threads

import scala.concurrent.ExecutionContext.Implicits.global
Future {
// If everything is fine, the system will shut down without the help of this thread and YARN will report success
// But sometimes it gets stuck, then it's necessary to use the force, but this may finish the job as failed on YARN
Thread.sleep(30 * 1000)
System.exit(0) // force exit of all threads
}
}
}
}
Loading