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

Get BiosCfg ready for prod #6

Merged
merged 6 commits into from
Sep 25, 2024
Merged

Get BiosCfg ready for prod #6

merged 6 commits into from
Sep 25, 2024

Conversation

jakeschuurmans
Copy link
Collaborator

What does this PR do

Attempted to put the work in their own commits to help reading, and so I dont need as many PRs.

  • Add github runner to package helm chart, making it available at https://metal-toolbox.github.io/bioscfg
  • Update Helm Chart to get it ready for the sandbox and prod
  • Update docker to latest alpine
  • Fixes for the makefile
  • Refactor CMD, getting it ready for future work
  • Replace oldTask and steps with rivets.Task
    • Going with a simpler approach, instead of these complicated pieces in steps.go, just a simple function that does the work. Easier to read, easier to add new actions and steps.
  • Replace slog with logrus. I know we want to move off logrus, but I think we need to do this at a later date.
    • Before using slog, I want to make sure it does exactly what we want it to.
  • Move handler.go to bioscfg, plus a bit of a refactor to match changes done to CMD
  • Move publisher to bioscfg, in its own file, it shouldnt be tagged onto tasks.go

Update config, making it uniform with other controllers
Remove "store" interface
Add BMC interface for later use
Update rivets
internal/store/bmc/bmc.go Dismissed Show dismissed Hide dismissed
Refactor CMD
Replace old tasks and steps with new Task
Replace slog with logrus. I know we want to move off logrus, but I think we need to do this at a later date.
Move handler to bioscfg
move publisher to bioscfg, in its own file
Dockerfile Outdated
FROM alpine:3.8 as runner
FROM alpine:latest

ENTRYPOINT ["/usr/sbin/bioscfg"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we moved the entrypoint up here? I don't know that it will affect the execution, but I've never really seen it NOT be the last line of Dockerfile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, ill move it back. I forgot to change it back. I was dealing with a weird bug and trying some wild stuff to see what was up.

Comment on lines 88 to 89
// clientID defaults to 'flipflop'
clientID := "flipflop"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed to flipflop, or was this copy pasta?

bc := &BiosCfg{
cfg: cfg,
logger: logger,
ctx: ctx,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contexts are not meant to be stored in a struct:

Do not store Contexts inside a struct type; instead, pass a Context explicitly to each function that needs it.

https://pkg.go.dev/context

There's probably nothing bad that will happen if we do add it to a struct, but best to use them as intended.

@jakeschuurmans jakeschuurmans merged commit c4174d5 into main Sep 25, 2024
6 checks passed
@jakeschuurmans jakeschuurmans deleted the FS-1744_2 branch September 25, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants