44
55Local Development
66=================
7- We have tried to make it simple to hack on Deis, but as an open PaaS, there are
8- necessarily several moving pieces and some setup required. We welcome any suggestions for
9- automating or simplifying this process.
7+ We try to make it simple to hack on Deis, but as an open PaaS, there are
8+ necessarily several moving pieces and some setup required. We welcome
9+ any suggestions for automating or simplifying this process.
1010
1111Prerequisites
1212-------------
13- We strongly recommend using `Vagrant `_ with `VirtualBox `_ so you can develop inside a set
14- of isolated virtual machines. You will need:
13+ We strongly recommend using `Vagrant `_ with `VirtualBox `_ so you can
14+ develop inside a set of isolated virtual machines. You will need:
1515
1616 * Vagrant 1.3.5+
1717 * VirtualBox 4.2+
1818
1919Fork the Repository
2020-------------------
21- To get Deis running locally, first `fork the Deis repository `_, then clone your fork of
22- the repository for local development:
21+ To get Deis running locally, first `fork the Deis repository `_, then
22+ clone your fork of the repository for local development:
2323
2424.. code-block :: console
2525
@@ -29,11 +29,82 @@ the repository for local development:
2929
3030 Provision the Controller
3131------------------------
32+ First bring up a virtual machine to host Deis. To share your local
33+ codebase into the CoreOS VM, Deis uses NFS mounts, so you will be
34+ prompted for an administrative password.
35+
3236.. code-block :: console
3337
3438 $ vagrant up
39+ Bringing machine 'deis' up with 'virtualbox' provider...
40+ ==> deis: Importing base box 'coreos-alpha'...
41+ ...
42+ ==> deis: Exporting NFS shared folders...
43+ ==> deis: Preparing to edit /etc/exports. Administrator privileges will be required...
44+ Password:
45+ ==> deis: Mounting NFS shared folders...
46+ ...
47+ ==> deis: Running provisioner: shell...
48+ deis: Running: inline script
49+ $
50+
51+ Set environment variables to have the `docker ` and `fleetctl ` clients on
52+ your workstation connect to the VM:
53+
54+ .. code-block :: console
55+
56+ export DOCKER_HOST=tcp://172.17.8.100:4243
57+ export FLEETCTL_TUNNEL=172.17.8.100
58+
59+ Next, run ``make pull && make build `` to SSH into the VM, pull Deis'
60+ images from the Docker Index, then update those images with any local
61+ changes.
62+
63+ .. code-block :: console
64+
65+ $ make pull
66+ vagrant ssh -c 'for c in registry logger database cache controller \
67+ builder router; do docker pull deis/$c; done'
68+ Pulling repository deis/registry
69+ d2c347aa26dd: Pulling dependent layers
70+ 511136ea3c5a: Download complete
71+ 6170bb7b0ad1: Download complete
72+ 79fdb1362c84: Downloading [====>
73+ ...
74+ e5efa1477310: Download complete
75+ Connection to 127.0.0.1 closed.
76+ $ make build
77+ vagrant ssh -c 'cd share && for c in registry logger database \
78+ cache controller builder router; \
79+ do cd $c && docker build -t deis/$c . && cd ..; done'
80+ Uploading context 22.53 kB
81+ Uploading context
82+ Step 0 : FROM deis/base:latest
83+ Pulling repository deis/base
84+ 60024338bc63: Download complete
85+ ...
86+ Step 12 : CMD ["/app/bin/boot"]
87+ ---> Running in ccdc3d283f4f
88+ ---> cf4b7a398500
89+ Removing intermediate container ccdc3d283f4f
90+ Successfully built cf4b7a398500
91+ Connection to 127.0.0.1 closed.
92+
93+ Finally, do ``make run `` to start all Deis containers and displays their
94+ collected log output:
95+
96+ .. code-block :: console
3597
36- Yes, really. That's it.
98+ $ make run
99+ vagrant ssh -c 'cd share && for c in registry logger database \
100+ cache controller builder router; \
101+ do cd $c && sudo systemctl enable $(pwd)/systemd/* && cd ..; done'
102+ ln -s '/home/core/share/registry/systemd/deis-registry.service' \
103+ '/etc/systemd/system/multi-user.target.wants/deis-registry.service'
104+ ...
105+ Apr 15 18:53:23 deis sh[9101]: 2014-04-15 12:53:23 [149] [INFO] Booting worker with pid: 149
106+ Apr 15 18:53:24 deis sh[9101]: [2014-04-15 12:53:24,842: INFO/MainProcess] mingle: all alone
107+ Apr 15 18:53:24 deis sh[9101]: [2014-04-15 12:53:24,852: WARNING/MainProcess] celery@121f56ff9ae5 ready.
37108
38109 Install the Client
39110------------------
0 commit comments