-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
553 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
VERSION=${VERSION:-ci} | ||
|
||
# install utilities | ||
curl -O http://stedolan.github.io/jq/download/linux64/jq && chmod +x jq && sudo mv jq /usr/local/bin | ||
sudo pip install awscli | ||
|
||
# build and install with VERSION | ||
go get -d github.com/convox/rack/cmd/convox | ||
( | ||
cd ${GOPATH%%:*}/src/github.com/convox/rack/cmd/convox | ||
[ -n "$CIRCLE_BRANCH" ] && git fetch && git checkout $CIRCLE_BRANCH && git reset --hard origin/$CIRCLE_BRANCH | ||
go install -ldflags "-X main.Version $VERSION" | ||
) | ||
|
||
# configure client id if on CircleCI | ||
if [ ! -d "~/.convox/" ]; then | ||
mkdir -p ~/.convox/ | ||
echo ci@convox.com > ~/.convox/id | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM ubuntu:14.04 | ||
|
||
# vowpal_wabbit, geo deps | ||
RUN apt-get update -qq && apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
libboost-program-options-dev \ | ||
libboost-python-dev \ | ||
libgdal-dev \ | ||
libgeos-dev \ | ||
libproj-dev \ | ||
nodejs \ | ||
automake \ | ||
npm | ||
|
||
# -- Install vowpal_wabbit | ||
RUN git clone https://github.com/JohnLangford/vowpal_wabbit.git --branch 7.10 && \ | ||
(cd vowpal_wabbit && \ | ||
./autogen.sh && \ | ||
make && \ | ||
make install && \ | ||
ldconfig) | ||
|
||
RUN npm install less | ||
|
||
# Set up Miniconda environment for python2 | ||
ENV PATH /opt/miniconda/bin:$PATH | ||
RUN curl https://repo.continuum.io/miniconda/Miniconda-3.5.2-Linux-x86_64.sh -s -o miniconda.sh && \ | ||
bash miniconda.sh -p /opt/miniconda -b && \ | ||
conda update --yes conda && \ | ||
conda install pip --yes | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
COPY requirements.txt /app/ | ||
COPY conda-requirements.txt /app/ | ||
|
||
RUN conda install --file conda-requirements.txt --yes && \ | ||
pip install -r requirements.txt --exists-action=w --allow-all-external && \ | ||
conda clean -pt | ||
|
||
COPY . /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This file may be used to create an environment using: | ||
# $ conda create --name <env> --file <this file> | ||
# platform: osx-64 | ||
dateutil=2.1=py27_2 | ||
geos=3.3.3=0 | ||
ipython=3.1.0=py27_0 | ||
nose=1.3.6=py27_0 | ||
numexpr=2.4.3=np19py27_0 | ||
numpy=1.9.2=py27_0 | ||
openssl=1.0.1k=1 | ||
pandas=0.16.1=np19py27_0 | ||
pip=7.1.0=py27_0 | ||
pytables=3.1.1=np19py27_2 | ||
python=2.7.10=0 | ||
python-dateutil=2.4.1=py27_0 | ||
pytz=2015.4=py27_0 | ||
pyzmq=14.6.0=py27_0 | ||
readline=6.2=2 | ||
scikit-learn=0.16.1=np19py27_0 | ||
scipy=0.15.1=np19py27_0 | ||
setuptools=17.0=py27_0 | ||
shapely=1.5.9=py27_0 | ||
six=1.9.0=py27_0 | ||
sqlite=3.8.4.1=1 | ||
tk=8.5.18=0 | ||
zeromq=4.0.4=0 | ||
zlib=1.2.8=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
alabaster==0.7.4 | ||
alembic==0.7.6 | ||
amqp==1.4.6 | ||
anyjson==0.3.3 | ||
APScheduler==3.0.3 | ||
arrow==0.5.4 | ||
Babel==1.3 | ||
billiard==3.3.0.20 | ||
blinker==1.3 | ||
boto==2.38.0 | ||
celery==3.1.18 | ||
cssmin==0.2.0 | ||
dicttoxml==1.6.6 | ||
docutils==0.12 | ||
factory-boy==2.5.2 | ||
Flask==0.10.1 | ||
Flask-Assets==0.10 | ||
Flask-Login==0.2.11 | ||
Flask-Mail==0.9.1 | ||
Flask-Principal==0.4.0 | ||
Flask-Script==2.0.5 | ||
Flask-Security==1.7.4 | ||
Flask-SQLAlchemy==2.0 | ||
Flask-WTF==0.11 | ||
freezegun==0.3.3 | ||
futures==3.0.2 | ||
GeoAlchemy2==0.2.4 | ||
gunicorn==19.3.0 | ||
guppy==0.1.10 | ||
httpretty==0.8.10 | ||
itsdangerous==0.24 | ||
Jinja2==2.7.3 | ||
jsmin==2.1.1 | ||
kombu==3.0.26 | ||
Mako==1.0.1 | ||
MarkupSafe==0.23 | ||
mock==1.0.1 | ||
moto==0.4.2 | ||
newrelic==2.50.0.39 | ||
-e git+https://github.com/lambdalisue/nose-machineout2.git@c5da96c0ab88494e5d9add354f72ca4d56535200#egg=nose_machineout2 | ||
passlib==1.6.2 | ||
psycopg2==2.6 | ||
Pygments==2.0.2 | ||
raven==5.3.1 | ||
redis==2.10.3 | ||
requests==2.7.0 | ||
simplejson==3.7.3 | ||
snowballstemmer==1.2.0 | ||
SQLAlchemy==1.0.4 | ||
SQLAlchemy-Utils==0.30.7 | ||
testfixtures==4.1.2 | ||
toolz==0.7.2 | ||
tzlocal==1.1.3 | ||
ujson==1.33 | ||
webassets==0.10.1 | ||
Werkzeug==0.10.4 | ||
WTForms==2.0.2 | ||
xmltodict==0.9.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM gliderlabs/alpine:3.2 | ||
|
||
RUN apk-install ruby ruby-bundler ruby-io-console ruby-kgio ruby-pg ruby-raindrops ruby-unicorn | ||
|
||
WORKDIR /app | ||
|
||
# cache bundler | ||
COPY Gemfile /app/Gemfile | ||
COPY Gemfile.lock /app/Gemfile.lock | ||
RUN bundle install | ||
|
||
# copy the rest of the app | ||
COPY . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "erubis" | ||
gem "pg", "0.17.1" | ||
gem "redis" | ||
gem "sequel" | ||
gem "sinatra" | ||
gem "sinatra-contrib" | ||
gem "unicorn" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
backports (3.6.4) | ||
erubis (2.7.0) | ||
kgio (2.9.3) | ||
multi_json (1.10.1) | ||
pg (0.17.1) | ||
rack (1.6.0) | ||
rack-protection (1.5.3) | ||
rack | ||
rack-test (0.6.3) | ||
rack (>= 1.0) | ||
raindrops (0.13.0) | ||
redis (3.2.0) | ||
sequel (4.18.0) | ||
sinatra (1.4.5) | ||
rack (~> 1.4) | ||
rack-protection (~> 1.4) | ||
tilt (~> 1.3, >= 1.3.4) | ||
sinatra-contrib (1.4.2) | ||
backports (>= 2.0) | ||
multi_json | ||
rack-protection | ||
rack-test | ||
sinatra (~> 1.4.0) | ||
tilt (~> 1.3) | ||
tilt (1.4.1) | ||
unicorn (4.8.3) | ||
kgio (~> 2.6) | ||
rack | ||
raindrops (~> 0.7) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
erubis | ||
pg (= 0.17.1) | ||
redis | ||
sequel | ||
sinatra | ||
sinatra-contrib | ||
unicorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Convox: Sinatra | ||
|
||
This application includes: | ||
|
||
* Sinatra web app | ||
* Redis-based worker | ||
* Data storage in PostgreSQL | ||
|
||
## Development | ||
|
||
$ convox start | ||
|
||
## Production | ||
|
||
[See docs](http://docs.convox.com/docs/deploying-an-application/) | ||
|
||
## License | ||
|
||
Apache 2.0 | ||
|
||
© 2015 David Dollar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
echo "waiting for database" | ||
while true; do sequel -c 'DB.inspect' $POSTGRES_URL 2>/dev/null && break || sleep 1; done | ||
|
||
unicorn -c unicorn.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# wait for database | ||
while true; do sequel -c 'DB.inspect' $POSTGRES_URL 2>/dev/null && break || sleep 1; done | ||
|
||
# execute migrations | ||
sequel -m migrations ${POSTGRES_URL} | ||
|
||
bundle exec ruby worker.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
worker_processes 1; | ||
|
||
events { worker_connections 1024; } | ||
|
||
error_log /proc/self/fd/2; | ||
pid /var/run/nginx/nginx.pid; | ||
|
||
http { | ||
client_body_temp_path /var/cache/nginx/body; | ||
fastcgi_temp_path /var/cache/nginx/fastcgi; | ||
proxy_temp_path /var/cache/nginx/proxy; | ||
scgi_temp_path /var/cache/nginx/scgi; | ||
uwsgi_temp_path /var/cache/nginx/uwsgi; | ||
|
||
upstream unicorn { | ||
server localhost:5000; | ||
} | ||
|
||
server { | ||
listen 3000; | ||
server_name convox; | ||
|
||
access_log /proc/self/fd/1; | ||
error_log /proc/self/fd/2; | ||
|
||
location / { | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_next_upstream error; | ||
|
||
proxy_pass http://unicorn; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "sinatra" | ||
|
||
require File.expand_path("../web.rb", __FILE__) | ||
|
||
run Web |
Oops, something went wrong.