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

boots should not PXE if no workflow defined #35

Closed
nathangoulding opened this issue May 28, 2020 · 4 comments · Fixed by #50
Closed

boots should not PXE if no workflow defined #35

nathangoulding opened this issue May 28, 2020 · 4 comments · Fixed by #50
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects

Comments

@nathangoulding
Copy link
Contributor

If there is no active workflow for a worker, boots should not PXE boot a system. Right now, it will always PXE into the environment and noop, which is not a practical use case.

@mrmrcoleman mrmrcoleman added this to Requests in Issues List May 29, 2020
@rgl
Copy link
Contributor

rgl commented Jun 24, 2020

Instead of being a noop I would like to be able to specify a workflow for the machines that do not (yet) have a workflow. That way I can deal with them (e.g. run some kind of inventory application on them and show the machine in some kind of "un-provisioned/new" machines catalog).

@nathangoulding
Copy link
Contributor Author

@rgl Agreed this would be a good capability to create a default "wait-for-work" template + container that comes baked with Tinkerbell. We also need this in Packet, and I think would have broad appeal. Perhaps we can capture that in a separate issue.

@mrmrcoleman mrmrcoleman moved this from Requests to Triaged in Issues List Jun 25, 2020
@mrmrcoleman mrmrcoleman added kind/feature Categorizes issue or PR as related to a new feature. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jun 25, 2020
@mrmrcoleman mrmrcoleman moved this from Triaged to In Progress in Issues List Jun 26, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 1, 2020
@Cbkhare
Copy link
Contributor

Cbkhare commented Jul 2, 2020

Updates so far.

-) Development & Testing activity:

  1. Changes to fetch worker id for given hardware. Dev + test (Done)

  2. Changes to fetch workflow for a given worker id. Dev - (Done) + Test in progress.

  3. Point 2 requires addition of a rpc client to fetch workflow, changes is required in both boots and tink. Actually, I was using existing client to fetch workflow and after i got go panic error i found, rpc client is currently specific to hardware clis. So, i added a rpc client for workflow. Dev (Done) + Boots Test (Done) + Tink in progress.

  4. Endpoints to fetch workflow using client. Dev (Done) + Test, in progress, currently fixing client in point3.

  5. Using above workflow client, i can fetch workflows and filter which are active. Once, my testing on clients and endpoints are completed i will complete this. Dev + Test (in progress)

I have raised below PR, for workflow client changes in boots and tink. Later, i will add my other changes in same branch.

96bb35d
tinkerbell/tink@f14f070

Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 2, 2020
@Cbkhare Cbkhare linked a pull request Jul 2, 2020 that will close this issue
@Cbkhare
Copy link
Contributor

Cbkhare commented Jul 6, 2020

Tested this PR along with tinkerbell/tink#200.

  • Testing with Active workflow :- completed

{"level":"info","ts":1593695857.2480636,"caller":"job/job.go:55","msg":"found active workflow for hardware 0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94 with workflow id d0f730bc-894d-42de-8c37-9e423f5c761d","service":"github.com/tinkerbell/boots","pkg":"http","dhcp":"0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94"}

  • Testing without active workflow:-completed

{"level":"info","ts":1593696050.6527524,"caller":"boots/dhcp.go:76","msg":"retrieved job is empty","service":"github.com/tinkerbell/boots","pkg":"main","type":"DHCPDISCOVER","mac":"08:00:27:00:00:01","err":"No active workflow found for hardware 0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94"}

image

Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 6, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 6, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 9, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 9, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 9, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 9, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 10, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 13, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 17, 2020
Cbkhare added a commit to Cbkhare/boots that referenced this issue Jul 17, 2020
cherry-picked commits

Added unit test and modified name of tink clients

Added go.mod file

added review comment changes

addressed review comments

Adressed review comments

fixed comment in endpoint

Addressed review comments

Solved linting errors and addressed review comments

removed fetch workflow logic from dhcp serve

modified call to workflowSvcClient

minor changes

added unit test for GetWorkflowFromTink

addressed review comments
@mergify mergify bot closed this as completed in #50 Jul 17, 2020
Issues List automation moved this from In Progress to Just shipped Jul 17, 2020
mergify bot added a commit that referenced this issue Jul 17, 2020
## Details 
No pxe boot is to be supported if there are no active workflow for a worker/hardware. 

## Changes
Added endpoint to fetch active workflow for a hardware
Added logic to translate hardware id to active worker id
Added logic to stop pxe boot if not active workflow is present. 

## Testing
Tested with client added via tinkerbell/tink#200. 

happy path testing completed. 

`{"level":"info","ts":1593695857.2480636,"caller":"job/job.go:55","msg":"found active workflow for hardware 0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94 with workflow id d0f730bc-894d-42de-8c37-9e423f5c761d","service":"github.com/tinkerbell/boots","pkg":"http","dhcp":"0eba0bf8-3772-4b4a-ab9f-6ebe93b90a94"}`

Need to do testing with new tink after the merge of above mentioned PR. 

Negative testing pending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
No open projects
Issues List
  
Just shipped
Development

Successfully merging a pull request may close this issue.

4 participants