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

Backport of allocrunner: provide factory function so we can build mock ARs into release/1.3.x #17172

Merged

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #17161 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

The below text is copied from the body of the original PR.


Tools like the nomad-nodesim are unable to implement a minimal implementation of an allocrunner so that we can test the client communication without having to lug around the entire allocrunner/taskrunner code base. The allocrunner was implemented with an interface specifically for this purpose, but there were circular imports that made it challenging to use in practice.

Move the AllocRunner interface into an inner package and provide a factory function type. Provide a minimal test that exercises the new function so that consumers have some idea of what the minimum implementation required is.

@hc-github-team-nomad-core hc-github-team-nomad-core force-pushed the backport/mock-allocrunner/certainly-crisp-oyster branch from cebeb6b to 582669c Compare May 12, 2023 17:30
@hashicorp-cla
Copy link

hashicorp-cla commented May 12, 2023

CLA assistant check
All committers have signed the CLA.

@vercel vercel bot temporarily deployed to Preview – nomad May 12, 2023 17:30 Inactive
@tgross tgross force-pushed the backport/mock-allocrunner/certainly-crisp-oyster branch 2 times, most recently from 2a3e148 to fcabf82 Compare May 12, 2023 17:36
Tools like `nomad-nodesim` are unable to implement a minimal implementation of
an allocrunner so that we can test the client communication without having to
lug around the entire allocrunner/taskrunner code base. The allocrunner was
implemented with an interface specifically for this purpose, but there were
circular imports that made it challenging to use in practice.

Move the AllocRunner interface into an inner package and provide a factory
function type. Provide a minimal test that exercises the new function so that
consumers have some idea of what the minimum implementation required is.
@tgross tgross force-pushed the backport/mock-allocrunner/certainly-crisp-oyster branch from fcabf82 to b544c99 Compare May 12, 2023 17:39
@tgross
Copy link
Member

tgross commented May 12, 2023

Had to remove some 1.6.0-specific bits of the AllocRunner interface, plus some references to Nomad native service discovery.

@tgross tgross merged commit 7177e1f into release/1.3.x May 12, 2023
@tgross tgross deleted the backport/mock-allocrunner/certainly-crisp-oyster branch May 12, 2023 17:58
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.

3 participants