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

Krm/tink server #573

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Krm/tink server #573

merged 1 commit into from
Apr 26, 2022

Conversation

micahhausler
Copy link
Contributor

@micahhausler micahhausler commented Dec 22, 2021

Description

This PR adds a Kubernetes API backend to Tinkerell as a replacement for Postgres.

This PR builds on #563 and adds new API capabilities

Why is this needed

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #573 (c793017) into main (a80e0e1) will decrease coverage by 1.47%.
The diff coverage is 21.27%.

❗ Current head c793017 differs from pull request most recent head cc49e78. Consider uploading reports for the commit cc49e78 to get more accurate results

@@            Coverage Diff             @@
##             main     #573      +/-   ##
==========================================
- Coverage   45.86%   44.39%   -1.48%     
==========================================
  Files          56       61       +5     
  Lines        3268     3489     +221     
==========================================
+ Hits         1499     1549      +50     
- Misses       1686     1857     +171     
  Partials       83       83              
Impacted Files Coverage Δ
cmd/tink-worker/worker/worker.go 0.00% <0.00%> (ø)
internal/tests/errors.go 0.00% <0.00%> (ø)
pkg/apis/core/v1alpha1/workflow_methods.go 76.27% <ø> (ø)
server/kubernetes_api.go 0.00% <0.00%> (ø)
server/kubernetes_unimplemented.go 0.00% <0.00%> (ø)
internal/tests/frozen_time.go 27.27% <27.27%> (ø)
server/kubernetes_api_workflow.go 29.00% <29.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a80e0e1...cc49e78. Read the comment docs.

@micahhausler micahhausler force-pushed the krm/tink-server branch 9 times, most recently from b679144 to 418b8b8 Compare March 8, 2022 19:56
@micahhausler micahhausler mentioned this pull request Mar 14, 2022
3 tasks
mergify bot added a commit that referenced this pull request Apr 4, 2022
## Description

* Externalized worker package for testability  
* Created `ContainerManager` and `ContainerLogger` abstractions
* Added tests for new interfaces
* Cleaned up worker method arguments (logger is now passed via context)
* Left worker logic unchanged
* Refactored `Worker` struct and initialization

## Why is this needed

I was working on #573 and wanted to be able to create a 'virtual worker' with faked-out Docker client calls. This refactor will make it easy immediately test API changes and later refactor the worker logic.

## How Has This Been Tested?

* Tested locally with a workflow
* Added unit tests

## How are existing users impacted? What migration steps/scripts do we need?

No impact to existing users

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [x] added unit or e2e tests
- [ ] provided instructions on how to upgrade
thebsdbox
thebsdbox previously approved these changes Apr 7, 2022
Copy link
Contributor

@thebsdbox thebsdbox left a comment

Choose a reason for hiding this comment

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

NIIIIIIIIIIIIIIIIICE, /lgtm

mmlb
mmlb previously approved these changes Apr 15, 2022
Copy link
Contributor

@mmlb mmlb left a comment

Choose a reason for hiding this comment

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

skipped over virtual-worker stuff and everything else looks alright. Haven't really used bdd style tests and tooling but if that works for you then 👍. server is looking pretty big, we should split it up so the k8s and sql backends are separate subpackages later I think.

cmd/tink-worker/worker/worker.go Outdated Show resolved Hide resolved
@mmlb mmlb added the do-not-merge Signal to Mergify to block merging of the PR. label Apr 15, 2022
@mmlb
Copy link
Contributor

mmlb commented Apr 15, 2022

I've added do-not-merge just until #602 is merged.

cmd/tink-server/main.go Outdated Show resolved Hide resolved
tests/e2e_test.go Outdated Show resolved Hide resolved
tests/e2e_test.go Outdated Show resolved Hide resolved
@micahhausler micahhausler force-pushed the krm/tink-server branch 6 times, most recently from 6efd3d7 to f80d5fa Compare April 20, 2022 18:56
.github/mergify.yml Show resolved Hide resolved
cmd/tink-server/main.go Outdated Show resolved Hide resolved
cmd/tink-server/main.go Outdated Show resolved Hide resolved
server/kubernetes_unimplemented.go Outdated Show resolved Hide resolved
* Add e2e ginkgo tests

Signed-off-by: Micah Hausler <[email protected]>
@mmlb mmlb added ready-to-merge Signal to Mergify to merge the PR. and removed do-not-merge Signal to Mergify to block merging of the PR. labels Apr 26, 2022
@mmlb mmlb removed the request for review from displague April 26, 2022 16:34
@mmlb mmlb merged commit 59b0126 into tinkerbell:main Apr 26, 2022
Copy link
Member

@displague displague left a comment

Choose a reason for hiding this comment

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

I'm a little late on the review here. I've noted a few places we can iterate on.

I'm glad to see we're moving ahead 🚀

@@ -60,6 +60,7 @@ func NewRootCommand(version string, logger log.Logger) *cobra.Command {
logger,
tinkWorker.WithMaxFileSize(maxFileSize),
tinkWorker.WithRetries(retryInterval, retries),
tinkWorker.WithDataDir("./worker"),
Copy link
Member

Choose a reason for hiding this comment

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

I realize the virtual-worker has limited use-cases, but perhaps --data-dir could be added with ./worker as the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

},
wantErr: nil,
},
{
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we can also test Global Timeout.

return nil, errNotImplemented
}

// ListWOrkflows will return a not implemented error.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// ListWOrkflows will return a not implemented error.
// ListWorkflows will return a not implemented error.

@displague displague added this to the 0.7.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants