update README to reflect generated `up` script
This commit is contained in:
parent
3369012f20
commit
afbe5925fa
|
@ -7,7 +7,7 @@
|
|||
Make sure you have [Vagrant](https://vagrantup.com) and
|
||||
[VirtualBox](https://www.virtualbox.org/wiki/Downloads) installed.
|
||||
|
||||
Generate the certificates and keys to be used:
|
||||
Generate the per-host configuration, certificates and keys to be used:
|
||||
|
||||
```bash
|
||||
mkdir configs
|
||||
|
@ -23,26 +23,27 @@ vagrant up
|
|||
Start the genesis node:
|
||||
|
||||
```bash
|
||||
vagrant ssh n0 -c 'sudo /vagrant/up.sh /vagrant/configs/n0.yaml'
|
||||
vagrant ssh n0 -c 'sudo /vagrant/configs/up.sh /vagrant/configs/n0.yaml'
|
||||
```
|
||||
|
||||
Join the master nodes:
|
||||
|
||||
```bash
|
||||
vagrant ssh n1 -c 'sudo /vagrant/up.sh /vagrant/configs/n1.yaml'
|
||||
vagrant ssh n2 -c 'sudo /vagrant/up.sh /vagrant/configs/n2.yaml'
|
||||
vagrant ssh n1 -c 'sudo /vagrant/configs/up.sh /vagrant/configs/n1.yaml'
|
||||
vagrant ssh n2 -c 'sudo /vagrant/configs/up.sh /vagrant/configs/n2.yaml'
|
||||
```
|
||||
|
||||
Join the worker node:
|
||||
|
||||
```bash
|
||||
vagrant ssh n3 -c 'sudo /vagrant/up.sh /vagrant/configs/n3.yaml'
|
||||
vagrant ssh n3 -c 'sudo /vagrant/configs/up.sh /vagrant/configs/n3.yaml'
|
||||
```
|
||||
|
||||
### Development Cleanup
|
||||
|
||||
If you are testing/developing on hosts that cannot be easily destroyed, you may
|
||||
find the `cleanup.sh` script useful.
|
||||
To use Promenade from behind a proxy, simply add proxy settings to the
|
||||
promenade `Network` configuration document using the keys `http_proxy`,
|
||||
`https_proxy`, and `no_proxy` before running `generate`.
|
||||
|
||||
### Building the image
|
||||
|
||||
|
|
81
up.sh
81
up.sh
|
@ -1,81 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must be run as root." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "x$1" = "x" ]; then
|
||||
echo "Path to node configuration required." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ex
|
||||
|
||||
#Promenade Variables
|
||||
PROMENADE_TAG=${PROMENADE_TAG:-latest}
|
||||
PROMENADE_IMAGE=${PROMENADE_IMAGE:-quay.io/attcomdev/promenade:${PROMENADE_TAG}}
|
||||
DOCKER_PACKAGE=${DOCKER_PACKAGE:-docker.io}
|
||||
DOCKER_VERSION=${DOCKER_VERSION:-1.12.6-0ubuntu1~16.04.1}
|
||||
|
||||
#Proxy Variables
|
||||
DOCKER_HTTP_PROXY=${DOCKER_HTTP_PROXY:-${HTTP_PROXY:-${http_proxy}}}
|
||||
DOCKER_HTTPS_PROXY=${DOCKER_HTTPS_PROXY:-${HTTPS_PROXY:-${https_proxy}}}
|
||||
DOCKER_NO_PROXY=${DOCKER_NO_PROXY:-${NO_PROXY:-${no_proxy}}}
|
||||
|
||||
|
||||
mkdir -p /etc/docker
|
||||
cat <<EOS > /etc/docker/daemon.json
|
||||
{
|
||||
"live-restore": true,
|
||||
"storage-driver": "overlay2"
|
||||
}
|
||||
EOS
|
||||
|
||||
#Configuration for Docker Behind a Proxy
|
||||
mkdir -p /etc/systemd/system/docker.service.d
|
||||
|
||||
#Set HTTPS Proxy Variable
|
||||
cat <<EOF > /etc/systemd/system/docker.service.d/http-proxy.conf
|
||||
[Service]
|
||||
Environment="HTTP_PROXY=${DOCKER_HTTP_PROXY}"
|
||||
EOF
|
||||
|
||||
#Set HTTPS Proxy Variable
|
||||
cat <<EOF > /etc/systemd/system/docker.service.d/https-proxy.conf
|
||||
[Service]
|
||||
Environment="HTTPS_PROXY=${DOCKER_HTTPS_PROXY}"
|
||||
EOF
|
||||
|
||||
#Set No Proxy Variable
|
||||
cat <<EOF > /etc/systemd/system/docker.service.d/no-proxy.conf
|
||||
[Service]
|
||||
Environment="NO_PROXY=${DOCKER_NO_PROXY}"
|
||||
EOF
|
||||
|
||||
#Reload systemd and docker if present
|
||||
systemctl daemon-reload
|
||||
systemctl restart docker || true
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends \
|
||||
$DOCKER_PACKAGE=$DOCKER_VERSION \
|
||||
|
||||
|
||||
if [ -f "${PROMENADE_LOAD_IMAGE}" ]; then
|
||||
echo === Loading updated promenade image ===
|
||||
docker load -i "${PROMENADE_LOAD_IMAGE}"
|
||||
fi
|
||||
|
||||
docker run -t --rm \
|
||||
--net host \
|
||||
-v /:/target \
|
||||
${PROMENADE_IMAGE} \
|
||||
promenade \
|
||||
-v \
|
||||
up \
|
||||
--hostname $(hostname) \
|
||||
--config-path /target$(realpath $1) 2>&1
|
||||
|
||||
touch /var/lib/prom.done
|
Loading…
Reference in New Issue