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

simplify the stand-up of a sandbox #90

Merged
merged 10 commits into from
Aug 27, 2021

Conversation

jacobweinstock
Copy link
Member

@jacobweinstock jacobweinstock commented Jul 15, 2021

Description

This simplifies the stand-up of a sandbox. This PR has Vagrant Virtualbox, Vagrant Libvirt, Terraform Equinix Metal, and Docker Compose setups. This refactor modularizes the Tinkerbell stack to use docker-compose as the entry point and makes the creation of infrastructure on different providers the consumers of the docker-compose. Vagrant and Terraform are now only responsible for standing up infrastructure and then running docker-compose, not for running any glue scripts. The compose calls single-shot services to do all the glue required to get a fully functional Tinkerbell stack. All the single-shot services were made to be as idempotent as possible.

This increases portability and the speed of the development iteration cycle. This also simplifies the required steps needed to get a fully functioning sandbox up and running. All of the quick start guides are about 6-7 steps each.

This refactor aims to help people looking to get started by getting them to a provisioned machine quicker and more easily.

With the recent update in Hook to publish the kernel and initrd, this PR makes Hook the default OSIE. The Original OSIE can still be used. This is accomplished by updating the deploy/compose/.env and setting OSIE_DOWNLOAD_URL to an OSIE URL and TINKERBELL_USE_HOOK to false. Currently only an x86_64 Hook is published so only x86_64 machines can be provisioned with the sandbox using Hook.

Rendered QuickStart guide: https://github.com/jacobweinstock/sandbox/blob/one-touch-sandbox/README.md

Why is this needed

The existing setup.sh and genenv.sh and other glue scripts are outside of the the docker-compose and as such depend on the environment and require understanding to run successfully. This PR makes the stand up much simpler by only requiring docker-compose up. This will help people looking to get started by getting them to a provisioned machine quicker and more easily.

Fixes: #74, #85

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock jacobweinstock changed the title This simplifies the stand-up of a sandbox: simplify the stand-up of a sandbox Jul 15, 2021
@tinkerbell tinkerbell deleted a comment from sonatype-lift bot Jul 15, 2021
@tinkerbell tinkerbell deleted a comment from sonatype-lift bot Jul 15, 2021
@jacobweinstock jacobweinstock force-pushed the one-touch-sandbox branch 10 times, most recently from d07525f to 4ad7340 Compare July 16, 2021 20:59
@jacobweinstock jacobweinstock marked this pull request as ready for review July 16, 2021 21:08
@djpbessems
Copy link

[...] though I didn't thoroughly test it, I opted for the dirty workaround [...]

I looked into it some more, and I have been trying to solve the wrong issue. Instead of allowing images-to-local-registry to run in an airgapped environment (after running it once before during VM-template generation), I should have looked into why registry doesn't persist its library of images...

I checked /var/lib/docker/volumes and the contents of the unnamed volumes, it does seem that all the images are actually there, yet linuxkit tells me that the manifest was not found when it tries to pull from the registry. Similarly, when I push the image again to the registry, it doesn't say it's already there.

Do you think it would help if I explicitly defined a data-volume for it (similar to certs: and auth:)?

(I'm now just doing a sed -e '/images-to-local-registry:/,/^$/d' -i docker-compose.yml during the deployment of my template, so it doesn't even try to start that part.)

@djpbessems
Copy link

Do you think it would help if I explicitly defined a data-volume for it (similar to certs: and auth:)?

I see two unnamed volumes in /var/lib/docker/volumes, both with contents that show it's from registry, so this is very likely the solution. I'm going to test and let you know!

(And sorry for all the spammy messages with my train of thoughts spelled out, even though it's mostly out of scope for your PR :P)

By using `/usr/bin/env sh` I needed to ignore some
shell checks. By moving to bash, those shell checks can
be re-enabled.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
This guide gives important details on the design and
architecture of the stack stand up. This details all
single run container/services and their purposes.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
This makes switching between osie and hook via the .env file
not cause the docker-compose up to error out. Creates a nicer
experience when switching.

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove OSIE and replace with hook
5 participants