-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8d36937
commit 726a1bc
Showing
30 changed files
with
47,195 additions
and
156 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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# Exclude files matching these patterns from the Docker build context by | ||
# default. | ||
.arcanus/unprotected.key | ||
.git | ||
dock | ||
jenkins |
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
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,83 @@ | ||
set -euo pipefail | ||
|
||
source /***REMOVED*** | ||
source /***REMOVED*** | ||
|
||
# Need to include Python version since some packages may link against libraries | ||
# specific to that version | ||
env-artifact-name() { | ||
echo "env-$(python --version 2>&1 | tr ' ' '-')" | ||
} | ||
|
||
install-python-packages() { | ||
local artifact_name="$(env-artifact-name)" | ||
local artifact_path="$(git rev-parse --show-toplevel)/env" | ||
local cache_key="$(fingerprint requirements.txt)" | ||
local cache_path="$HOME/.cache/$artifact_name/${cache_key}" | ||
|
||
if [ ! -d "$artifact_path" ]; then | ||
section "Installing Python packages in virtual environment..." | ||
with-artifact setup-virtualenv "$cache_key" "$cache_path" "$artifact_name" "$artifact_path" | ||
fi | ||
} | ||
|
||
activate-virtualenv() { | ||
# We need to define a PS1 prompt so that this script works | ||
PS1='[\h \W]\$ ' source env/bin/activate | ||
} | ||
|
||
setup-virtualenv() { | ||
(virtualenv env && \ | ||
activate-virtualenv && \ | ||
pip install -r requirements.txt --no-cache-dir && \ | ||
virtualenv --relocatable env) | ||
} | ||
|
||
wait-for-elasticsearch() { | ||
echo "Waiting for Elasticsearch..." | ||
dockerize -timeout 30s -wait http://${ELASTICSEARCH_HOST:-127.0.0.1}:9200 \ | ||
echo "Elasticsearch ready!" && return | ||
|
||
error "Could not connect to Elasticsearch!" | ||
docker-compose logs --tail=20 elasticsearch | ||
return 1 | ||
} | ||
|
||
# We need to vary this name based on the Ruby version since native extensions | ||
# are compiled against the Ruby libraries present, meaning some gems are not | ||
# transferrable between Ruby versions. | ||
gems-artifact-name() { | ||
echo "gems-$(cat .ruby-version)" | ||
} | ||
|
||
install-gems() { | ||
local artifact_name="$(gems-artifact-name)" | ||
local artifact_path=/usr/local/bundle | ||
local cache_key="$(fingerprint Gemfile Gemfile.lock)" | ||
local cache_path="$HOME/.cache/$artifact_name/${cache_key}" | ||
|
||
section "Installing gems..." | ||
with-artifact download-gems "$cache_key" "$cache_path" "$artifact_name" "$artifact_path" | ||
} | ||
|
||
download-gems() { | ||
local artifact_name="$(gems-artifact-name)" | ||
local artifact_path=/usr/local/bundle | ||
|
||
local bundler_version=$(awk '/DEPENDENCIES/,/ bundler /' Gemfile.lock | tail -n1 | grep -oE '[0-9\.]+') | ||
|
||
# Attempt to download latest gem bundle with the hope that it won't be too | ||
# different from the one for current Gemfile. This significantly speeds up | ||
# test runs which make changes to the Gemfile, since we don't generate the | ||
# bundle from scratch. | ||
if download-latest-artifact "$artifact_name" "$artifact_path"; then | ||
echo "Downloaded latest '$artifact_name' bundle as base." | ||
echo "Installing new gems on top of base and then pruning unused gems..." | ||
else | ||
warn "WARN: Unable to download latest '$artifact_name' artifact. Installing from scratch..." | ||
fi | ||
|
||
echo "Installing gem bundle..." | ||
chronic gem install bundler --conservative --version $bundler_version | ||
chronic bundle install --jobs=$(nproc) --retry=3 --clean | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Defines the set of steps needed to create an image suitable for deploying the | ||
# Verifier to Marathon. | ||
|
||
FROM brigade/ruby:2.3.1-latest | ||
FROM ruby:2.3.8-latest | ||
|
||
# Used to maintain isolated Python environment in the repo | ||
RUN pip install virtualenv |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
source /src/script/helpers.bash | ||
source /src/bin/helpers.bash | ||
|
||
ELASTICSEARCH_HOST=docker-host wait-for-elasticsearch |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Defines the set up steps necessary to create an image to use Dock with this | ||
# repository, allowing you to easily develop or test the Verifier. | ||
|
||
FROM brigade/dock:latest | ||
FROM dock:latest | ||
|
||
# Used to maintain isolated Python environment in the repo | ||
RUN pip install virtualenv |
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#!/bin/bash | ||
|
||
if [[ -n "${ARCANUS_PASSWORD}" || -f "/src/.arcanus/unprotected.key" ]]; then | ||
eval "$(arcanus export --shell)" | ||
fi | ||
|
||
cd /src && env/bin/gunicorn web:app -b 0.0.0.0:3000 -w 8 --log-file=- |
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
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
Oops, something went wrong.