5 Commits

Author SHA1 Message Date
72bf833702 Merge branch 'master' into feature/single-version-place 2020-09-28 16:41:16 +00:00
43e3fe8aaa Merge pull request #16 from tinkerbell/vagrantfile-env-fixes-0
Vagrant virtualbox worker env override fixes
2020-09-24 09:35:39 +02:00
adfccfb1b0 Vagrant virtualbox worker env override fixes
* Change ENV var check to only validate the existence of the
  var in the local env
* Add VAGRANT_WORKER_SCALE env variable override to control
  GUI scaling for virtualbox

Signed-off-by: James W. Brinkerhoff <jwb@paravolve.net>
2020-09-23 07:40:38 -04:00
0c4f4d6f59 Single place for all the tink stack version
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.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2020-09-21 17:50:08 +02:00
4ba30f0ff7 Merge pull request #14 from tinkerbell/fix/terraform-version
this is the right version of the terraform code
2020-09-10 16:53:03 +02:00
6 changed files with 33 additions and 17 deletions

View File

@ -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}
@ -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
@ -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
@ -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:

View File

@ -1,9 +1,15 @@
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
# Returns true if `GUI` environment variable is set to a non-empty value.
# Returns true if `GUI` environment variable exists, value does not matter.
# Defaults to false
def worker_gui_enabled?
ENV.fetch('VAGRANT_WORKER_GUI', '').empty?
ENV.include?('VAGRANT_WORKER_GUI')
end
# Returns true if `SCALE` environment variable exists, value does not matter.
# Defaults to false
def worker_display_scale_enabled?
ENV.include?('VAGRANT_WORKER_SCALE')
end
Vagrant.configure('2') do |config|
@ -57,6 +63,10 @@ Vagrant.configure('2') do |config|
vb.memory = 4*1024
vb.cpus = 1
vb.gui = worker_gui_enabled?
vb.customize [
'setextradata', :id,
'GUI/ScaleFactor', '3.0'
] if worker_display_scale_enabled?
vb.customize [
'modifyvm', :id,
'--nic1', 'none',

View File

@ -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

View File

@ -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"
@ -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

View File

@ -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
@ -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() (
@ -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."
)

View File

@ -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)
}
@ -95,7 +95,6 @@ func TestVagrantSetupGuide(t *testing.T) {
t.Logf("WorkflowID: %s", workflowID)
os.Setenv("VAGRANT_WORKER_GUI", "false")
worker, err := vagrant.Up(ctx,
vagrant.WithLogger(t.Logf),
vagrant.WithMachineName("worker"),