Commit Graph

111 Commits

Author SHA1 Message Date
Gaurav Gahlot c40086d221
rename generate-envrc to generate-env
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
2021-04-16 22:21:10 +05:30
Gianluca Arbezzano 712f3eb38a
Delete CODEOWNERS
This was an attempt to set ownership. It didn't work
2021-04-16 13:17:39 +02:00
mergify[bot] 661855eb26
Fix setup.sh to work when .nat_interface doesn't exist (#78)
## Description

This is a follow-up to #76 which introduced a failure:
```
provisioner: ./setup.sh: line 117: NAT_INTERFACE: unbound variable
```

## Why is this needed

Unbreak `setup.sh` when used by Vagrant

Fixes #77 

## How Has This Been Tested?

I used the following simple test case. It works now that the variable is declared first, but still breaks as reported without the fix.
```bash
#!/bin/bash
set -eu
NAT_INTERFACE=""
if [ -r .nat_interface ]; then
	NAT_INTERFACE=$(cat .nat_interface)
fi
if [ -n "$NAT_INTERFACE" ] && ip addr show "$NAT_INTERFACE" &>/dev/null; then
	echo "$NAT_INTERFACE"
fi
```

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

Vagrant users are currently broken as reported in the community Slack.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-04-12 17:49:20 +00:00
Nahum Shalman 4243501dca Fix setup.sh to work when .nat_interface doesn't exist
Signed-off-by: Nahum Shalman <nshalman@equinix.com>
2021-04-12 16:35:08 +00:00
mergify[bot] 3fc23c58eb
Terraform in Equinix Metal: Fix NAT to reference correct interfaces (#76)
## Description

The NAT setup commands assume that the interface is named eth1, when clearly from the [documentation](https://github.com/tinkerbell/tinkerbell-docs/blame/master/docs/setup/equinix-metal-terraform.md#L118) it is named `enp1s0f1`. This commit fixes the NAT setup commands accordingly.

## Why is this needed

NAT doesn't work by default on Equinix Metal when following the documentation

## How Has This Been Tested?

- [x] Tested with Terraform in Equinix Metal

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

Existing sandboxes (that are broken) should either be rebuilt, or can run the commands manually to enable NAT

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-04-08 20:24:22 +00:00
Nahum Shalman 4d13239d77 Fix NAT to reference correct interfaces
This moves the NAT commands from terraform to setup.sh

Signed-off-by: Nahum Shalman <nshalman@equinix.com>
2021-04-08 16:17:38 +00:00
mergify[bot] 5347fe6da7
Add jq to the nix-shell environment (#75)
Signed-off-by: Nahum Shalman <nshalman@equinix.com>

## Description

Add `jq` to the nix-shell environment

## Why is this needed

There are bits of documentation that use the sandbox and reference using `jq` from the command line.
This makes them work nicely.

## How Has This Been Tested?
On NixOS running `nix-shell` now has `jq` in the PATH.

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

N/A

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-04-06 18:14:15 +00:00
Nahum Shalman 89e49554be Add jq to the nix-shell environment
Signed-off-by: Nahum Shalman <nshalman@equinix.com>
2021-04-06 14:34:14 +00:00
mergify[bot] cc5e0be668
Update Terraform to 0.14 in shell.nix (#72)
## Description

This change causes Nix to pull in Terraform v0.14 rather than v0.12 when users run `nix-shell`

## Why is this needed

Without this change I get this error on both Mac and NixOS:
```
[nix-shell:~/sandbox/deploy/terraform]$ terraform init --upgrade

Warning: Provider source not supported in Terraform v0.12

  on main.tf line 4, in terraform:
   4:     metal = {
   5:       source  = "equinix/metal"
   6:       version = "1.0.0"
   7:     }

A source was declared for provider metal. Terraform v0.12 does not support the
provider source attribute. It will be ignored.

(and 2 more similar warnings elsewhere)


Error: Unsupported Terraform Core version

This configuration does not support Terraform version 0.12.30. To proceed,
either choose another supported Terraform version or update the root module's
version constraint. Version constraints are normally set for good reason, so
updating the constraint may lead to other errors or unexpected behavior.
```

## How Has This Been Tested?

I used this on both a Mac and a NixOS machine using `nix-shell`

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

Running `nix-shell` on existing checkouts will now pull down a newer version of Terraform.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-03-24 15:06:57 +00:00
Nahum Shalman edd0d06b93 Update Terraform to 0.14 in shell.nix
Signed-off-by: Nahum Shalman <nshalman@equinix.com>
2021-03-24 14:21:39 +00:00
Gianluca Arbezzano cfb1781a69 chore: install btrfs-progs as an attempt to make get-binaries script to work
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-24 13:39:36 +01:00
Gianluca Arbezzano 7d878a8e8e
Merge pull request #70 from tinkerbell/install-btrfs-devel
Install btrfs devel
2021-03-24 13:31:00 +01:00
Gianluca Arbezzano b52a90b666 Install btrfs devel
https://github.com/containerd/containerd/issues/3488

As explained here it looks like a requirement now for Ubuntu

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-24 13:25:12 +01:00
mergify[bot] 4a76489a3e
Revert osie because the latest version broke tink-worker installation (#69)
As I explained here
https://github.com/tinkerbell/sandbox/pull/66#issuecomment-803009169 the
current OSIE on master broke how tink-worker gets installed in sandbox.

For a series of bad habits, the PR got merged even if e2e tests are
broken leaving sandbox/master to a not working state

This commit reverts OSIE back to a fully operational version
2021-03-24 12:17:01 +00:00
Gianluca Arbezzano be228ba9f2 Revert osie because the latest version broke tink-worker installation
As I explained here
https://github.com/tinkerbell/sandbox/pull/66#issuecomment-803009169 the
current OSIE on master broke how tink-worker gets installed in sandbox.

For a series of bad habits the PR got merged even if e2e tests are
broken leaving sandbox/master to a not working state

This commit reverts OSIE back to a fully operational version

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-24 09:35:22 +01:00
mergify[bot] 6c7b2a6716
Bump tink stack to newest version (#66)
In preparation for v0.5.0 let's bump a few dependencies up to the newest
versions
2021-03-22 01:37:45 +00:00
mergify[bot] 223f14c02a
Merge branch 'master' into bump/v0.5.0 2021-03-22 01:37:10 +00:00
Gianluca Arbezzano 87c03de829
Merge pull request #68 from detiber/captee
pin boots to TINKERBELL_HOST_IP instead of 0.0.0.0
2021-03-20 08:54:42 +01:00
Jason DeTiberus 8cde1e811d
pin boots to TINKERBELL_HOST_IP instead of 0.0.0.0 2021-03-19 15:38:04 -04:00
Gianluca Arbezzano 3a589b6488 Bump tink stack to newest versions
In preparation of v0.5.0 let's bump a few dependencies up

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-19 14:37:57 +01:00
mergify[bot] 193a2fa83c
Add support for a nat-less libvirt deployment and multiple workers (#65)
## Description

Allows for deploying the vagrant/libvirt setup without NAT and with multiple workers, which enables testing with cluster-api-provider-tink

## Why is this needed

Helps with testing CAPT

## How Has This Been Tested?

Currently testing at the moment, but all testing will consist of manual testing with vagrant/libvirt

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

This could affect existing vagrant/libvirt users if they have an existing worker running when they update, not sure if there is a good way to avoid that, though.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-03-19 07:54:59 +00:00
mergify[bot] 319d5a56b1
Merge branch 'master' into captee 2021-03-19 07:54:25 +00:00
Gianluca Arbezzano 1a03f3b447
Merge pull request #67 from tinkerbell/underscore_vagrant_pkg
Rename _vagrant to vagrant
2021-03-19 08:39:28 +01:00
mergify[bot] 6a954b6dcb
remove the metadata filter in the sandbox (#63)
## Description
Using a custom endpoint instead of using the default endpoint that `hegel` adjusts 
<!--- Please describe what this PR is going to change -->

## Why is this needed
The reason behind that is, while using the sandbox in combination with tinkerbell's example [workflows](https://github.com/tinkerbell/workflows). The [functions.sh](https://github.com/tinkerbell/workflows/blob/master/ubuntu_18_04/00-base/functions.sh) will fail due to lack of information in the retrieved metadata from `hegel`. The default endpoint filters out all the needed metadata such as `plan_slug`. This PR removes that filtration criteria. 

Also I am not sure, I think we are safe to provide these info(the full hardware spec) to the worker while using the Sandbox setup, as this is mainly used as an example setup not as a production one.   
<!--- Link to issue you have raised -->

Fixes: #64 

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
Yes, it was tested locally by setting the env var in the docker-compose.yml file and batch it in the sandbox setup. 

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

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-03-18 14:35:33 +00:00
Gianluca Arbezzano c5dd65c724 Rename _vagrant to vagrant
Apparently the idea to prefix a package with an underscore is not that
smart as I thought. Yes `go test` does not run it by default when you
run `go test ./...` but also other commands like `go mod tidy` do not
work consistently.

Nothing changes in practice. By default only unit tests run. Setting the
new environment variable: `TEST_WITH_VAGRANT` you include the test who
uses vagrant.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-18 15:11:55 +01:00
Jason DeTiberus 21bc78b77d
Add support for a nat-less libvirt deployment and multiple workers 2021-03-18 09:45:57 -04:00
Moath Qasim 0a5a491530 remove the metadata filter in the sandbox
Signed-off-by: Moath Qasim <moad.qassem@gmail.com>

Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
2021-03-16 19:36:40 +01:00
mergify[bot] dbf51c823e
add current_versions.sh file to the terraform provisioner (#61)
## Description
Mounting the `current_versions.sh` file to the target provisioner when installing TinkerBell on Equinix using terraform 
<!--- Please describe what this PR is going to change -->

## Why is this needed
Because the `generate-envrc.sh` will fail and no TinkerBell env will be created.
<!--- Link to issue you have raised -->

Fixes: #60

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
Simply ran the provisioner on Equinix and the env file was created with all the needed info.

## How are existing users impacted? What migration steps/scripts do we need?
None
<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-03-04 13:37:48 +00:00
Moath Qasim 20d0a92e01 add current_versions.sh file to the terraform provisioner
Signed-off-by: Moath Qasim <moad.qassem@gmail.com>

Signed-off-by: Moath Qasim <moad.qassem@gmail.com>
2021-03-03 19:23:19 +01:00
mergify[bot] 407bd76da5
Fix port collision between boots and nginx (#57)
I am not sure when it happens, it can be when we removed the NGINX_IP,
or when we checked that every services were using ports OR network_mode
but we exposed nginx and boots over the same port.

This commit fixes that.
2021-03-03 17:39:39 +00:00
Gianluca Arbezzano 1ac6fdf827 Fix port collision between boots and nginx
I am not sure when it happens, it can be when we removed the NGINX_IP,
or when we checked that every services were using ports OR network_mode
but we exposed nginx and boots over the same port.

This commit fixes that.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-03-03 09:34:18 +01:00
mergify[bot] b46a724c5a
Removes conflicting composefile network instruction per #53 for boots… (#56)
… container definition

## Description

Resolves #53 

## Why is this needed

This conflict causes container creation to fail. 

Fixes: #

## How Has This Been Tested?

I ran the setup and was able to run a workflow and deployment without issue.

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

No impact.


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-02-18 07:49:35 +00:00
Joseph D. Marhee cf57ac7c6a Removes conflicting composefile network instruction per #53 for boots container definition
Signed-off-by: Joseph D. Marhee <jmarhee@interiorae.com>
2021-02-17 15:20:22 -06:00
Gaurav Gahlot 813e9b1f7e
Merge pull request #54 from tinkerbell/feat/new-bump-command-utility
New tool to bump current_versions.sh automatically
2021-02-15 10:54:09 +05:30
Gianluca Arbezzano d6a057c89d New tool to bump current_versions.sh automatically
This commit contains a new utility that helps to automate a version bump
for sandbox.

You can run this command to get the vibe of what it does.

```
$ go run cmd/bump-version/main.go -help
```

In order to try it out you can run this command form sandbox root. By
default it won't overwrite anything. It will print to stdout a new
version of the current_versions.sh file where all the images are
calculate cloning the various repositories

```
$ go run cmd/bump-version/main.go
```

If you want to overwrite the current_versions file you can use the flag
`-overwrite`.

More will come but for now, that's the PoC. Ideally this can be hooked
to CI/CD and run periodically, opening a PR that can be evaluated and
merged.

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-02-12 14:47:46 +01:00
mergify[bot] 4f64f1656d
Updates plan to use Metal provider, updates outputs accordingly (#51)
## Description

Updates [Packet Terraform](https://docs.tinkerbell.org/setup/packet-terraform/) plan to use the Equinix Metal provider. 

## Why is this needed

Consistent with rebranding efforts across the organization.

Fixes: #

## How Has This Been Tested?

This plan validates, and applies as expected (and has previously) with the renamed resources, and updates outputs.


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

Existing users may need to reinitialize their Terraform environment, but existing resources in state can be imported. 

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-02-09 17:51:03 +00:00
mergify[bot] 7315975878
Merge branch 'master' into metal-provider-update-plan 2021-02-09 17:50:28 +00:00
Joseph D. Marhee 21301d182f Updates variable description to use EM
Signed-off-by: Joseph D. Marhee <jmarhee@interiorae.com>
2021-02-04 13:54:31 -06:00
Joseph D. Marhee cbd90e063e Updates plan to use Metal provider, updates outputs accordingly
Signed-off-by: Joseph D. Marhee <jmarhee@interiorae.com>
2021-02-04 13:54:31 -06:00
mergify[bot] 58937939c3
Bootstrap Packer template for libvirt and Vbox (#48)
This PR contains a provisioning mechanism for the Vagrant boxes we ship
as part of Sandbox.

In order to self contain and distribute the required dependencies for Tinkerbell
and Sandbox without having to download all of them runtime we decided to use
[Packer.io](https://packer.io) to build boxes that you can use when provisioning
Tinkerbell on Vagrant.

Currently the generated boxes are available via [Vagrant
Cloud](https://app.vagrantup.com/tinkerbelloss).

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-02-04 09:53:22 +00:00
Gaurav Gahlot cf67fe6476
nit pick 2021-02-04 15:22:23 +05:30
Gianluca Arbezzano 9edecbfc86 Bootstrap Packer template for libvirt and Vbox
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-02-04 10:27:19 +01:00
mergify[bot] 3d387cd26e
Use same IP address for both boots and nginx (#43)
Signed-off-by: Michael Richard <michael.richard.ing@gmail.com>

## Description

This configures NGINX to listen on port 8080 and lets go the need to configure a second IP address on the host dedicated to NGINX.

## Why is this needed

Setting up a second IP address to host NGINX on the same host is not always easy, especially when running tinkerbell on network devices like switches. The second IP address adds a useless level of complexity. In the future, all the code required to identify the host operating system and configure the IP address could even be removed and left as a prerequisite, since the host is likely to have an IP address already configured.

## How Has This Been Tested?

The untouched vagrant_test.go test ran sucessfully.

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

Simply re-applying the docker-compose.yml should be sufficient (untested).
Additional firewall rules to allow traffic on port 8080 could be required depending on user's network configuration.

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
2021-01-27 10:39:13 +00:00
mergify[bot] 141083e24d
Merge branch 'master' into single-ip-address 2021-01-27 10:38:39 +00:00
mergify[bot] c67898ed52
Fix vagrant config for libvirt (#42)
## Description

Fixes the vagrant configuration when using libvirt

## Why is this needed

Without this issue the vagrant provisioner fails when using libvirt with the following error:

```sh
Error occurred while creating new network: {:iface_type=>:private_network, :netmask=>"255.255.255.0", :dhcp_enabled=>false, :forward_mode=>"none", :virtualbox__intnet=>"tink_network", :libvirt__dhcp_enabled=>false, :libvirt__forward_mode=>"none", :auto_config=>false, :protocol=>"tcp", :id=>"18e6fc6d-41b8-40c9-814d-ffc476bfd920"}.
```

## How Has This Been Tested?

Reran vagrant up after making the changes and the provisioner machine successfully was created


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

Should not affect existing users unless they were trying to use vagrant/libvirt and were unsuccessful before.

No migration should be needed.
2021-01-26 10:17:25 +00:00
Michael Richard c7b84264af Set NGINX to bind on TINKERBELL_HOST_IP:8080
Signed-off-by: Michael Richard <michael.richard.ing@gmail.com>
2021-01-25 15:19:23 -05:00
Jason DeTiberus 6150dd91c7
Fix vagrant config for libvirt 2021-01-25 15:00:02 -05:00
Gianluca Arbezzano cc39216b67
Merge pull request #44 from gianarb/hotfix/shfmt-tinkerbell-sh
Fix shfmt for tinkerbell.sh file
2021-01-25 19:18:25 +01:00
Gianluca Arbezzano e4d8fafa33 Fix shfmt for tinkerbell.sh file
Not sure how I happened but it looks like we introduced an shfmt error
in master

Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
2021-01-25 19:06:31 +01:00
mergify[bot] 89a304f4a7
Fix NAT and make it working for Terraform and Vagrant (#41)
Commit b504810 introduced a NAT to make worker capable of reaching the
public internet via the provisioner.

But it also introduced a bug, it only works for the Vagrant setup as
Manny pointed out:

https://github.com/tinkerbell/sandbox/pull/33#issuecomment-759651035

This is an attempt to fix it

@mmlb I would like to avoid additional conditions as part of the
setup.sh, we have already too many of them and they are not even easy to
dsicover. We have different entrypoint for those environment let's use them.
2021-01-23 03:44:11 +00:00