-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice_spec.yml
222 lines (192 loc) · 6.33 KB
/
service_spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Required. User friendly name of the service.
service_name: atulrepo2
# Optional. Slack channel where CI/CD pipeline notifications are sent.
slack:
team: Behance
username: atul2
channel: Orca-test
# Required.
environments:
# name is an opaque string but must match /^[0-9a-zA-Z]+$/
# The dev environment describes a developer environment with a single
# container and minimal resource requirements.
# Note: The environments get deployed in the order specified in this file.
# Required. At least one environment is required. User friendly name of the environment.
- name: dev1 # Note: There can be multiple test environment of DEV type, e.g. "dev, qa1, qa2 etc".
# Optional in the simplest case with defaults.
# The default is a "inet" type service with a single EXPOSEd port and a health
# check of `GET /health HTTP/1.1`
# Required. "type" is one of DEV/STAGE/PROD. Based on this appropriate Mesos cluster may get selected.
cluster_type: DEV
# Optional. Rollback on deploy failure. Default is false
# ethos-only
rollback_on_failure: false
# Required. List of containers for the service.
containers:
# see footnote [1]
# Required. User friendly image ID for this container image.
- id: atul1-server
# Required. Allowed values: [inet|worker|cron].
topology: inet
# Optional (Default = one time). Revlevant for worker|cron. Linux crontab format.
schedule: 00 09-18 * * *
# Optional. Required if more than one container is defined
dockerfile_path: Dockerfile
# Optional. override CMD. e.g., `docker run image:latest <docker_run_cmd>`
docker_run_cmd: --opt dev1dummy
# Optional. Required, if one or more ports need to be exposed. Comma separated list of exposed ports.
inet_port: 3000
# Required. HTTP GET is assumed here.
health_check:
path: /health
# Optional. (Default = 1). Number of containers for this service
instances: 1
# Optional. (Default = 0.5) Number of CPU(s) Required by this container.
cpus: 1
# Optional. (Default = 512). Memory required by this container.
mem: 1024
- id: atul1-migrate-db
topology: worker
cpus: 0.5
mem: 512
instances: 1
# Required.
regions:
# Our developers are based in Seattle, in this example
- name: us-east-1
# AZs are heterogeneous.
# Some don't work with others and certain instance types can only deploy to
# certain AZs. For a custom VPC (i.e. not EC2-Classic or Default VPC) we
# additionally need the subnet ID
availability_zones:
- {name: us-east-1a, subnet_id: ''}
# This is the role ARN porter needs to do
# http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
role_arn: arn:aws:iam::961382463089:role/atuldev
# Not defined for a developer environment
# elb:
# The name of the SSH key in the region that will be used to login to the
# instance
key_pair_name: some-developer-key
# How is the service distributed?
# S3 is the only option porter currently supports
service_distribution:
# [s3|docker_registry]
cluster_type: s3
# If type is s3, prefix its options with s3_
# The bucket into which the service payload will be uploaded by porter
# in GoCD, and then downloaded by porter on an EC2 instance
s3_bucket: some-service-builds-us-east-1
# If type is docker_registry, prefix its options with docker_registry_
# docker_registry_url: http://somedomain.com
- name: qe1
cluster_type: DEV
rollback_on_failure: false
containers:
- id: atul1-server
topology: inet
schedule: 00 09-18 * * *
dockerfile_path: Dockerfile
docker_run_cmd: --opt qe1dummy
inet_port: 3000
health_check:
path: /health
instances: 2
cpus: 1
mem: 1024
- id: atul1-migrate-db
topology: worker
cpus: 0.5
mem: 512
instances: 1
regions:
- name: us-east-1
availability_zones:
- {name: us-east-1a, subnet_id: ''}
role_arn: arn:aws:iam::961382463089:role/atuldev
key_pair_name: some-developer-key
service_distribution:
cluster_type: s3
s3_bucket: some-service-builds-us-east-1
- name: stage
cluster_type: STAGE
rollback_on_failure: false
containers:
- id: atul1-server
topology: inet
dockerfile_path: Dockerfile
docker_run_cmd: --opt stagedummy
inet_port: 3000
health_check:
path: /health
instances: 3
cpus: 1
mem: 1024
- id: atul1-migrate-db
topology: worker
cpus: 0.5
mem: 512
instances: 1
regions:
- name: us-east-1
availability_zones:
- {name: us-east-1a, subnet_id: ''}
role_arn: arn:aws:iam::961382463089:role/atulstage
key_pair_name: some-developer-key
service_distribution:
cluster_type: s3
s3_bucket: some-service-builds-us-east-1
# prod is a more complex production environment
- name: prod
cluster_type: PROD # One of DEV/STAGE/PROD
rollback_on_failure: true
containers:
- id: some_container
topology: inet
dockerfile_path: Dockerfile
inet_port: 3000
health_check:
method: GET
path: /health
cpus: 4
mem: 400
instances: 3
# The prod environment additionally defines a worker variant of the service's
# codebase to be run
- id: some_worker_container
topology: worker
dockerfile_path: Dockerfile.worker
cpus: 8
mem: 1024
instances: 2
# And lastly a simple cron job
- id: some_cron_container
topology: cron
dockerfile_path: Dockerfile.cron
cpus: 1
mem: 100
instances: 1
regions:
- name: us-east-1
availability_zones:
- {name: us-east-1a, subnet_id: ''}
- {name: us-east-1b, subnet_id: ''}
- {name: us-east-1c, subnet_id: ''}
role_arn: arn:aws:iam::961382463089:role/atulprod
elb: some-service-production
key_pair_name: some-production-key
service_distribution:
cluster_type: s3
s3_bucket: some-service-builds-us-east-1
- name: us-west-2
availability_zones:
- {name: us-west-2a, subnet_id: ''}
- {name: us-west-2b, subnet_id: ''}
- {name: us-west-2c, subnet_id: ''}
role_arn: arn:aws:iam::961382463089:role/atulprod
elb: some-service-production
key_pair_name: some-production-key
service_distribution:
cluster_type: s3
s3_bucket: some-service-builds-us-east-1
# [1] matches Marathon app definition https://mesosphere.github.io/marathon/docs/application-basics.html