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

Add core agent business logic #705

Merged
merged 1 commit into from
May 9, 2023

Conversation

chrisdoherty4
Copy link
Member

@chrisdoherty4 chrisdoherty4 commented Apr 6, 2023

Summary

This PR adds core business logic for the new tink agent component. The agent will replace the tink worker and can therefore be considered a re-write. Re-writing the worker has allowed us to remove unsupported functionality such as multi-worker workflows that were implemented in the previous Tinkerbell versions as 'tasks'.

The core business logic leverages a transport to retrieve workflows. It communicates workflow progression via events. It runs workflows serially rejecting requests to run concurrently with an explicit event.WorkflowRejected event. It assumes enforcement of state machines will be performed by the server component it interacts with.

Finally, the logging around the agent has been significantly improved to reflect exactly what's happening as it transitions between actions.

Relevant designs/PRs

Future work

Separate PRs will introduce container runtime and transport implementations. See the Tink agent PoC for a reference.

@chrisdoherty4 chrisdoherty4 changed the title Add tink server-worker workflow v2 proto Add core Tinkerbell agent business logic Apr 6, 2023
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #705 (bdb2746) into main (c73414e) will increase coverage by 2.80%.
The diff coverage is 79.82%.

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

@@            Coverage Diff             @@
##             main     #705      +/-   ##
==========================================
+ Coverage   52.73%   55.54%   +2.80%     
==========================================
  Files          23       26       +3     
  Lines         986     1100     +114     
==========================================
+ Hits          520      611      +91     
- Misses        454      474      +20     
- Partials       12       15       +3     
Impacted Files Coverage Δ
internal/agent/mocks.go 53.33% <53.33%> (ø)
internal/agent/agent.go 92.00% <92.00%> (ø)
internal/agent/run.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chrisdoherty4 chrisdoherty4 force-pushed the feature/agent branch 6 times, most recently from ef19efb to bfbfded Compare April 11, 2023 14:33
@chrisdoherty4 chrisdoherty4 marked this pull request as ready for review April 11, 2023 14:33
@chrisdoherty4 chrisdoherty4 force-pushed the feature/agent branch 6 times, most recently from bd143db to 1573844 Compare April 11, 2023 15:26
@chrisdoherty4 chrisdoherty4 changed the title Add core Tinkerbell agent business logic Add core agent business logic Apr 11, 2023
@chrisdoherty4 chrisdoherty4 added the ready-to-merge Signal to Mergify to merge the PR. label May 9, 2023
Signed-off-by: Chris Doherty <[email protected]>
@mergify mergify bot merged commit 54a6f1c into tinkerbell:main May 9, 2023
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.

2 participants