Skip to content

Commit

Permalink
Single place for all the tink stack version (#15)
Browse files Browse the repository at this point in the history
Tinkerbell is made of different components as we all know at this point.

Sandbox had those versions all over the places. This PR moves them as
part of the `envrc` file.

As it is today this PR requires an additional flag for the `docker-compose` command as described here #6
  • Loading branch information
mergify[bot] authored Sep 28, 2020
2 parents 43e3fe8 + 72bf833 commit 24f9c82
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
8 changes: 4 additions & 4 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "2.1"
services:
tink-server:
image: quay.io/tinkerbell/tink:sha-adb49da
image: ${TINKERBELL_TINK_SERVER_IMAGE}
restart: unless-stopped
environment:
FACILITY: ${FACILITY:-onprem}
Expand Down Expand Up @@ -52,7 +52,7 @@ services:
retries: 30

tink-cli:
image: quay.io/tinkerbell/tink-cli:sha-adb49da
image: ${TINKERBELL_TINK_CLI_IMAGE}
restart: unless-stopped
environment:
TINKERBELL_GRPC_AUTHORITY: 127.0.0.1:42113
Expand Down Expand Up @@ -89,7 +89,7 @@ services:
network_mode: host

boots:
image: quay.io/tinkerbell/boots:327-58ab49913b5498908b16e2607d265a61a05f73b6
image: ${TINKERBELL_TINK_BOOTS_IMAGE}
restart: unless-stopped
network_mode: host
command: -dhcp-addr 0.0.0.0:67 -tftp-addr $TINKERBELL_HOST_IP:69 -http-addr $TINKERBELL_HOST_IP:80 -log-level DEBUG
Expand Down Expand Up @@ -133,7 +133,7 @@ services:
- ./state/webroot:/usr/share/nginx/html/

hegel:
image: quay.io/tinkerbell/hegel:196-fa897aa020769db8becb9be29adaeb6be92a7fc7
image: ${TINKERBELL_TINK_HEGEL_IMAGE}
restart: unless-stopped
network_mode: host
environment:
Expand Down
6 changes: 3 additions & 3 deletions deploy/vagrant/scripts/tinkerbell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ main() (
sudo apt-get install -y jq
fi

if [ ! -f ./envrc ]; then
./generate-envrc.sh eth1 >envrc
if [ ! -f ./.env ]; then
./generate-envrc.sh eth1 > .env
fi

# shellcheck disable=SC1091
. ./envrc
. ./.env

make_certs_writable

Expand Down
13 changes: 10 additions & 3 deletions generate-envrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ generate_envrc() (
local registry_password
registry_password=$(generate_password)
cat <<EOF
# Tinkerbell Stack version
export OSIE_DOWNLOAD_LINK=https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=252,c=bc454bc,b=master.tar.gz
export TINKERBELL_TINK_SERVER_IMAGE=quay.io/tinkerbell/tink:sha-adb49da
export TINKERBELL_TINK_CLI_IMAGE=quay.io/tinkerbell/tink-cli:sha-adb49da
export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:327-58ab49913b5498908b16e2607d265a61a05f73b6
export TINKERBELL_TINK_HEGEL_IMAGE=quay.io/tinkerbell/hegel:196-fa897aa020769db8becb9be29adaeb6be92a7fc7
export TINKERBELL_TINK_WORKER_IMAGE=quay.io/tinkerbell/tink-worker:sha-adb49da
# Network interface for Tinkerbell's network
export TINKERBELL_NETWORK_INTERFACE="$tink_interface"
Expand Down Expand Up @@ -82,14 +91,12 @@ export TINKERBELL_REGISTRY_PASSWORD="$registry_password"
export FACILITY=onprem
export ROLLBAR_TOKEN=ignored
export ROLLBAR_DISABLE=1
export OSIE_DOWNLOAD_LINK=https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=252,c=bc454bc,b=master.tar.gz
EOF
)

main() (
if [ -z "${1:-}" ]; then
err "Usage: $0 network-interface-name > envrc"
err "Usage: $0 network-interface-name > .env"
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -eu
# See https://tinkerbell.org/setup for the installation steps.

# file to hold all environment variables
ENV_FILE=envrc
ENV_FILE=.env

SCRATCH=$(mktemp -d -t tmp.XXXXXXXXXX)
readonly SCRATCH
Expand Down Expand Up @@ -407,7 +407,7 @@ bootstrap_docker_registry() (

# osie looks for tink-worker:latest, so we have to play with it a bit
# https://github.com/tinkerbell/osie/blob/master/apps/workflow-helper.sh#L66
docker_mirror_image "quay.io/tinkerbell/tink-worker:sha-adb49da" "${TINKERBELL_HOST_IP}/tink-worker:latest"
docker_mirror_image "${TINKERBELL_TINK_WORKER_IMAGE}" "${TINKERBELL_HOST_IP}/tink-worker:latest"
)

setup_docker_registry() (
Expand Down Expand Up @@ -482,7 +482,7 @@ check_prerequisites() (
)

whats_next() (
echo "$NEXT 1. Enter /vagrant/deploy and run: source ../envrc; docker-compose up -d"
echo "$NEXT 1. Enter /vagrant/deploy and run: source ../.env; docker-compose up -d"
echo "$BLANK 2. Try executing your fist workflow."
echo "$BLANK Follow the steps described in https://tinkerbell.org/examples/hello-world/ to say 'Hello World!' with a workflow."
)
Expand Down
2 changes: 1 addition & 1 deletion test/_vagrant/vagrant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestVagrantSetupGuide(t *testing.T) {
}
}()

_, err = machine.Exec(ctx, "cd /vagrant/deploy && source ../envrc && docker-compose up -d")
_, err = machine.Exec(ctx, "cd /vagrant/deploy && source ../.env && docker-compose up -d")
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 24f9c82

Please sign in to comment.