Skip to content

Commit

Permalink
searchbird
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusae committed Aug 23, 2011
1 parent 391e42f commit ba0cea7
Show file tree
Hide file tree
Showing 21 changed files with 716 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
_site/
.DS_Store
**/project/boot/
**/project/plugins/project/
**/project/plugins/src_managed/
**/lib_managed
**/target
6 changes: 2 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ <h3><a href="index.html">{{ page.title }}</a></h3>
</div>
</div>

<div class="container">

<div class="container" style="padding-top: 60px;">
{{ content }}

</div> <!-- /container -->

<div id="footer">
<div class="inner">
<div class="container">
Expand Down
27 changes: 27 additions & 0 deletions searchbird/Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Docs at http://confluence.local.twitter.com/display/RELEASE/Twitter-cap-utils+README
begin
require 'rubygems'
require "bundler/setup"
require "railsless-deploy"
require 'twitter_cap_utils'
rescue LoadError => e
puts e.message
abort "Please gem install twitter-cap-utils railsless-deploy"
end

set :user, :twitter
set :application, "searchbird"
set :repository, "http://git.local.twitter.com/ro/#{application}"

task :staging do
role :app, "server1", "server2", "etc"
end

task :canary do
role :app, "server1"
end

task :production do
role :app, "server1", "server2", "etc"
end

7 changes: 7 additions & 0 deletions searchbird/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source :rubygems
source "http://gems.local.twitter.com"
gem "thrift_client", "0.6"
gem "thrift", "0.5"
gem "railsless-deploy"
gem "capistrano"
gem "twitter-cap-utils", "~>0.8.0"
44 changes: 44 additions & 0 deletions searchbird/config/development.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import com.twitter.conversions.time._
import com.twitter.logging.config._
import com.twitter.ostrich.admin.config._
import com.twitter.searchbird.config._

// development mode.
new SearchbirdServiceConfig {

// Add your own config here

// Where your service will be exposed.
thriftPort = 9999

// Ostrich http admin port. Curl this for stats, etc
admin.httpPort = 9900

// End user configuration

// Expert-only: Ostrich stats and logger configuration.

admin.statsNodes = new StatsConfig {
reporters = new JsonStatsLoggerConfig {
loggerName = "stats"
serviceName = "searchbird"
} :: new TimeSeriesCollectorConfig
}

loggers =
new LoggerConfig {
level = Level.DEBUG
handlers = new FileHandlerConfig {
filename = "searchbird.log"
roll = Policy.SigHup
}
} :: new LoggerConfig {
node = "stats"
level = Level.INFO
useParents = false
handlers = new FileHandlerConfig {
filename = "stats.log"
formatter = BareFormatterConfig
}
}
}
43 changes: 43 additions & 0 deletions searchbird/config/production.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import com.twitter.conversions.time._
import com.twitter.logging.config._
import com.twitter.ostrich.admin.config._
import com.twitter.searchbird.config._

// production mode.
new SearchbirdServiceConfig {

// Add your own config here

// Where your service will be exposed.
thriftPort = 9999

// Ostrich http admin port. Curl this for stats, etc
admin.httpPort = 9900

// End user configuration

// Expert-only: Ostrich stats and logger configuration.
admin.statsNodes = new StatsConfig {
reporters = new JsonStatsLoggerConfig {
loggerName = "stats"
serviceName = "searchbird"
} :: new TimeSeriesCollectorConfig
}

loggers =
new LoggerConfig {
level = Level.INFO
handlers = new FileHandlerConfig {
filename = "/var/log/searchbird/production.log"
roll = Policy.SigHup
}
} :: new LoggerConfig {
node = "stats"
level = Level.INFO
useParents = false
handlers = new FileHandlerConfig {
filename = "stats.log"
formatter = BareFormatterConfig
}
}
}
43 changes: 43 additions & 0 deletions searchbird/config/staging.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import com.twitter.ostrich.admin.config._
import com.twitter.conversions.time._
import com.twitter.logging.config._
import com.twitter.searchbird.config._

// staging mode.
new SearchbirdServiceConfig {

// Add your own config here

// Where your service will be exposed.
thriftPort = 9999

// Ostrich http admin port. Curl this for stats, etc
admin.httpPort = 9900

// End user configuration

// Expert-only: Ostrich stats and logger configuration.
admin.statsNodes = new StatsConfig {
reporters = new JsonStatsLoggerConfig {
loggerName = "stats"
serviceName = "searchbird"
} :: new TimeSeriesCollectorConfig
}

loggers =
new LoggerConfig {
level = Level.INFO
handlers = new FileHandlerConfig {
filename = "/var/log/searchbird/production.log"
roll = Policy.SigHup
}
} :: new LoggerConfig {
node = "stats"
level = Level.INFO
useParents = false
handlers = new FileHandlerConfig {
filename = "stats.log"
formatter = BareFormatterConfig
}
}
}
32 changes: 32 additions & 0 deletions searchbird/config/test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import com.twitter.conversions.time._
import com.twitter.logging.config._
import com.twitter.ostrich.admin.config._
import com.twitter.searchbird.config._

// test mode.
new SearchbirdServiceConfig {

// Add your own config here

// Where your service will be exposed.
thriftPort = 9999

// Ostrich http admin port. Curl this for stats, etc
admin.httpPort = 9900

// End user configuration

// Expert-only: Ostrich stats and logger configuration.
admin.statsNodes = new StatsConfig {
reporters = new JsonStatsLoggerConfig {
loggerName = "stats"
serviceName = "searchbird"
} :: new TimeSeriesCollectorConfig
}

loggers =
new LoggerConfig {
level = Level.INFO
handlers = new ConsoleHandlerConfig
}
}
8 changes: 8 additions & 0 deletions searchbird/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Project properties
#Thu Feb 24 16:45:35 PST 2011
project.organization=com.twitter
project.name=searchbird
sbt.version=0.7.4
project.version=1.0.0-SNAPSHOT
build.scala.versions=2.8.1
project.initialize=false
50 changes: 50 additions & 0 deletions searchbird/project/build/SearchbirdProject.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import sbt._
import Process._
import com.twitter.sbt._

/**
* Sbt project files are written in a DSL in scala.
*
* The % operator is just turning strings into maven dependency declarations, so lines like
* val example = "com.example" % "exampleland" % "1.0.3"
* mean to add a dependency on exampleland version 1.0.3 from provider "com.example".
*/
class SearchbirdProject(info: ProjectInfo) extends StandardServiceProject(info)
with CompileThriftScala
with NoisyDependencies
with DefaultRepos
with Tartifactory
with TartifactoryRepos
with SubversionPublisher {

val twitterInternal = "binaries.local.twitter.com" at "http://binaries.local.twitter.com/maven/"

val finagleVersion = "1.8.3"

val finagleC = "com.twitter" % "finagle-core" % finagleVersion
val finagleT = "com.twitter" % "finagle-thrift" % finagleVersion
val finagleO = "com.twitter" % "finagle-ostrich4" % finagleVersion

// thrift
val libthrift = "thrift" % "libthrift" % "0.5.0"
val util = "com.twitter" % "util" % "1.11.2"

override def originalThriftNamespaces = Map("Searchbird" -> "com.twitter.searchbird.thrift")
val scalaThriftTargetNamespace = "com.twitter.searchbird"

val slf4jVersion = "1.5.11"
val slf4jApi = "org.slf4j" % "slf4j-api" % slf4jVersion withSources() intransitive()
val slf4jBindings = "org.slf4j" % "slf4j-jdk14" % slf4jVersion withSources() intransitive()

// for tests
val specs = "org.scala-tools.testing" % "specs_2.8.1" % "1.6.7" % "test" withSources()
val jmock = "org.jmock" % "jmock" % "2.4.0" % "test"
val hamcrest_all = "org.hamcrest" % "hamcrest-all" % "1.1" % "test"
val cglib = "cglib" % "cglib" % "2.1_3" % "test"
val asm = "asm" % "asm" % "1.5.3" % "test"
val objenesis = "org.objenesis" % "objenesis" % "1.1" % "test"

override def mainClass = Some("com.twitter.searchbird.Main")

override def subversionRepository = Some("http://svn.local.twitter.com/maven")
}
9 changes: 9 additions & 0 deletions searchbird/project/plugins/Plugins.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sbt._

class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
override def repositories = Set("twitter.artifactory" at "http://artifactory.local.twitter.com/repo/")
override def ivyRepositories = Seq(Resolver.defaultLocal(None)) ++ repositories

val defaultProject = "com.twitter" % "standard-project" % "0.11.4"
val sbtThrift = "com.twitter" % "sbt-thrift" % "1.3.4"
}
Loading

0 comments on commit ba0cea7

Please sign in to comment.