Skip to content

Commit 7d0679f

Browse files
committed
Merge remote-tracking branch 'oss/master' into dse-2.2
job-server-extras/src/test/scala/spark/jobserver/python/PythonHiveContextFactorySpec.scala job-server-extras/src/test/scala/spark/jobserver/python/PythonSQLContextFactorySpec.scala job-server-extras/src/test/scala/spark/jobserver/python/PythonSparkContextFactorySpec.scala
2 parents 0a135ae + 2694ba4 commit 7d0679f

File tree

132 files changed

+5995
-772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+5995
-772
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
**Pull Request checklist**
2+
3+
- [ ] The commit(s) message(s) follows the contribution [guidelines](doc/contribution-guidelines.md#commit-message-format) ?
4+
- [ ] Tests for the changes have been added (for bug fixes / features) ?
5+
- [ ] Docs have been added / updated (for bug fixes / features) ?
6+
7+
**Current behavior :** (link exiting issues here : https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests)
8+
9+
10+
11+
**New behavior :**
12+
13+
14+
15+
**BREAKING CHANGES**
16+
17+
If this PR contains a breaking change, please describe the impact and migration
18+
path for existing applications.
19+
If not please remove this section.
20+
21+
**Other information**:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ src_managed/
44
project/boot/
55
test-reports/
66
*.log*
7+
*.patch
78
.ensime*
89
.idea*
910
.vagrant
@@ -14,8 +15,8 @@ config/*.conf
1415
config/*.sh
1516
config/*.ini
1617
job-server/config/*.conf
17-
job-server/config/*.sh
1818
job-server/config/*.ini
19+
job-server-extras/spark-warehouse/
1920
metastore_db/
2021

2122
#ignore generated config

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sudo: required
33
env:
44
global:
55
- DOCKER_IMAGE="spark-jobserver:ci"
6+
- DOCKER_API_VERSION="1.24"
67

78
language: go
89
go:
@@ -12,8 +13,12 @@ services:
1213
- docker
1314

1415
cache:
16+
apt: true
1517
directories:
1618
- docker
19+
- $HOME/.m2
20+
- $HOME/.ivy2/cache
21+
- $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION
1722

1823
before_install:
1924
- go get github.com/tonistiigi/buildcache/cmd/buildcache
@@ -32,4 +37,4 @@ install:
3237
- sudo chown $USER docker/latest_cache.tar.gz
3338

3439
script:
35-
- docker run --rm -t -i $DOCKER_IMAGE
40+
- docker run `/bin/bash <(curl -s https://codecov.io/env)` --rm -t -i $DOCKER_IMAGE

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN sbt update
2424
# add the rest of the code
2525
COPY . .
2626

27-
ENV SPARK_HOME /tmp/spark-2.0.2-bin-hadoop2.7
27+
ENV SPARK_HOME /tmp/spark-2.1.0-bin-hadoop2.7
2828
ENV JAVA_OPTIONS "-Xmx1500m -XX:MaxPermSize=512m -Dakka.test.timefactor=3"
2929

3030
CMD ["/usr/src/app/run_tests.sh"]

README.md

Lines changed: 122 additions & 25 deletions
Large diffs are not rendered by default.

akka-app/src/main/scala/spark/jobserver/common/akka/web/CommonRoutes.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ object MetricsSerializer {
8181

8282
private def process(metric: Metric): Map[String, Any] = {
8383
metric match {
84-
case c: Counter => Map("type" -> "counter", "count" -> c.count())
85-
case m: Meter => Map("type" -> "meter") ++ meterToMap(m)
84+
case c: Counter => Map("type" -> "counter", "count" -> c.count())
85+
case m: Meter => Map("type" -> "meter") ++ meterToMap(m)
8686
case g: Gauge[_] => Map("type" -> "gauge", "value" -> g.value())
8787
// For Timers, ignore the min/max/mean values, as they are for all time. We're just interested
8888
// in the recent (biased) histogram values.
@@ -97,17 +97,17 @@ object MetricsSerializer {
9797
private def meterToMap(m: Metered) =
9898
Map("units" -> m.rateUnit.toString.toLowerCase,
9999
"count" -> m.count,
100-
"mean" -> m.meanRate,
101-
"m1" -> m.oneMinuteRate,
102-
"m5" -> m.fiveMinuteRate,
103-
"m15" -> m.fifteenMinuteRate)
100+
"mean" -> m.meanRate,
101+
"m1" -> m.oneMinuteRate,
102+
"m5" -> m.fiveMinuteRate,
103+
"m15" -> m.fifteenMinuteRate)
104104

105105
/** Extracts the histogram (Median, 75%, 95%, 98%, 99% 99.9%) values to a map */
106106
private def histogramToMap(h: Sampling) =
107107
Map("median" -> h.getSnapshot().getMedian(),
108-
"p75" -> h.getSnapshot().get75thPercentile(),
109-
"p95" -> h.getSnapshot().get95thPercentile(),
110-
"p98" -> h.getSnapshot().get98thPercentile(),
111-
"p99" -> h.getSnapshot().get99thPercentile(),
112-
"p999" -> h.getSnapshot().get999thPercentile())
108+
"p75" -> h.getSnapshot().get75thPercentile(),
109+
"p95" -> h.getSnapshot().get95thPercentile(),
110+
"p98" -> h.getSnapshot().get98thPercentile(),
111+
"p99" -> h.getSnapshot().get99thPercentile(),
112+
"p999" -> h.getSnapshot().get999thPercentile())
113113
}

akka-app/src/main/scala/spark/jobserver/common/akka/web/JsonUtils.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ object JsonUtils {
3535
JsObject(pairs)
3636
}
3737
case a: Array[_] => seqFormat[Any].write(a.toSeq)
38-
case true => JsTrue
39-
case false => JsFalse
40-
case p: Product => seqFormat[Any].write(p.productIterator.toSeq)
41-
case null => JsNull
38+
case true => JsTrue
39+
case false => JsFalse
40+
case p: Product => seqFormat[Any].write(p.productIterator.toSeq)
41+
case null => JsNull
4242
case m: java.util.Map[_, _] => AnyJsonFormat.write(m.asScala.toMap)
4343
case l: java.util.List[_] => seqFormat[Any].write(l.asScala)
44-
case x => JsString(x.toString)
44+
case x => JsString(x.toString)
4545
}
4646
def read(value: JsValue): Any = value match {
4747
case JsNumber(n) => n.intValue()
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
package spark.jobserver.common.akka
22

3-
import org.scalatest.matchers.ShouldMatchers
4-
import org.scalatest.{Matchers, FunSpec}
5-
import akka.testkit.TestActorRef
3+
import org.scalatest.{BeforeAndAfterAll, Matchers, FunSpec}
4+
import akka.testkit.{TestKit, TestActorRef}
65

76
import akka.actor.{Actor, ActorSystem}
87

98

10-
class ActorMetricsSpec extends FunSpec with Matchers {
9+
class ActorMetricsSpec extends FunSpec with Matchers with BeforeAndAfterAll {
1110
implicit val system = ActorSystem("test")
1211

12+
override def afterAll(): Unit = {
13+
TestKit.shutdownActorSystem(system)
14+
}
15+
1316
describe("actor metrics") {
1417
it("should increment receive count metric when a message is received") {
1518
val actorRef = TestActorRef(new DummyActor with ActorMetrics)
@@ -19,4 +22,4 @@ class ActorMetricsSpec extends FunSpec with Matchers {
1922
actor.metricReceiveTimer.count should equal (1)
2023
}
2124
}
22-
}
25+
}

akka-app/src/test/scala/spark/jobserver/common/akka/ActorStackSpec.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package spark.jobserver.common.akka
22

3-
import org.scalatest.matchers.ShouldMatchers
4-
import org.scalatest.{Matchers, FunSpec}
5-
import akka.testkit.TestActorRef
3+
import org.scalatest.{BeforeAndAfterAll, Matchers, FunSpec}
4+
import akka.testkit.{TestKit, TestActorRef}
65

76
import akka.actor.{Actor, ActorSystem}
87

@@ -23,9 +22,13 @@ trait AddPrefix extends ActorStack {
2322
}
2423
}
2524

26-
class ActorStackSpec extends FunSpec with Matchers {
25+
class ActorStackSpec extends FunSpec with Matchers with BeforeAndAfterAll {
2726
implicit val system = ActorSystem("test")
2827

28+
override def afterAll(): Unit = {
29+
TestKit.shutdownActorSystem(system)
30+
}
31+
2932
describe("stacking traits") {
3033
it("should be able to stack traits and receive messages") {
3134
val actorRef = TestActorRef(new DummyActor with AddPrefix)

akka-app/src/test/scala/spark/jobserver/common/akka/actor/ReaperSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package spark.jobserver.common.akka.actor
33
import akka.actor.{ActorSystem, Props, ActorRef}
44
import akka.testkit.{TestKit, ImplicitSender, TestProbe}
55
import org.scalatest.{MustMatchers, FunSpecLike, BeforeAndAfterAll}
6+
import spark.jobserver.common.akka.AkkaTestUtils
67

78
// Our test reaper. Sends the snooper a message when all
89
// the souls have been reaped
@@ -19,7 +20,7 @@ class ReaperSpec extends TestKit(ActorSystem("ReaperSpec")) with ImplicitSender
1920
import scala.concurrent.duration._
2021

2122
override def afterAll() {
22-
system.shutdown()
23+
AkkaTestUtils.shutdownAndWait(system)
2324
}
2425

2526
describe("Reaper") {

0 commit comments

Comments
 (0)