-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from xvzf/feat/move-to-mvp
feat: move from PoC to MVP
- Loading branch information
Showing
14 changed files
with
291 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
# Release-please for auto-updated PRs | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release-please | ||
with: | ||
release-type: simple # actual releasing is handled by goreleaser | ||
package-name: gobootme | ||
outputs: | ||
release_created: ${{ steps.release-please.outputs.release_created }} | ||
|
||
# Goreleaser for binary releases / GH release | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- release-please | ||
if: needs.release-please.outputs.release_created | ||
steps: | ||
# Checkout code (full history) | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Setup golang with caching | ||
- name: Setup Golang | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
- id: go-cache-paths | ||
run: | | ||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" | ||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" | ||
- name: Go Build Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-build }} | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
- name: Go Mod Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.go-cache-paths.outputs.go-mod }} | ||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} | ||
|
||
# Setup docker buildx | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
|
||
# Install cosign | ||
- name: Install Cosign | ||
uses: sigstore/cosign-installer@v3 | ||
|
||
# Build fanunit firmware | ||
- name: Build FanUnit Firmware | ||
run: make build-fanunit | ||
|
||
# Run goreleaser | ||
- name: Run Goreleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
COSIGN_YES: "true" | ||
KO_DOCKER_REPO: ghcr.io/${{ github.repository }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
internal/tftp/bootfiles/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,58 @@ | ||
# gobootme | ||
> API driven (i)PXE booting for Raspberry Pis and more. Inspired by [dananderson/netboot](https://github.com/danderson/netboot). | ||
> While this software heavily focuses on Raspberry Pis (especially for the compute-blade), it also boots AMD64 machines. They are just easier and have less quirks. | ||
> **Disclaimer**: works, but test coverage is lacking! | ||
|
||
Bringing Raspberry Pis from zero to iPXE pointing to e.g. [matchbox](http://matchbox.psdn.io) in seconds. | ||
|
||
It acts as ProxyDHCP server to provide boot information to the Pis, and then it serves the iPXE boot script to the Pis. | ||
|
||
## Requirements/Assumptions | ||
- DHCP server without PXE booting configured | ||
- Privileged execution | ||
|
||
## Recommendations | ||
While this software tries to boot the Pis from zero, it's recommended to use the UEFI firmware for the most reliable booting experience. | ||
|
||
## Configuration | ||
- `IPXE_BOOT_ENDPOINT`: HTTP endpoint called when a device tries to (i)PXE boot | ||
- `LOG_LEVEL`: Log level (**default: `info`**) | ||
- `LOG_MODE`: Log mode (**default: `console`**) | ||
- `IPXE_BOOT_ENDPOINT_AUTO`: Expect matchbox running on the same host (**default: `true`**) | ||
- `IPXE_BOOT_ENDPOINT`: custom iPXE boot script endpoint (only used if `IPXE_BOOT_ENDPOINT_AUTO` is `false`) | ||
- `ENABLE_PROXY_DHCP`: Enable proxy DHCP server (**default: `true`**) | ||
- `PROXY_DHCP_INTERFACE`: Interface to listen for bootp requests (**default: `eth0`**) | ||
- `HTTP_PORT`: internal http port for serving iPXE scripts (**default: `8082`**) | ||
|
||
## Running the service | ||
Run the provided container image or binary on a linux host | ||
## Example runtime | ||
|
||
e.g. bringing up matchbox and gobootme in docker-compose | ||
```yaml | ||
version: '3.8' | ||
|
||
services: | ||
gobootme: | ||
image: ghcr.io/xvzf/gobootme:latest | ||
container_name: gobootme | ||
restart: unless-stopped | ||
network_mode: host | ||
environment: | ||
- LOG_LEVEL=info | ||
- LOG_MODE=json | ||
- IPXE_BOOT_ENDPOINT_AUTO=true | ||
- ENABLE_PROXY_DHCP=true | ||
- PROXY_DHCP_INTERFACE=eth0 | ||
|
||
matchbox: | ||
image: quay.io/poseidon/matchbox:latest | ||
container_name: matchbox | ||
restart: unless-stopped | ||
args: | ||
- -address=0.0.0.0:8080 | ||
- -log-level=debug | ||
volumes: | ||
- ./matchbox/assets:/var/lib/matchbox/assets | ||
- ./matchbox/data:/var/lib/matchbox/data | ||
- ./matchbox/rules:/var/lib/matchbox/rules | ||
ports: | ||
- "8080:8080" # Example port mapping, adjust as needed | ||
``` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.