-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
130 additions
and
144 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,55 @@ | ||
--- | ||
name: Docker Build Action | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
name: Docker Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Log in to the container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.DOCKER_REGISTRY_USER }} | ||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go 1.18 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.18.x' | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
args: --build-tags integration -p bugs -p unused --timeout=3m | ||
|
||
- name: Make tag | ||
run: | | ||
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true | ||
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true | ||
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true | ||
- name: Build and push image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.tag }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
--- | ||
name: Release Drafter Action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,20 +1,24 @@ | ||
BINARY := bmc-catcher | ||
MAINMODULE := github.com/metal-stack/bmc-catcher | ||
COMMONDIR := $(or ${COMMONDIR},../builder) | ||
DOCKER_TAG := $(or ${GITHUB_TAG_NAME}, latest) | ||
.ONESHELL: | ||
SHA := $(shell git rev-parse --short=8 HEAD) | ||
GITVERSION := $(shell git describe --long --all) | ||
BUILDDATE := $(shell date -Iseconds) | ||
VERSION := $(or ${VERSION},devel) | ||
|
||
include $(COMMONDIR)/Makefile.inc | ||
all: test metal-bmc | ||
|
||
release:: test all; | ||
.PHONY: test | ||
test: | ||
go test -v ./... | ||
|
||
.PHONY: fmt | ||
fmt: | ||
GO111MODULE=off go fmt ./... | ||
|
||
.PHONY: dockerimage | ||
dockerimage: | ||
docker build -t metalstack/bmc-catcher:${DOCKER_TAG} . | ||
|
||
.PHONY: dockerpush | ||
dockerpush: | ||
docker push metalstack/bmc-catcher:${DOCKER_TAG} | ||
.PHONY: metal-bmc | ||
metal-bmc: | ||
go build \ | ||
-trimpath \ | ||
-tags netgo \ | ||
-ldflags "-X 'github.com/metal-stack/v.Version=$(VERSION)' \ | ||
-X 'github.com/metal-stack/v.Revision=$(GITVERSION)' \ | ||
-X 'github.com/metal-stack/v.GitSHA1=$(SHA)' \ | ||
-X 'github.com/metal-stack/v.BuildDate=$(BUILDDATE)'" \ | ||
-o bin/metal-bmc \ | ||
main.go | ||
strip bin/metal-bmc |
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,7 +1,29 @@ | ||
# bmc-catcher | ||
# metal-bmc | ||
|
||
Reports the ip addresses that are leased to ipmi devices together with their machine uuids to the `metal-api`. | ||
`metal-bmc` is responsible to gather data from machines via the out of band interfaces and report them back to the metal-api. | ||
It also passes commands to the machines like power on/off, led on/off, firmware update etc. | ||
Access to the console of a machine is also terminated here in conjunction with the `metal-console` running in the control-plane. | ||
|
||
More details per package as follows: | ||
|
||
## Reporter | ||
|
||
Reporter reports the ip addresses that are leased to ipmi devices together with their machine uuids to the `metal-api`. | ||
Therewith it is possible to have knowledge about new machines very early in the `metal-api` and also get knowledge about possibly changing ipmi ip addresses. | ||
`metal-bmc` parses the DHCPD lease file and reports the mapping of machine uuids to ipmi ip address to the `metal-api`. | ||
|
||
## BMC | ||
|
||
The `bmc` package serves the following: | ||
|
||
### Commands | ||
|
||
Commands from the metal-api are passed via nsq and executed either through redfish or ipmi against the out-of-band interface of a machine. | ||
|
||
### Firmware | ||
|
||
Firmware updates the firmware of the BIOS and the BMC of a machine. | ||
|
||
### Console | ||
|
||
`bmc-catcher` parses the DHCPD lease file and reports the mapping of machine uuids to ipmi ip address to the `metal-api`. | ||
Console forwards the the serial console access terminated in `metal-console` to the machine. |
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 was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
module github.com/metal-stack/bmc-catcher | ||
module github.com/metal-stack/metal-bmc | ||
|
||
go 1.18 | ||
|
||
|
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