orchestration 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/MANIFEST +1 -0
- data/README.md +34 -5
- data/doc/images/example.png +0 -0
- data/lib/orchestration/templates/env.erb +0 -3
- data/lib/orchestration/templates/orchestration.mk.erb +4 -4
- data/lib/orchestration/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd01f40026116b804917069fba7d1e5c44d8aeee5a544b45e0815fb62f69ed5
|
4
|
+
data.tar.gz: cc69537b606cb64b5fa681af09f629cac90c7e2d4c2d98bcf173c3306b214588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ac9f6b9d04f74ed0cdea5e653296b300f9e1c04184340ede3dbb4a1e726ab4c32e2b3f6bc4e3bdddfc79315d2eaa8cb0ab1fe8877a3131f55179ca787268d86
|
7
|
+
data.tar.gz: a66c75b212e0992130b1e289781d516fe5b4be7bd5176c1a9a91c86bf927a9853ee8da7ed26192ecbf307d6cb66aa16dd579b5dd370bdd8e4f598df1b4d7ec38
|
data/.gitignore
CHANGED
data/MANIFEST
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
_Orchestration_ aims to provide a convenient and consistent process for working with _Rails_ and _Docker_ without obscuring underlying components.
|
6
6
|
|
7
|
-
At its core _Orchestration_ is
|
7
|
+
At its core _Orchestration_ is simply a `Makefile` and a set of `docker-compose.yml` files with sensible, general-purpose default settings. Users are encouraged to tailor the generated build-out to suit their application; once the build-out has been generated it belongs to the application.
|
8
8
|
|
9
9
|
A typical _Rails_ application can be tested, built, pushed to _Docker Hub_, and deployed to _Docker Swarm_ with the following commands:
|
10
10
|
|
@@ -13,6 +13,13 @@ make test build push
|
|
13
13
|
make deploy manager=user@swarm.example.com env_file=/var/configs/myapp.env
|
14
14
|
```
|
15
15
|
|
16
|
+
_Orchestration_ has been successfully used to build continuous delivery pipelines for numerous production applications with a wide range or requirements.
|
17
|
+
|
18
|
+
## Example
|
19
|
+
|
20
|
+
The below screenshot demonstrates _Orchestration_ being installed in a brand new _Rails_ application with support for _PostgreSQL_ (via the _PG_ gem) and _RabbitMQ_ (via the _Bunny_ gem):
|
21
|
+
![example](doc/images/example.png "https://hub.docker.com/r/rubyorchestration/sampleapp/tags")
|
22
|
+
|
16
23
|
## Getting Started
|
17
24
|
|
18
25
|
[_Docker_](https://www.docker.com/get-started) and [_Docker Compose_](https://docs.docker.com/compose/install/) must be installed on your system.
|
@@ -43,7 +50,7 @@ rake orchestration:install server=unicorn # (or 'puma' [default], etc.)
|
|
43
50
|
|
44
51
|
To rebuild all build-out at any time, pass `force=yes` to the above install command.
|
45
52
|
|
46
|
-
You will be prompted to enter values for your _Docker_ organisation and repository name. For example, the _organisation_ and _repository_ for https://hub.docker.com/r/
|
53
|
+
You will be prompted to enter values for your _Docker_ organisation and repository name. For example, the _organisation_ and _repository_ for https://hub.docker.com/r/rubyorchestration/sampleapp are `rubyorchestration` and `sampleapp` respectively. If you are unsure of these values, they can be modified later by editing `.orchestration.yml` in the root of your project directory.
|
47
54
|
|
48
55
|
#### Configuration files
|
49
56
|
|
@@ -51,7 +58,7 @@ _Orchestration_ generates the following files where appropriate. Backups are cre
|
|
51
58
|
|
52
59
|
* `config/database.yml`
|
53
60
|
* `config/mongoid.yml`
|
54
|
-
* `config/rabbitmq.yml` (see [RabbitMQ Configuration](#
|
61
|
+
* `config/rabbitmq.yml` (see [RabbitMQ Configuration](#rabbitmq-configuration) for more details)
|
55
62
|
* `config/unicorn.rb`
|
56
63
|
* `config/puma.rb`
|
57
64
|
|
@@ -125,7 +132,7 @@ Note that `git archive` is used to generate the build context. Any uncommitted c
|
|
125
132
|
make build
|
126
133
|
```
|
127
134
|
|
128
|
-
See [build environment](#
|
135
|
+
See [build environment](#build-environment) for more details.
|
129
136
|
|
130
137
|
#### Push latest image
|
131
138
|
|
@@ -191,8 +198,23 @@ CONTAINER_PORT=3000
|
|
191
198
|
REPLICAS=5
|
192
199
|
```
|
193
200
|
|
194
|
-
It is also recommended to set `SECRET_KEY_BASE` etc. in this file.
|
201
|
+
It is also recommended to set `SECRET_KEY_BASE`, `DATABASE_URL` etc. in this file.
|
202
|
+
|
203
|
+
## Logs
|
204
|
+
|
205
|
+
The output from most underlying components is hidden in an effort to make continuous integration pipelines clear and concise. All output is retained in `log/orchestration.stdout.log` and `log/orchestration.stderr.log`. i.e. to view all output during a build:
|
206
|
+
|
207
|
+
```bash
|
208
|
+
tail -f log/orchestration*.log
|
209
|
+
```
|
195
210
|
|
211
|
+
A convenience `Makefile` target `dump` is provided which will output all consumed _stdout_ and _stderr_:
|
212
|
+
|
213
|
+
```bash
|
214
|
+
make dump
|
215
|
+
```
|
216
|
+
|
217
|
+
<a name="build-environment"></a>
|
196
218
|
## Build Environment
|
197
219
|
|
198
220
|
The following environment variables will be passed as `ARG` variables when building images:
|
@@ -231,6 +253,12 @@ get '/healthcheck', to: proc { [200, { 'Content-Type' => 'text/html' }, ['']] }
|
|
231
253
|
|
232
254
|
In this case, `WEB_HEALTHCHECK_PATH` must be set to `/healthcheck`.
|
233
255
|
|
256
|
+
## Dockerfile
|
257
|
+
|
258
|
+
A `Dockerfile` is automatically generated based on detected dependencies, required build steps, _Ruby_ version, etc.
|
259
|
+
|
260
|
+
Real-world applications will inevitably need to make changes to this file. As with all _Orchestration_ build-out, the provided `Dockerfile` should be treated as a starting point and customisations should be applied as needed.
|
261
|
+
|
234
262
|
## Entrypoint
|
235
263
|
|
236
264
|
An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) script for your application is provided which does the following:
|
@@ -240,6 +268,7 @@ An [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) sc
|
|
240
268
|
* Adds a route `host.docker.internal` to the host machine running the container (mimicking the same route provided by _Docker_ itself on _Windows_ and _OS
|
241
269
|
X_).
|
242
270
|
|
271
|
+
<a name="rabbitmq-configuration"></a>
|
243
272
|
## RabbitMQ Configuration
|
244
273
|
|
245
274
|
The [Bunny](https://github.com/ruby-amqp/bunny) _RabbitMQ_ gem does not recognise `config/rabbitmq.yml`. If your application uses _RabbitMQ_ then you must manually update your code to reference this file, e.g.:
|
Binary file
|
@@ -64,7 +64,7 @@ all: build
|
|
64
64
|
start: _clean-logs
|
65
65
|
@$(call print,'${yellow}Starting containers${reset} ...')
|
66
66
|
ifeq (${env},$(filter ${env},test development))
|
67
|
-
@${compose} up -d --force-recreate ${services} ${
|
67
|
+
@${compose} up -d --force-recreate ${services} ${log} || ${fail}
|
68
68
|
@[ '${is_container}' == '1' ] && \
|
69
69
|
( \
|
70
70
|
docker network connect '${network}' '$(shell hostname)' ${log} \
|
@@ -73,7 +73,7 @@ ifeq (${env},$(filter ${env},test development))
|
|
73
73
|
) \
|
74
74
|
|| ( [ '${is_container}' == '0' ] || ${fail} )
|
75
75
|
else
|
76
|
-
@${compose} up -d --scale app=$${instances:-1} ${services} ${
|
76
|
+
@${compose} up -d --scale app=$${instances:-1} ${services} ${log} || ${fail}
|
77
77
|
endif
|
78
78
|
@$(call printrawln,' ${green}started${reset} ${tick}')
|
79
79
|
@$(call println,'${yellow}Waiting for services to become available${reset} ...')
|
@@ -95,11 +95,11 @@ stop: _clean-logs
|
|
95
95
|
@$(call print,'${yellow}Stopping containers${reset} ...')
|
96
96
|
@if docker ps --format "{{.ID}}" | grep -q $(shell hostname) ; \
|
97
97
|
then \
|
98
|
-
( ${compose} down ${
|
98
|
+
( ${compose} down ${log} || ${fail} ) \
|
99
99
|
&& \
|
100
100
|
( docker network connect ${docker_repository}_${env}_default $(shell hostname) ${log} || : ) ; \
|
101
101
|
else \
|
102
|
-
${compose} down ${
|
102
|
+
${compose} down ${log} || ${fail} ; \
|
103
103
|
fi
|
104
104
|
@$(call printrawln,' ${green}stopped${reset}. ${tick}')
|
105
105
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orchestration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
@@ -333,6 +333,7 @@ files:
|
|
333
333
|
- bin/setup
|
334
334
|
- bin/strong_versions
|
335
335
|
- config/locales/en.yml
|
336
|
+
- doc/images/example.png
|
336
337
|
- lib/Rakefile
|
337
338
|
- lib/orchestration.rb
|
338
339
|
- lib/orchestration/docker_compose.rb
|