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

Implement PUT endpoint for allocations to adjust allocation on the go. #2598

Open
cryptobench opened this issue May 25, 2023 · 4 comments · Fixed by #2727, golemfactory/ya-client#144 or golemfactory/ya-client#145
Assignees

Comments

@cryptobench
Copy link
Member

In showcase we would like to be able to adjust our allocations on the go while our task is running. This would aid us in the issue of running out of budget.

Our goal with this endpoint is to loop over the current allocated budget and check our spendings and what's left in the budget. If it gets too low, then we will adjust the budget accordingly.

https://github.com/golemfactory/ya-client/blob/7840c32ecf0bc1b66b094b3a5df992f341f87a32/specs/payment-api.yaml#L605

@golmek
Copy link
Contributor

golmek commented Jun 12, 2023

@cryptobench I can confirm that currently PUT /allocations/{allocationId} is not implemented.

I will proceed with proceeding this ticket within CORE. However, I am just wondering if workaround is possible in Your scenario. Can You please verify if following workaround would work for your scenario?

  • When identified that budget is getting low:
    • Create new allocation via POST /allocations
    • Use new Allocation to pay for debit notes & invoices via POST /invoices/{invoiceId}/accept. This method can take new AllocationId as a input.
    • Release old allocation via DELETE /allocations/{allocationId}

Let us know if that works for You. Thx!

@golmek
Copy link
Contributor

golmek commented Jun 21, 2023

Acceptance Criteria:

  • implement PUT /allocations/{allocationId} in Yagna Payment API
  • [OPTIONAL] see to the feature being implemented in SDK

Additional Information:

Without Optional - probably 2-4 MD.

@cryptobench
Copy link
Member Author

Acceptance Criteria:

  • implement PUT /allocations/{allocationId} in Yagna Payment API
  • Extend Allocation Tests in Goth
  • [OPTIONAL] Extend our own testing tool to cover Allocation test case

Additional Information:

Without Optional - probably 2-4 MD.

Thank you for the reply. Sorry for not replying to the previous one - I forgot that. I consulted the workaround with the SDK and it was not trivial , so we do very much appreciate the effort Core puts into this PUT endpoint for allocations.

@golmek
Copy link
Contributor

golmek commented Sep 20, 2023

Moved tests to separate ticket: #2770
Marking Implementation as DONE

@golmek golmek changed the title Feature request: Implement PUT endpoint for allocations to adjust allocation on the go. Implement PUT endpoint for allocations to adjust allocation on the go. Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants