Skip to content

Commit

Permalink
Convert Verifier to deploy without BLI
Browse files Browse the repository at this point in the history
This is a big change but the net effect is that we can now deploy the
verifier using just a Python script.

BLI was a good experiment but this is the only project that ended up
using it.

While here, I moved all Dock-related scripts in the `dock` directory,
and all Jenkins-related scripts in the `jenkins` directory.

Change-Id: Ifdaadef30f58fd82a65848de52c20e3bab621d45
Reviewed-on: https://code.brigade.zone/19525
Tested-by: Leeroy Jenkins <[email protected]>
Reviewed-by: Shane da Silva <[email protected]>
  • Loading branch information
sds committed Nov 25, 2016
1 parent 6716c4b commit 38a65a5
Show file tree
Hide file tree
Showing 17 changed files with 165 additions and 257 deletions.
31 changes: 23 additions & 8 deletions .dock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# vi: ft=sh

# Configures the development/test environment for the Verifier.

dockerfile Dockerfile
project=verifier

build_context dock
dockerfile dock/Development-Dockerfile
privileged true # Need extended privileges to run Docker daemon in container
pull_latest true

Expand All @@ -16,18 +17,32 @@ ci() {
env_var APP_UID $(user_id)
env_var APP_GID $(group_id)

# Configuration for uploading artifacts to Nexus
env_var NEXUS_GROUP $project
optional_env_var NEXUS_USER
optional_env_var NEXUS_PASSWORD

# Tests expect a Docker daemon to be available, so we allocate a volume so the
# daemon running in the container uses a separate layer cache from the host.
volume "$(repo_path)/script/dock-start-docker-daemon:/entrypoint.d/start-docker-daemon:ro"
volume "$(repo_path)/dock/start-docker:/entrypoint.d/start-docker:ro"
volume "$(container_name)_docker:/var/lib/docker:rw"

# Credentials used to push/pull images to/from the Brigade org on Docker Hub
volume "$HOME/.docker:/home/app/.docker"
# Shared amongst all Verifier-related builds to coordinate artifact uploading.
volume "${project}_tmp:/tmp"
volume "${project}_cache:/home/app/.cache"

# Expose Docker Hub credentials if they exist
if [ -d "$HOME/.docker" ]; then
volume "$HOME/.docker:/home/app/.docker"
fi

if ! ci; then
publish 3000:3000 # Gunicorn
publish 9200:9200; publish 9300:9300 # Elasticsearch
publish 9200:9200 # Elasticsearch HTTP
publish 9300:9300 # Elasticsearch Transport
fi

# If no command is specified, start a running instance in a container
default_command script/dock-start-everything
default_command dock/start-everything

# vi: ft=sh
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# This speeds up the start time of any `dock` command.
#
# Whitelist files/patterns for inclusion by prepending "!" to them.
*
.git
dock
jenkins
17 changes: 6 additions & 11 deletions .overcommit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Ensure we use the version of Overcommit (and other gems) specified in the Gemfile
gemfile: Gemfile
gemfile: .overcommit_gems.rb

# Don't need this for a private repo
verify_signatures: false

CommitMsg:
GerritChangeId:
Expand All @@ -9,29 +12,21 @@ CommitMsg:
enabled: true

PreCommit:
ALL:
exclude:
- 'vendor/**/*'

AuthorEmail:
enabled: true
description: 'Checking author email for Brigade domain'
***REMOVED***

HardTabs:
enabled: true
description: 'Checking for hard tabs'
exclude:
- 'Makefile'

JsonSyntax:
enabled: true

MergeConflicts:
enabled: true

TrailingWhitespace:
enabled: true

# Don't need this for a private repo
verify_signatures: false
YamlSyntax:
enabled: true
11 changes: 11 additions & 0 deletions .overcommit_gems.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Specifies the gems available during an Overcommit hook run.
#
# After updating this file, run:
#
# bundle install --gemfile=.overcommit_gems.rb
#
# ...to update the associated lock file.

source 'https://rubygems.org' do
gem 'overcommit', '0.37.0'
end
19 changes: 19 additions & 0 deletions .overcommit_gems.rb.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
GEM
remote: https://rubygems.org/
specs:
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
ffi (1.9.14)
iniparse (1.4.2)
overcommit (0.37.0)
childprocess (~> 0.5.8)
iniparse (~> 1.4)

PLATFORMS
ruby

DEPENDENCIES
overcommit (= 0.37.0)!

BUNDLED WITH
1.12.5
26 changes: 6 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
# 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.
# 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 brigade/centos:7.2.1511-latest

# Install Docker-related software. We can't just mount the host executables in
# the container since the host may be a Mac and thus using a different build
***REMOVED***
| tar -xzf - -C /usr/local/bin --strip-components=1 \
***REMOVED***
| tar -xzf - -C /usr/local/bin \
&& chmod +x /usr/local/bin/docker-compose

RUN yum install -y \
# Needed to install virtualenv via easy_install
python-setuptools \
# Used by Chronos job to do monthly imports
pv \

# Used to maintain isolated Python environment in the repo
&& easy_install virtualenv \
&& yum clean all
# Copy all source code into the container
# See the .dockerignore file for a list of files that are excluded
ADD . /src
7 changes: 0 additions & 7 deletions Gemfile

This file was deleted.

55 changes: 0 additions & 55 deletions Gemfile.lock

This file was deleted.

10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,3 @@ schema.json:

test:
python -m unittest discover --pattern='test*.py'

bli:
gem install docker-api --version=1.28.0 --no-document
***REMOVED***

jenkins_ci: bli
DEBUG=1 bli test

jenkins_build: bli
DEBUG=1 bli build
8 changes: 0 additions & 8 deletions bin/build

This file was deleted.

43 changes: 0 additions & 43 deletions bin/sync-targetsmart-s3-to-hdfs

This file was deleted.

91 changes: 0 additions & 91 deletions deploy.yml

This file was deleted.

5 changes: 5 additions & 0 deletions dock/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Exclude all files from the Docker build context by default.
# This speeds up the start time of any `dock` command.
#
# Whitelist files/patterns for inclusion by prepending "!" to them.
*
Loading

0 comments on commit 38a65a5

Please sign in to comment.