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

Make changes needed to build on travis-ci #41

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ language: scala
scala:
- 2.9.1
jdk:
- openjdk6
- openjdk7
- oraclejdk7
script: "env SBT_TRAVIS_CI=true bin/sbt test"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Zipkin is a distributed tracing system that helps us gather timing data for all the disparate services at Twitter.
It manages both the collection and lookup of this data through a Collector and a Query service.
We closely modelled Zipkin after the <a href="http://research.google.com/pubs/pub36356.html">Google Dapper</a> paper. Follow <a href="https://twitter.com/zipkinproject">@zipkinproject</a> for updates.
We closely modelled Zipkin after the <a href="http://research.google.com/pubs/pub36356.html">Google Dapper</a> paper. Follow <a href="https://twitter.com/zipkinproject">@zipkinproject</a> for updates. [![Build Status](https://secure.travis-ci.org/twitter/zipkin.png)](http://travis-ci.org/twitter/zipkin)

## Why distributed tracing?
Collecting traces helps developers gain deeper knowledge about how certain requests perform in a distributed system.
Expand Down Expand Up @@ -121,7 +121,7 @@ A Scribe store for Zipkin might look something like this.
Note that the above uses the Twitter version of Scribe with support for using ZooKeeper to find the hosts to send the category to. You can also use a DNS entry for the collectors or something similar.

### Zipkin servers
We've developed Zipkin with <a href="http://www.scala-lang.org/downloads">Scala 2.9.1</a>, <a href="http://www.scala-sbt.org/download.html">SBT 0.11.2</a>, and JDK6.
We've developed Zipkin with <a href="http://www.scala-lang.org/downloads">Scala 2.9.1</a>, <a href="http://www.scala-sbt.org/download.html">SBT 0.11.2</a>, and JDK7.

1. `git clone https://github.com/twitter/zipkin.git`
1. `cd zipkin`
Expand Down
6 changes: 3 additions & 3 deletions bin/sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ java -ea \
-XX:+UseConcMarkSweepGC \
-XX:+CMSParallelRemarkEnabled \
-XX:+CMSClassUnloadingEnabled \
-XX:MaxPermSize=1024m \
-XX:MaxPermSize=512M \
-XX:SurvivorRatio=128 \
-XX:MaxTenuringThreshold=0 \
-Xss8M \
-Xms512M \
-Xmx3G \
-Xms225M \
-Xmx512M \
-server \
-jar $sbtjar "$@"
65 changes: 53 additions & 12 deletions project/Project.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ object Zipkin extends Build {
base = file(".")) aggregate(hadoop, test, thrift, server, common, scrooge, scribe)

val proxyRepo = Option(System.getenv("SBT_PROXY_REPO"))
val travisCi = Option(System.getenv("SBT_TRAVIS_CI")) // for adding travis ci maven repos before others

lazy val hadoop = Project(
id = "zipkin-hadoop",
base = file("zipkin-hadoop"),
settings = Project.defaultSettings ++ StandardProject.newSettings ++ assemblySettings).settings(
settings = Project.defaultSettings ++
StandardProject.newSettings ++
assemblySettings ++
TravisCiRepos.newSettings).settings(

name := "zipkin-hadoop",
version := "0.2.0-SNAPSHOT",
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -54,7 +59,8 @@ object Zipkin extends Build {
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings ++
CompileThrift.newSettings).settings(
CompileThrift.newSettings ++
TravisCiRepos.newSettings).settings(
name := "zipkin-test",
version := "0.2.0-SNAPSHOT",
libraryDependencies ++= Seq(
Expand All @@ -75,10 +81,10 @@ object Zipkin extends Build {
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings ++
CompileThrift.newSettings).settings(
CompileThrift.newSettings ++
TravisCiRepos.newSettings).settings(
name := "zipkin-thrift",
version := "0.2.0-SNAPSHOT",

libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % "0.5.0",
"org.slf4j" % "slf4j-api" % "1.5.8"
Expand All @@ -97,10 +103,9 @@ object Zipkin extends Build {
base = file("zipkin-common"),
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings
).settings(
SubversionPublisher.newSettings ++
TravisCiRepos.newSettings).settings(
version := "0.2.0-SNAPSHOT",

libraryDependencies ++= Seq(
"com.twitter" % "finagle-thrift" % FINAGLE_VERSION,
"com.twitter" % "finagle-zipkin" % FINAGLE_VERSION,
Expand All @@ -124,10 +129,10 @@ object Zipkin extends Build {
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings ++
CompileThriftScrooge.newSettings
CompileThriftScrooge.newSettings ++
TravisCiRepos.newSettings
).settings(
version := "0.2.0-SNAPSHOT",

libraryDependencies ++= Seq(
"com.twitter" % "finagle-ostrich4" % FINAGLE_VERSION,
"com.twitter" % "finagle-thrift" % FINAGLE_VERSION,
Expand Down Expand Up @@ -162,7 +167,8 @@ object Zipkin extends Build {
base = file("zipkin-server"),
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings
SubversionPublisher.newSettings ++
TravisCiRepos.newSettings
).settings(
version := "0.2.0-SNAPSHOT",

Expand Down Expand Up @@ -209,10 +215,10 @@ object Zipkin extends Build {
base = file("zipkin-scribe"),
settings = Project.defaultSettings ++
StandardProject.newSettings ++
SubversionPublisher.newSettings
SubversionPublisher.newSettings ++
TravisCiRepos.newSettings
).settings(
version := "0.2.0-SNAPSHOT",

libraryDependencies ++= Seq(
/* Test dependencies */
"org.scala-tools.testing" % "specs_2.9.1" % "1.6.9" % "test",
Expand All @@ -232,3 +238,38 @@ object Zipkin extends Build {
}
).dependsOn(server, scrooge)
}

/*
* We build our project using Travis CI. In order for it to finish in the max run time,
* we need to use their local maven mirrors.
*/
object TravisCiRepos extends Plugin with Environmentalist {
val travisCiResolvers = SettingKey[Seq[Resolver]](
"travisci-central",
"Use these resolvers when building on travis-ci"
)

val localRepo = SettingKey[File](
"local-repo",
"local folder to use as a repo (and where publish-local publishes to)"
)

val newSettings = Seq(
travisCiResolvers := Seq(
"travisci-central" at "http://maven.travis-ci.org/nexus/content/repositories/central/",
"travisci-sonatype" at "http://maven.travis-ci.org/nexus/content/repositories/sonatype/"
),

// configure resolvers for the build
resolvers <<= (resolvers, travisCiResolvers) { (resolvers, travisCiResolvers) =>
if("true".equalsIgnoreCase(System.getenv("SBT_TRAVIS_CI"))) {
travisCiResolvers ++ resolvers
} else {
resolvers
}
},

// don't add any special resolvers.
externalResolvers <<= (resolvers) map identity
)
}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ resolvers <<= (resolvers) { r =>
Seq("proxy-repo" at url)
} getOrElse {
r ++ Seq(
"travisci-central" at "http://maven.travis-ci.org/nexus/content/repositories/central/",
"travisci-sonatype" at "http://maven.travis-ci.org/nexus/content/repositories/sonatype/",
"twitter.com" at "http://maven.twttr.com/",
"scala-tools" at "http://scala-tools.org/repo-releases/",
"maven" at "http://repo1.maven.org/maven2/",
Expand Down