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

Rename project to Smee: #341

Merged
merged 1 commit into from
Aug 22, 2023
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 .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*
!cmd/boots/boots-*-*
!cmd/boots/boots
!cmd/smee/smee-*-*
!cmd/smee/smee
!test/
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Figure out Docker Tags
id: docker-image-tag
run: |
echo ::set-output name=tags::quay.io/tinkerbell/boots:latest,quay.io/tinkerbell/boots:sha-${GITHUB_SHA::8}
echo ::set-output name=tags::quay.io/tinkerbell/smee:latest,quay.io/tinkerbell/smee:sha-${GITHUB_SHA::8}

- name: Login to quay.io
uses: docker/login-action@v2
Expand All @@ -64,7 +64,7 @@ jobs:
with:
context: ./
file: ./Dockerfile
cache-from: type=registry,ref=quay.io/tinkerbell/boots:latest
cache-from: type=registry,ref=quay.io/tinkerbell/smee:latest
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker-image-tag.outputs.tags }}

Expand All @@ -75,7 +75,7 @@ jobs:
with:
context: ./
file: ./Dockerfile
cache-from: type=registry,ref=quay.io/tinkerbell/boots:latest
cache-from: type=registry,ref=quay.io/tinkerbell/smee:latest
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker-image-tag.outputs.tags }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*.test
.idea*/**
/bin/
/cmd/boots/boots
/cmd/boots/boots-*-*
/cmd/smee/smee
/cmd/smee/smee-*-*
coverage.txt
.vscode

Expand Down
40 changes: 20 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor Guide

Welcome to Boots!
Welcome to Smee!
We are really excited to have you.
Please use the following guide on your contributing journey.
Thanks for contributing!
Expand All @@ -20,7 +20,7 @@ Thanks for contributing!
- [Unit testing](#Unit-testing)
- [Linting](#Linting)
- [Functional testing](#Functional-testing)
- [Running Boots locally](#Running-Boots-locally)
- [Running Smee locally](#Running-Smee-locally)
- [Pull Requests](#Pull-Requests)
- [Branching strategy](#Branching-strategy)
- [Quality](#Quality)
Expand All @@ -32,18 +32,18 @@ Thanks for contributing!

## Context

Boots is a DHCP and PXE (TFTP & HTTP) service.
Smee is a DHCP and PXE (TFTP & HTTP) service.
It is part of the [Tinkerbell stack](https://tinkerbell.org) and provides the first interaction for any machines being provisioned through Tinkerbell.

## Architecture

### Design Docs

Details and diagrams for Boots are found [here](docs/DESIGN.md).
Details and diagrams for Smee are found [here](docs/DESIGN.md).

### Code Structure

Details on Boots's code structure is found [here](docs/CODE_STRUCTURE.md) (WIP)
Details on Smee's code structure is found [here](docs/CODE_STRUCTURE.md) (WIP)

## Prerequisites

Expand Down Expand Up @@ -78,7 +78,7 @@ If you have `direnv` installed the included `.envrc` will make that step automat

#### Runtime dependencies

At runtime Boots needs to communicate with a Tink server.
At runtime Smee needs to communicate with a Tink server.
Follow this [guide](https://docs.tinkerbell.org/setup/local-vagrant/) for running Tink server.

## Development
Expand All @@ -87,35 +87,35 @@ Follow this [guide](https://docs.tinkerbell.org/setup/local-vagrant/) for runnin

> At the moment, these instructions are only stable on Linux environments

To build Boots, run:
To build Smee, run:

```bash
# drop into a shell with all build dependencies
nix-shell

# build all ipxe files, embed them, and build the Go binary
# Built binary can be found in the top level directory.
make boots
make build

```

To build the amd64 Boots container image, run:
To build the amd64 Smee container image, run:

```bash
# make the amd64 container image
# Built image will be named boots:latest
# Built image will be named smee:latest
make image

```

To build the IPXE binaries and embed them into Go, run:

```bash
# Note, this will not build the Boots binary
# Note, this will not build the Smee binary
make bindata
```

To build Boots binaries for all distro
To build Smee binaries for all distro

### Unit testing

Expand Down Expand Up @@ -156,7 +156,7 @@ make vet
1. Create a hardware record in Tink server - follow the guide [here](https://docs.tinkerbell.org/hardware-data/)
2. boot the machine

### Running Boots
### Running Smee

1. Be sure all documented runtime dependencies are satisfied.
2. Define all environment variables.
Expand All @@ -181,38 +181,38 @@ make vet
export API_CONSUMER_TOKEN=none
```

3. Run Boots
3. Run Smee

```bash
# Run the compiled boots
sudo ./boots -http-addr 192.168.2.225:80 -tftp-addr 192.168.2.225:69 -dhcp-addr 192.168.2.225:67
# Run the compiled smee
sudo ./smee -http-addr 192.168.2.225:80 -tftp-addr 192.168.2.225:69 -dhcp-addr 192.168.2.225:67
```

4. Faster iterating via `go run`

```bash
# after the ipxe binaries have been compiled you can use `go run` to iterate a little more quickly than building the binary every time
sudo go run ./boots -http-addr 192.168.2.225:80 -tftp-addr 192.168.2.225:69 -dhcp-addr 192.168.2.225:67
sudo go run ./smee -http-addr 192.168.2.225:80 -tftp-addr 192.168.2.225:69 -dhcp-addr 192.168.2.225:67
```

## Pull Requests

### Branching strategy

Boots uses a fork and pull request model.
Smee uses a fork and pull request model.
See this [doc](https://guides.github.com/activities/forking/) for more details.

### Quality

#### CI

Boots uses GitHub Actions for CI.
Smee uses GitHub Actions for CI.
The workflow is found in [.github/workflows/ci.yaml](.github/workflows/ci.yaml).
It is run for each commit and PR.

#### Code coverage

Boots does run code coverage with each PR.
Smee does run code coverage with each PR.
Coverage thresholds are not currently enforced.
It is always nice and very welcomed to add tests and keep or increase the code coverage percentage.

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# run `make image` to build the binary + container
# if you're using `make boots` this Dockerfile will not find the binary
# and you probably want `make boots-linux-amd64`
# if you're using `make build` this Dockerfile will not find the binary
# and you probably want `make smee-linux-amd64`
FROM alpine:3.13

ARG TARGETARCH
ARG TARGETVARIANT

ENTRYPOINT ["/usr/bin/boots"]
ENTRYPOINT ["/usr/bin/smee"]
EXPOSE 67 69 80

RUN apk add --update --upgrade --no-cache ca-certificates
COPY cmd/boots/boots-linux-${TARGETARCH:-amd64}${TARGETVARIANT} /usr/bin/boots
COPY cmd/smee/smee-linux-${TARGETARCH:-amd64}${TARGETVARIANT} /usr/bin/smee
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ all: help
-include lint.mk
-include rules.mk

build: cmd/boots/boots ## Compile boots for host OS and Architecture
build: cmd/smee/smee ## Compile smee for host OS and Architecture

crosscompile: $(crossbinaries) ## Compile boots for all architectures
crosscompile: $(crossbinaries) ## Compile smee for all architectures

gen: $(generated_go_files) ## Generate go generate'd files

IMAGE_TAG ?= boots:latest
image: cmd/boots/boots-linux-amd64 ## Build docker image
IMAGE_TAG ?= smee:latest
image: cmd/smee/smee-linux-amd64 ## Build docker image
docker build -t $(IMAGE_TAG) .

test: gen ## Run go test
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Boots
# Smee

[![Build Status](https://github.com/tinkerbell/boots/workflows/For%20each%20commit%20and%20PR/badge.svg)](https://github.com/tinkerbell/boots/actions?query=workflow%3A%22For+each+commit+and+PR%22+branch%3Amain)
[![Build Status](https://github.com/tinkerbell/smee/workflows/For%20each%20commit%20and%20PR/badge.svg)](https://github.com/tinkerbell/smee/actions?query=workflow%3A%22For+each+commit+and+PR%22+branch%3Amain)

Boots is the network boot service in the [Tinkerbell stack](https://tinkerbell.org). It is comprised of the following services.
Smee is the network boot service in the [Tinkerbell stack](https://tinkerbell.org). It is comprised of the following services.

- DHCP server
- host reservations only
Expand All @@ -22,19 +22,19 @@ Boots is the network boot service in the [Tinkerbell stack](https://tinkerbell.o
- Syslog server
- receives syslog messages and logs them

## Running Boots
## Running Smee

The DHCP server of Boots serves explicit host reservations only. This means that only hosts that are configured will be served an IP address and network boot details.
The DHCP server of Smee serves explicit host reservations only. This means that only hosts that are configured will be served an IP address and network boot details.

## Interoperability with other DHCP servers

It is not recommended, but it is possible for Boots to be run in networks with another DHCP server(s). To get the intended behavior from Boots one of the following must be true.
It is not recommended, but it is possible for Smee to be run in networks with another DHCP server(s). To get the intended behavior from Smee one of the following must be true.

1. All DHCP servers are configured to serve the same IPAM info as Boots and Boots is the only DHCP server to provide network boot info.
1. All DHCP servers are configured to serve the same IPAM info as Smee and Smee is the only DHCP server to provide network boot info.

1. All DHCP servers besides Boots are configured to ignore the MAC addresses that Boots is configured to serve.
1. All DHCP servers besides Smee are configured to ignore the MAC addresses that Smee is configured to serve.

1. All DHCP servers are configured to serve the same IP address and network boot details as Boots. In this scenario the DHCP functionality of Boots is redundant. It would most likely be recommended to run Boots with the DHCP server functionality disabled (`-dhcp=false`). See the doc on using your existing DHCP service for more details.
1. All DHCP servers are configured to serve the same IP address and network boot details as Smee. In this scenario the DHCP functionality of Smee is redundant. It would most likely be recommended to run Smee with the DHCP server functionality disabled (`-dhcp=false`). See the doc on using your existing DHCP service for more details.

### Local Setup

Expand All @@ -45,16 +45,16 @@ Running the Tests
make test
```

Build/Run Boots
Build/Run Smee

```bash
# make the binary
make boots
# run Boots
./boots -h
make smee
# run Smee
./smee -h

USAGE
Run Boots server for provisioning
Run Smee server for provisioning

FLAGS
-log-level log level (debug, info) (default "info")
Expand Down Expand Up @@ -83,7 +83,7 @@ FLAGS
-syslog-enabled [syslog] enable syslog server(receiver) (default "true")
-ipxe-script-patch [tftp/http] iPXE script fragment to patch into served iPXE binaries served via TFTP or HTTP
-tftp-addr [tftp] local IP and port to listen on for iPXE tftp binary requests (default "172.17.0.2:69")
-tftp-enabled [tftp] enable iPXE tftp binary server) (default "true")
-tftp-enabled [tftp] enable iPXE tftp binary server) (default "true")
-tftp-timeout [tftp] iPXE tftp binary server requests timeout (default "5s")
```

Expand All @@ -93,15 +93,15 @@ You can use NixOS shell, which will have Go and other dependencies.

### Developing using the file backend

The quickest way to get started is `docker-compose up`. This will start Boots using the file backend. This uses the example Yaml file (hardware.yaml) in the `test/` directory. It also starts a client container that runs some tests.
The quickest way to get started is `docker-compose up`. This will start Smee using the file backend. This uses the example Yaml file (hardware.yaml) in the `test/` directory. It also starts a client container that runs some tests.

```sh
docker-compose up --build # build images and start the network & services
# it's fine to hit control-C twice for fast shutdown
docker-compose down # stop the network & containers
```

Alternatively you can manually run Boots by itself. It requires a few
Alternatively you can manually run Smee by itself. It requires a few
flags or environment variables for configuration.

`test/hardware.yaml` should be safe enough for most developers to
Expand All @@ -111,17 +111,17 @@ server on their network. Best to isolate it in Docker or a VM if you're not
sure.

```sh
export BOOTS_OSIE_URL=<http url to the OSIE (Operating System Installation Environment) artifacts>
export SMEE_OSIE_URL=<http url to the OSIE (Operating System Installation Environment) artifacts>
# For more info on the default OSUE (Hook) artifacts, please see https://github.com/tinkerbell/hook
export BOOTS_BACKEND_FILE_ENABLED=true
export BOOTS_BACKEND_FILE_PATH=./test/hardware.yaml
export BOOTS_EXTRA_KERNEL_ARGS="tink_worker_image=quay.io/tinkerbell/tink-worker:latest"
export SMEE_BACKEND_FILE_ENABLED=true
export SMEE_BACKEND_FILE_PATH=./test/hardware.yaml
export SMEE_EXTRA_KERNEL_ARGS="tink_worker_image=quay.io/tinkerbell/tink-worker:latest"

# By default, Boots needs to bind to low ports (67, 69, 80, 514) so it needs root.
sudo -E ./boots
# By default, Smee needs to bind to low ports (67, 69, 80, 514) so it needs root.
sudo -E ./smee

# or run it in a container
# NOTE: not sure the NET_ADMIN cap is necessary
docker run -ti --cap-add=NET_ADMIN --volume $(pwd):/boots alpine:3.14
/boots -dhcp-addr 0.0.0.0:67
docker run -ti --cap-add=NET_ADMIN --volume $(pwd):/smee alpine:3.14
/smee -dhcp-addr 0.0.0.0:67
```
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ For version v0.x.y:
1. Create the annotated tag
> NOTE: To use your GPG signature when pushing the tag, use `SIGN_TAG=1 ./contrib/tag-release.sh v0.x.y` instead)
- `./contrib/tag-release.sh v0.x.y`
1. Push the tag to the GitHub repository. This will automatically trigger a [Github Action](https://github.com/tinkerbell/boots/actions) to create a release.
> NOTE: `origin` should be the name of the remote pointing to `github.com/tinkerbell/boots`
1. Push the tag to the GitHub repository. This will automatically trigger a [Github Action](https://github.com/tinkerbell/smee/actions) to create a release.
> NOTE: `origin` should be the name of the remote pointing to `github.com/tinkerbell/smee`
- `git push origin v0.x.y`
1. Review the release on GitHub.

Expand Down
6 changes: 3 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local_resource(
'compile boots',
'make cmd/boots/boots-linux-amd64'
'compile smee',
'make cmd/smee/smee-linux-amd64'
)
docker_build(
'quay.io/tinkerbell/boots',
'quay.io/tinkerbell/smee',
'.',
dockerfile='Dockerfile',
only=['.']
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/boots/flag.go → cmd/smee/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func newCLI(cfg *config, fs *flag.FlagSet) *ffcli.Command {
setFlags(cfg, fs)
return &ffcli.Command{
Name: name,
ShortUsage: "Run Boots server for provisioning",
ShortUsage: "Run Smee server for provisioning",
FlagSet: fs,
Options: []ff.Option{ff.WithEnvVarPrefix(name)},
UsageFunc: customUsageFunc,
Expand Down
2 changes: 1 addition & 1 deletion cmd/boots/flag_test.go → cmd/smee/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestParser(t *testing.T) {
func TestCustomUsageFunc(t *testing.T) {
defaultIP := detectPublicIPv4("")
want := fmt.Sprintf(`USAGE
Run Boots server for provisioning
Run Smee server for provisioning

FLAGS
-log-level log level (debug, info) (default "info")
Expand Down
Loading
Loading