Skip to content

Instantly share code, notes, and snippets.

@tomrgio
Last active October 16, 2018 13:59
Show Gist options
  • Save tomrgio/64936a2bc231cdda03c344c719779055 to your computer and use it in GitHub Desktop.
Save tomrgio/64936a2bc231cdda03c344c719779055 to your computer and use it in GitHub Desktop.

Slides

https://bit.ly/2J16pHc

Workstations

IP Address IP Address IP Address IP Address
02 ❤️ 18.236.71.103 - 02 ♠️ 34.209.73.145 - 02 ♦️ 54.213.232.141 - 02 ♣️ 54.202.47.95
03 ❤️ 34.220.106.60 - 03 ♠️ 18.236.156.6 - 03 ♦️ 34.222.134.56 - 03 ♣️ 34.213.176.56
04 ❤️ 52.39.26.233 - 04 ♠️ 54.191.72.208 - 04 ♦️ 54.191.218.135 - 04 ♣️ 18.236.98.90
05 ❤️ 54.212.207.155 - 05 ♠️ 54.218.62.91 - 05 ♦️ 34.220.229.124 - 05 ♣️ 54.188.67.169
06 ❤️ 34.221.180.180 - 06 ♠️ 54.214.54.12 - 06 ♦️ 35.166.133.228 - 06 ♣️ 54.201.161.36
07 ❤️ 34.209.74.189 - 07 ♠️ 54.188.79.235 - 07 ♦️ 54.188.28.45 - 07 ♣️ 34.209.87.219
08 ❤️ 35.162.38.22 - 08 ♠️ 54.214.52.236 - 08 ♦️ 54.202.138.92 - 08 ♣️ 52.10.0.149
09 ❤️ 54.202.199.135 - 09 ♠️ 34.217.106.186 - 09 ♦️ 54.212.1.190 - 09 ♣️ 18.236.87.50
10 ❤️ 18.236.181.128 - 10 ♠️ 34.219.77.148 - 10 ♦️ 34.222.124.160 - 10 ♣️ 54.218.121.84
J ❤️ 34.215.190.118 - J ♠️ 18.236.100.38 - J ♦️ 52.34.35.39 - J ♣️ 34.220.172.99
Q ❤️ 52.88.93.206 - Q ♠️ 18.237.106.246 - Q ♦️ 54.187.184.166 - Q ♣️ 35.164.63.226
K ❤️ 34.216.158.192 - K ♠️ 54.190.32.178 - K ♦️ 34.209.241.198 - K ♣️ 34.222.148.129
A ❤️ 35.165.124.103 - A ♠️ 34.219.107.12 - A ♦️ 34.219.74.246 - A ♣️ 54.213.244.43

Slide copy pastes

Hab download command

curl https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | sudo bash

Workshop repo

https://github.com/chef-training/habitat_jumpstart

Scaffold run commands

[1][default:/src:0]# source results/last_build.env
[2][default:/src:0]# hab svc load $pkg_ident
[3][default:/src:0]# sup-log
[4][default:/src:0]# hab pkg install core/curl -b
[5][default:/src:0]# curl http://localhost:8000

Scaffold docker run commands

[1][default:/src:0]# hab pkg export docker results/$pkg_artifact 
[2][default:/src:0]# exit #leave the studio

$ sudo docker image ls
$ source results/last_docker_export.env
$ sudo docker run -it -p 8000:8000 $name

National Parks plan.sh

https://goo.gl/KhWuUW

Init hook

https://goo.gl/F14mkb

Run hook

https://goo.gl/j1WQuY

default.toml

[server]
port = "8080"
shutdown-port = "8005"
redirect-port = "8443"

National parks build commands

~/habitat_jumpstart/national-parks (master)
hab$ hab studio enter
[1][default:/src:0]# build
[1][default:/src:0]# source results/last_build.env
[1][default:/src:0]# hab pkg export docker results/$pkg_artifact
[1][default:/src:0]# exit
$ source results/last_docker_export.env
$ sudo docker run -it -p 8080:8080 $name

Plan with bindings

https://bit.ly/2PAcL2N

Init hook with bindings

https://bit.ly/2QWksRp

Run hook with bindings

https://goo.gl/rUqMYA

default.toml with bindings

mongodb_database = "demo"

[server]
port = "8080"
shutdown-port = "8005"
redirect-port = "8443"

mongo.toml

[mongod]

[mongod.net]
bind_ip = "0.0.0.0"

[mongod.security]
cluster_auth_mode = ""

Running Mongo and National Parks together

~/habitat_jumpstart/national-parks (master)
hab$ hab studio enter
[1][default:/src:0]# build
[2][default:/src:0]# source results/last_build.env
[3][default:/src:0]# hab svc load core/mongodb
[4][default:/src:0]# hab config apply mongodb.default $(date +%s) habitat/mongo.toml
[5][default:/src:0]# hab svc load $pkg_origin/$pkg_name --bind database:mongodb.default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment