|
| 1 | +## Habitat Service Package for CHIME |
| 2 | +This package can be used to run CHIME as a fully self-contained application. |
| 3 | +See https://habitat.sh for more details. |
| 4 | + |
| 5 | +### Examples |
| 6 | +Quickstart With Docker "Shim" Container: |
| 7 | +``` |
| 8 | +docker run -it -p 8000:8000 bixu/hab hab sup run "bixu/chime" --channel="unstable" |
| 9 | +``` |
| 10 | + |
| 11 | +Local Prototyping Example: |
| 12 | +``` |
| 13 | +set -e |
| 14 | +curl --silent "https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh" | sudo bash -s |
| 15 | +hab cli setup |
| 16 | +direnv allow |
| 17 | +hab studio enter |
| 18 | +build |
| 19 | +hab sup run $HAB_ORIGIN/chime --channel="unstable" |
| 20 | +``` |
| 21 | + |
| 22 | +Complete `systemd` Bootstrap Example: |
| 23 | +``` |
| 24 | +echo 'HAB_AUTH_TOKEN="<enter your token from https://bldr.habitat.sh/#/profile>" |
| 25 | +HAB_LICENSE="accept" |
| 26 | +HAB_NONINTERACTIVE="true" |
| 27 | +' > supervisor.env |
| 28 | +
|
| 29 | +echo '[Unit] |
| 30 | +Description=Habitat Supervisor |
| 31 | +[Service] |
| 32 | +EnvironmentFile=/etc/systemd/supervisor.env |
| 33 | +ExecStartPre=/bin/bash -c "/bin/systemctl set-environment SSL_CERT_FILE=$(hab pkg path core/cacerts)/ssl/cert.pem" |
| 34 | +ExecStart=/bin/hab sup run --no-color |
| 35 | +ExecStop=/bin/hab sup term |
| 36 | +KillMode=process |
| 37 | +Restart=on-failure |
| 38 | +[Install] |
| 39 | +WantedBy=default.target |
| 40 | +' > supervisor.service |
| 41 | +
|
| 42 | +curl --silent "https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh" | sudo bash -s |
| 43 | +sudo cp "supervisor.env" "/etc/systemd/supervisor.env" |
| 44 | +sudo chown root "/etc/systemd/supervisor.env" |
| 45 | +sudo chmod 400 "/etc/systemd/supervisor.env" |
| 46 | +sudo mv supervisor.service "/etc/systemd/system/supervisor.service" |
| 47 | +sudo --preserve-env hab pkg install "core/hab-sup" |
| 48 | +sudo systemctl enable supervisor |
| 49 | +sudo systemctl restart supervisor |
| 50 | +sudo groupadd hab || true |
| 51 | +sudo useradd --system --gid hab hab || true |
| 52 | +
|
| 53 | +sudo hab svc load "bixu/chime" --channel="unstable" |
| 54 | +``` |
0 commit comments