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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: "1.15.5"
- run: ./script/release-binaries.sh
- run: ./releases/script/release-binaries.sh
name: get binaries
- name: Create Release
id: create_release
Expand All @@ -30,4 +30,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./out/release/*"]'
asset_paths: '["./releases/out/release/*"]'
3 changes: 2 additions & 1 deletion .github/workflows/vagrant-packet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
- name: Vagrant Test
run: |
export VAGRANT_DEFAULT_PROVIDER="virtualbox"
go test --timeout 1h -v ./test/vagrant
cd ./test/vagrant
go test --timeout 1h -v ./
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
envrc
out
.env
!deploy/.env
.vagrant
deploy/compose/state/webroot/misc/osie/current/*
deploy/compose/state/webroot/workflow/*
!deploy/compose/state/webroot/misc/osie/current/.keep
!deploy/compose/state/webroot/workflow/.keep
deploy/compose/state/webroot/*.gz
workflow_id.txt
compose.tar.gz
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Hello Contributors!

Thanks for your interest!
We're so glad you're here.

### Important Resources

#### bugs: [https://github.com/tinkerbell/sandbox/issues](https://github.com/tinkerbell/sandbox/issues)

### Code of Conduct

Please read and understand the code of conduct found [here](https://github.com/tinkerbell/.github/blob/master/CODE_OF_CONDUCT.md).

### DCO Sign Off

Please read and understand the DCO found [here](docs/DCO.md).

### Environment Details

Building is handled by `make`, please see the [Makefile](Makefile) for available targets.

#### Nix

This repo's build environment can be reproduced using `nix`.

##### Install Nix

Follow the [Nix installation](https://nixos.org/download.html) guide to setup Nix on your box.

##### Load Dependencies

Loading build dependencies is as simple as running `nix-shell` or using [lorri](https://github.com/nix-community/lorri).
If you have `direnv` installed the included `.envrc` will make that step automatic.

### How to Submit Change Requests

Please submit change requests and / or features via [Issues](https://github.com/tinkerbell/sandbox/issues).
There's no guarantee it'll be changed, but you never know until you try.
We'll try to add comments as soon as possible, though.

### How to Report a Bug

Bugs are problems in code, in the functionality of an application or in its UI design; you can submit them through [Issues](https://github.com/tinkerbell/sandbox/issues).

## Code Style Guides
78 changes: 33 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,47 @@
This repository is a quick way to get the Tinkerbell stack up and running.
# Quick-Starts

Currently it supports:
The following quick-start guides will walk you through standing up the Tinkerbell stack.
There are a few options for this.
Pick the one that works best for you.

1. Vagrant with libvirt and VirtualBox
2. Terraform on Packet
## Options

Tinkerbell is made of different components: osie, boots, tink-server,
tink-worker and so on. Currently they are under heavy development and we are
working around the release process for all the components.
- [Vagrant and VirtualBox](docs/quickstarts/VAGRANTVBOX.md)
- [Vagrant and Libvirt](docs/quickstarts/VAGRANTLVIRT.md)
- [Docker Compose](docs/quickstarts/COMPOSE.md)
- [Terraform and Equinix Metal](docs/quickstarts/TERRAFORMEM.md)
- [Kubernetes](docs/quickstarts/KUBERNETES.md)
- [Multipass](docs/quickstarts/MULTIPASS.md)

We need a way to serve a version of Tinkerbell that you can use and we know what
is running the hood. Sandbox runs a pinned version for all the components via
commit sha. In this way as a user you won't be effected (ideally) from new code
that will may change a bit how Tinkerbell works.
## Next Steps

We are keeping the number of breaking changes as low as possible but in the current
state they are expected.
Now that you have a Tinkerbell stack up and running, you can start provisioning machines.
Tinkerbell.org has a [list of guides](https://docs.tinkerbell.org/deploying-operating-systems/the-deployment/) for provisioning machines.
You can also create your own.
The following docs will help you get started.

## Binary release
1. [Create Hardware Data](https://docs.tinkerbell.org/setup/local-vagrant/#creating-the-workers-hardware-data)
2. [Create a Template](https://docs.tinkerbell.org/setup/local-vagrant/#creating-a-template)
3. [Create a Workflow](https://docs.tinkerbell.org/setup/local-vagrant/#creating-the-workflow)

As part of a new release for sandbox we want to push binaries to GitHub Release
in this way the community will be able to use them if needed.
### In the Sandbox

We build Docker images across many architectures, each of them in its own
repository: boots, hegel, tink and so on.
1. Create your own templates

Sandbox is just a collection of those services and we follow the same pattern
for getting binaries as well.
```bash
docker exec -i compose_tink-cli_1 tink template create < ./custom-template.yaml
```

There is a go program available in `./cmd/getbinariesfromquay/main.go`. You can
run it with `go run` or build it with `go build`:
2. Upload any container images you want to use in the templates to the internal registry

```terminal
$ go run cmd/getbinariesfromquay/main.go -h
-binary-to-copy string
The location of the binary you want to copy from inside the image. (default "/usr/bin/hegel")
-image string
The image you want to download binaries from. It has to be a multi stage image. (default "docker://quay.io/tinkerbell/hegel")
-out string
The directory that will be used to store the release binaries (default "./out")
-program string
The name of the program you are extracing binaries for. (eg tink-worker, hegel, tink-server, tink, boots) (default "hegel")
```
```bash
docker run -it --rm quay.io/containers/skopeo copy --all --dest-tls-verify=false --dest-creds="admin":"Admin1234" docker://hello-world docker://192.168.50.4/hello-world
```

By default it uses the image running on Quay for Hegel and it gets the binary
`/usr/bin/hegel` from there. The directory `./out` is used to store images and
binaries inside `./out/releases`.
3. Create a workflow

To get the binaries for example for boots you can run:
```bash
docker exec -i compose_tink-cli_1 tink workflow create -t <TEMPLATE ID> -r '{"device_1":"08:00:27:00:00:01"}')
```

```terminal
$ go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/boots \
-image docker://quay.io/tinkerbell/boots:sha-9625559b \
-program boots
```

You will find them in `./out/release`
4. Restart the machine to provision (if using the vagrant sandbox test machine this is done by running `vagrant destroy -f machine1 && vagrant up machine1`)
1 change: 0 additions & 1 deletion deploy/.gitignore

This file was deleted.

12 changes: 12 additions & 0 deletions deploy/compose/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#OSIE_DOWNLOAD_URL="https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-1790-23d78ea47f794d0e5c934b604579c26e5fce97f5.tar.gz"
OSIE_DOWNLOAD_URL="https://github.com/tinkerbell/hook/releases/download/5.10.57/hook-x86_64.tar.gz"
TINKERBELL_USE_HOOK="true"
TINK_CLI_IMAGE="quay.io/tinkerbell/tink-cli:sha-8ea8a0e5"
TINK_SERVER_IMAGE="quay.io/tinkerbell/tink:sha-8ea8a0e5"
BOOTS_SERVER_IMAGE="quay.io/tinkerbell/boots:sha-94f43947"
HEGEL_SERVER_IMAGE="quay.io/tinkerbell/hegel:sha-9f5da0a8"
TINKERBELL_HARDWARE_MANIFEST="/manifests/hardware/hardware.json"
TINKERBELL_TEMPLATE_MANIFEST="/manifests/template/ubuntu.yaml"
TINKERBELL_HOST_IP=192.168.50.4
TINKERBELL_CLIENT_IP=192.168.50.43
TINKERBELL_CLIENT_MAC=08:00:27:9e:f5:3a
Loading