Skip to content

Instantly share code, notes, and snippets.

@micktwomey
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micktwomey/4641d1da1bd1669e2c4b to your computer and use it in GitHub Desktop.
Save micktwomey/4641d1da1bd1669e2c4b to your computer and use it in GitHub Desktop.
Django + Aurora + Mesos
fetch = Process(
name = 'fetch',
cmdline = ('export AWS_ACCESS_KEY_ID=... '
'export AWS_SECRET_ACCESS_KEY=... '
'env '
'; aws s3 cp s3://micktwomey-acaversity/slugs/acaversity-master-24.tar.gz slug.tar.gz '
'&& tar -zxf slug.tar.gz'
),
)
setup = Process(
name = 'setup.sh',
cmdline = 'bash slug/scripts/setup.sh',
)
start = Process(
name = 'start.sh',
cmdline = 'bash slug/scripts/start.sh --http :{{thermos.ports[http]}} --http :{{thermos.ports[health]}}'
# cmdline = 'bash slug/scripts/start.sh 0.0.0.0:{{thermos.ports[http]}}'
)
django_task = SequentialTask(
processes = [fetch, setup, start],
resources = Resources(cpu = 0.1, ram = 100*MB, disk=100*MB)
)
update_config = UpdateConfig(watch_secs=45, batch_size=2)
health_check_config = HealthCheckConfig(initial_interval_secs=15,
interval_secs=10,
expected_response='{"ok": true}')
announcer_config = Announcer()
jobs = [
Service(cluster = 'devcluster',
environment = 'devel',
role = 'www-data',
name = 'acaversity',
instances = 4,
task = django_task,
update_config = update_config,
health_check_config = health_check_config,
announce = announcer_config,
constraints = {
'host': 'limit:10',
}
)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment