Last active
March 24, 2022 03:07
-
-
Save Gurpartap/943f8e435c110231e9f553ff1d9a5e34 to your computer and use it in GitHub Desktop.
Cadence job file for the HashiStack (consul and nomad)
This file contains hidden or 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
| # to run each server component run individually, clone the job file for each, | |
| # cherry pick the service{} and port{} definitions, and set the SERVICES env var appropriately. | |
| # currently requires you to run cassandra schema migrations manually (run 1 job with 0.11.0-auto-setup image) | |
| job cadence-server { | |
| datacenters = ["dc1"] | |
| type = "service" | |
| priority = 60 | |
| # constraint { | |
| # attribute = "${meta.tags}" | |
| # operator = "set_contains" | |
| # value = "cadence-server" | |
| # } | |
| group cadence-server { | |
| count = 3 | |
| constraint { | |
| distinct_hosts = true | |
| } | |
| task cadence-server { | |
| driver = "docker" | |
| kill_timeout = "30s" | |
| config { | |
| image = "ubercadence/server:0.11.0" | |
| network_mode = "host" | |
| volumes = [ | |
| "local/dynamicconfig.yml:/etc/cadence/config/dynamicconfig/dynamicconfig.yml" | |
| ] | |
| } | |
| service { | |
| name = "cadence-frontend" | |
| port = "frontend" | |
| check { | |
| type = "tcp" | |
| interval = "5s" | |
| timeout = "15s" | |
| initial_status = "passing" | |
| } | |
| } | |
| service { | |
| name = "cadence-history" | |
| port = "history" | |
| check { | |
| type = "tcp" | |
| interval = "5s" | |
| timeout = "15s" | |
| initial_status = "passing" | |
| } | |
| } | |
| service { | |
| name = "cadence-matching" | |
| port = "matching" | |
| check { | |
| type = "tcp" | |
| interval = "5s" | |
| timeout = "15s" | |
| initial_status = "passing" | |
| } | |
| } | |
| service { | |
| name = "cadence-worker" | |
| port = "worker" | |
| check { | |
| type = "tcp" | |
| interval = "5s" | |
| timeout = "15s" | |
| initial_status = "passing" | |
| } | |
| } | |
| service { | |
| name = "cadence-server" | |
| tags = ["metrics", "metrics-port=${NOMAD_PORT_prometheus}"] | |
| } | |
| env { | |
| # change requires db reset | |
| NUM_HISTORY_SHARDS = 4 | |
| LOG_LEVEL = "info" | |
| SERVICES = "frontend,history,matching,worker" | |
| BIND_ON_IP = "${NOMAD_IP_frontend}" | |
| CASSANDRA_SEEDS = "cassandra-cluster1-node1.node.consul,cassandra-cluster1-node2.node.consul,cassandra-cluster1-node3.node.consul" | |
| DB = "cassandra" | |
| RF = 3 | |
| KEYSPACE = "cadence" | |
| VISIBILITY_KEYSPACE = "cadence_visibility" | |
| SKIP_SCHEMA_SETUP = true | |
| DYNAMIC_CONFIG_FILE_PATH = "/etc/cadence/config/dynamicconfig/dynamicconfig.yml" | |
| RINGPOP_BOOTSTRAP_MODE = "dns" | |
| RINGPOP_SEEDS = "cadence-frontend.service.consul:7933,cadence-history.service.consul:7934,cadence-matching.service.consul:7935,cadence-worker.service.consul:7939" | |
| PROMETHEUS_ENDPOINT = "${NOMAD_ADDR_prometheus}" | |
| } | |
| template { | |
| change_mode = "noop" | |
| destination = "local/dynamicconfig.yml" | |
| data = <<EOH | |
| --- | |
| system.minRetentionDays: | |
| - value: 0 | |
| constraints: {} | |
| system.historyArchivalStatus: | |
| - value: "disabled" | |
| constraints: {} | |
| system.visibilityArchivalStatus: | |
| - value: "disabled" | |
| constraints: {} | |
| frontend.enableClientVersionCheck: | |
| - value: true | |
| constraints: {} | |
| frontend.visibilityListMaxQPS: | |
| - value: 100 | |
| constraints: {} | |
| history.EnableConsistentQueryByDomain: | |
| - value: true | |
| constraints: {} | |
| EOH | |
| } | |
| resources { | |
| cpu = 2999 | |
| memory = 2000 | |
| network { | |
| mbits = 100 | |
| port frontend { | |
| static = 7933 | |
| } | |
| port history { | |
| static = 7934 | |
| } | |
| port matching { | |
| static = 7935 | |
| } | |
| port worker { | |
| static = 7939 | |
| } | |
| port prometheus {} | |
| } | |
| } | |
| meta { | |
| restarted_at = "Tue Apr 14 23:16:50 IST 2020" | |
| } | |
| } | |
| restart { | |
| attempts = 5 | |
| delay = "5s" | |
| mode = "delay" | |
| interval = "1m" | |
| } | |
| } | |
| migrate { | |
| max_parallel = 1 | |
| health_check = "checks" | |
| min_healthy_time = "15s" | |
| healthy_deadline = "60s" | |
| } | |
| update { | |
| max_parallel = 1 | |
| min_healthy_time = "15s" | |
| healthy_deadline = "1m" | |
| progress_deadline = "2m" | |
| auto_revert = true | |
| auto_promote = true | |
| canary = 1 | |
| stagger = "5s" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To have prometheus collect metrics automatically for the above services, set this in your
prometheus.yml:If you use nomad to also run your prometheus instance, here's
prometheus.nomad: