Repository navigation
Conversation
A hold claim held every card on the node, so a game pinned to one card drained the engines on all of them. A [[claim]] now takes gpu, the same card names and PCI addresses berth run --gpu takes. berthd resolves it to the node's cards at start and asks for the hold on those cards only; a name the node lacks is logged and the claim holds every card. Each card reports the claim active only where it holds, and node.View marks a claim inactive in a view of cards it does not touch, so the gateway starts background engines on the free cards. A claim without gpu holds every card as before.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A hold claim held every card on the node, so a game that runs on one card drained the engines on all of them. A
[[claim]]now takesgpu, with the same card names and PCI addresses thatberth run --gputakes. Only those cards are held.Changes
claims.RulehasGPU, the configured cards, andCards, those cards resolved to positions in the node's cards. A nilCardsmeans every card.Compilerefuses a bad card name and agpuon atrackclaim, soberth config checkrefuses both.gpuonce at start (claimCards, withnode.Pick). A name the node does not have is logged as an error, and that claim holds every card. A running game held on too many cards is safer than one held on none.berth claimsandberth statusname the right card.node.Viewmarks a claim inactive in a view of cards the claim does not touch. Before,Viewkept every claim as-is, so the gateway's background-engine check would see a game held on gpu1 and keep gpu0 idle as well. A claim with no cards, from an older berthd, still counts as on every card.gpuholds every card, as before. The built-in pack is unchanged.[Unreleased]section,docs/leasing.md,docs/gateway.mdand the skill's claim example are updated.Tests
TestWatcherHoldsTheCardsItNamesputs a rule naming gpu1 and a rule without cards on three cards. Only gpu1 is asked for the first rule, and only gpu1 reports it active. Every card holds the second rule.TestClaimCardsResolvesTheRulesCardsresolves by name and by an nvidia-smi-form PCI address, and checks that a card the node lacks is logged and falls back to every card.TestViewIsTheCardsAKeyNamesnow has a claim on gpu1. The claim is active in views that include gpu1 and inactive in a view of gpu0 alone.TestClaimGPUKeyValidatedandTestCompileRejectscover the config errors.I broke the code five ways, one per piece. Asking for every card, reporting the claim on every card, skipping the compile check, skipping the startup resolution, and skipping the
Viewnarrowing each fail the matching test.Full proof:
go build,gofmt,go vet, the Windows build and vet,golangci-lint(0 issues) andgo test ./..., all green.berth config checkfrom the built binary acceptsgpu = "gpu1"and refuses"card 1"and agpuon a track claim. The multi-card path is tested against fakes and the in-process node only, because no multi-card host was available.