Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept path to OSIE tar as env for tinkerbell setup #140

Merged
merged 1 commit into from
Jun 4, 2020
Merged

Accept path to OSIE tar as env for tinkerbell setup #140

merged 1 commit into from
Jun 4, 2020

Conversation

gauravgahlot
Copy link
Contributor

@gauravgahlot gauravgahlot commented May 28, 2020

As the setup.sh executes, it downloads the latest of Osie. This will not efficient for local setup with Vagrant, as you may have to destroy your provisioner VM for various reasons.

The setup script will first read the TB_OSIE_TAR variable. If it is set, the setup will skip the download and extract the file provided tar instead. If not, it will go ahead and download the latest of Osie.

For your Vagrant setup, you can download the tar and then sync the containing directory with the provisioner VM. Now, set the environment variable to the synced folder. For instance:

// in Vagrantfile
config.vm.synced_folder '/var/osie', '/vagrant', type: 'rsync'

// export the env
export TB_OSIE_TAR=/vagrant/osie.tar.gz

Signed-off-by: Gaurav Gahlot [email protected]

@gauravgahlot gauravgahlot added kind/feature Categorizes issue or PR as related to a new feature. area/setup Issue related to tinkerbell setup labels May 28, 2020
@gauravgahlot gauravgahlot self-assigned this May 28, 2020
@gauravgahlot gauravgahlot requested a review from grahamc May 29, 2020 09:46
Copy link
Contributor

@grahamc grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lpgtm, just some minor feedback.

setup.sh Outdated
curl 'https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/latest.tar.gz' -o osie.tar.gz
tar -zxf osie.tar.gz

if [ -z $TB_INTERFACE ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ -z $TB_INTERFACE ]; then
if [ -z "${TB_OSIE_TAR:-}" ]; then

the ${...:-} says "if this variable is undefined, just make the result empty." Quoting it just in case the path to the tarball has spaces or other spooky characters in it.

Also, it looks like the indentation doesn't quite match. I just opened #143 so that if you your editor configured with editorconfig, it will just indent correctly automatically. Specifically, these lines of code are indented 2 spaces too far, and then the stuff inside the if and else should be indented with a tab.

@mmlb mmlb changed the title Accept path to Osie tar as env for tinkerbell setup Accept path to OSIE tar as env for tinkerbell setup Jun 1, 2020
Signed-off-by: Gaurav Gahlot <[email protected]>
@grahamc grahamc merged commit 981c9d6 into tinkerbell:master Jun 4, 2020
@gauravgahlot gauravgahlot deleted the osie-tar branch June 4, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/setup Issue related to tinkerbell setup kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants