This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
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.
Merge pull request #6 from Nextdoor/docker
Dockerize ZkWatcher
- Loading branch information
Showing
15 changed files
with
365 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.venv | ||
bin |
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 |
---|---|---|
|
@@ -3,7 +3,10 @@ | |
.build | ||
.coverage | ||
.venv | ||
bin | ||
zookeeper.out | ||
build | ||
dist | ||
*.egg-info | ||
docs/_build | ||
.vagrant |
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,8 +1,8 @@ | ||
sudo: required | ||
language: python | ||
python: | ||
- "2.7" | ||
- "pypy" | ||
- 2.7 | ||
install: | ||
- make build | ||
script: make test | ||
sudo: false | ||
script: | ||
- make test |
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,19 @@ | ||
FROM alpine:3.2 | ||
MAINTAINER Matt Wise <matt@nextdoor.com> | ||
|
||
RUN apk add --update bash python py-pip py-yaml ca-certificates curl wget | ||
|
||
RUN mkdir /app /app/zk_watcher | ||
|
||
ADD requirements*.txt /app/ | ||
RUN pip install -r /app/requirements.test.txt -r /app/requirements.txt | ||
|
||
ADD setup.py /app/ | ||
ADD README.rst /app/ | ||
ADD zk_watcher /app/zk_watcher/ | ||
RUN cd /app; python setup.py install | ||
|
||
ADD entrypoint.sh / | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT "/entrypoint.sh" |
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,32 @@ | ||
require './vagrant.rb' | ||
|
||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
VAGRANTFILE_API_VERSION = '2' | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = 'ubuntu-14.04' | ||
config.vm.box_url = 'https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box' | ||
|
||
# Forward ports from the HOST machine to the GUEST VM | ||
config.vm.network :forwarded_port, guest: 8154, host: 8154, auto_correct: true | ||
config.vm.network :forwarded_port, guest: 8155, host: 8153, auto_correct: true | ||
config.vm.network :private_network, type: "dhcp" | ||
|
||
# VirtualBox Specific Customization | ||
config.vm.provider :virtualbox do |vb| | ||
vb.gui = false | ||
vb.customize ['modifyvm', :id, '--memory', '512'] | ||
end | ||
config.nfs.map_uid = Process.uid | ||
config.nfs.map_gid = Process.gid | ||
config.vm.synced_folder './', '/home/vagrant/src', type: "nfs" | ||
|
||
# Required to go and get our dependencies using `godep` below | ||
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" | ||
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: ".ssh/id_rsa" | ||
config.vm.provision 'shell', inline: 'apt-get update; apt-get install -yf git python-virtualenv default-jre' | ||
|
||
# Before running Puppet, we need to install some gems. | ||
config.vm.provision 'shell', inline: 'curl -sSL https://get.docker.com/ | sh' | ||
config.vm.provision 'shell', inline: 'usermod -aG docker vagrant' | ||
end |
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 @@ | ||
Authentication | ||
-------------- | ||
|
||
If you wish to create a Digset authentication token and use that for your | ||
client session with Zookeeper, you can add the settings to the config file | ||
like this :: | ||
|
||
[auth] | ||
user: username | ||
password: 123456 | ||
|
||
If you do this, please look at the `nd_service_registry` docs to understand how | ||
the auth token is used, and what permissions are setup by default. |
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,31 @@ | ||
Installation | ||
------------ | ||
|
||
Local Python Install | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To install the application locally, run : | ||
|
||
.. code-block:: bash | ||
$ python setup.py install | ||
or | ||
|
||
.. code-block:: bash | ||
$ pip install zk_watcher | ||
Docker Container Installation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can pull down the latest builds of `zk_watcher` built into a fully | ||
self-sufficient Docker image like this: | ||
|
||
.. code-block:: bash | ||
$ docker pull nextdoor/zkwatcher | ||
Using default tag: latest | ||
latest: Pulling from nextdoor/zkwatcher | ||
Digest: sha256:47eee56494a190e35c5d25d2285056d0e1e347ee276d7792973fb803511da00a | ||
Status: Image is up to date for nextdoor/zkwatcher:latest |
Oops, something went wrong.