Skip to content

Feature/paid-compute in cli#115

Merged
mariacarmina merged 72 commits intomainfrom
feature/paid-compute
Jun 6, 2025
Merged

Feature/paid-compute in cli#115
mariacarmina merged 72 commits intomainfrom
feature/paid-compute

Conversation

@mariacarmina
Copy link
Copy Markdown
Contributor

@mariacarmina mariacarmina commented May 21, 2025

Fixes #113 .

Changes proposed in this PR:

  • Create initializeCompute command and
  • refator computeStart command to support new signature from ocean.js
  • update ocean.js version to include paid compute

@mariacarmina mariacarmina self-assigned this May 21, 2025
Copy link
Copy Markdown
Contributor

@giurgiur99 giurgiur99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some questions here from me. Nice job.

Comment thread .github/workflows/ci.yml Outdated
Comment thread src/cli.ts Outdated
Comment thread src/cli.ts Outdated
Comment thread test/consumeFlow.test.ts
@bogdanfazakas
Copy link
Copy Markdown
Member

Do we really need to have initializecompute command ? as a user i consider it out of scope for the cli, and the purpose would be be to have just a startCompute cmd that would handle everything under the hood

Comment thread .github/workflows/ci.yml Outdated
@mariacarmina
Copy link
Copy Markdown
Contributor Author

Do we really need to have initializecompute command ? as a user i consider it out of scope for the cli, and the purpose would be be to have just a startCompute cmd that would handle everything under the hood

When we has the presentation of c2d paid flow, we agreed to have 2 methods, because initializeCompute returns the payment that needs to be processed by the end user and the end user needs to agree with the cost first and after trigger start compute.

Copy link
Copy Markdown
Contributor

@giurgiur99 giurgiur99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mariacarmina
Copy link
Copy Markdown
Contributor Author

Do we really need to have initializecompute command ? as a user i consider it out of scope for the cli, and the purpose would be be to have just a startCompute cmd that would handle everything under the hood

When we has the presentation of c2d paid flow, we agreed to have 2 methods, because initializeCompute returns the payment that needs to be processed by the end user and the end user needs to agree with the cost first and after trigger start compute.

Now startCompute includes initializeCompute logic and waits for user input regarding payment amount, there is additional option for accepting the payment without displaying the prompt to user.

@bogdanfazakas
Copy link
Copy Markdown
Member

bogdanfazakas commented Jun 5, 2025

Looks good overall, but before merge update the readme and command will be useful because for eg we have

Start Compute:

Positional:
npm run cli startCompute did1,did2 algoDid env1

but for eg maxJobDuration is required parameter and paymentToken etc
saw that in the help we have it updated but readme will be nice as well

startCompute [options] <datasetDids> <algoDid> <computeEnvId> <maxJobDuration> <paymentToken> <resources> Starts a compute job

Screenshot 2025-06-05 at 15 40 50

also maybe worth adding some hints from where you can get them from and what maxJobDuration means(seconds, miliseconds etc) where you cand find the paymentToken info (address, symbol what is needed) so users have a better UX.

@mariacarmina
Copy link
Copy Markdown
Contributor Author

Looks good overall, but before merge update the readme and command will be useful because for eg we have

Start Compute:

Positional:
npm run cli startCompute did1,did2 algoDid env1

but for eg maxJobDuration is required parameter and paymentToken etc saw that in the help we have it updated but readme will be nice as well

startCompute [options] <datasetDids> <algoDid> <computeEnvId> <maxJobDuration> <paymentToken> <resources> Starts a compute job

Screenshot 2025-06-05 at 15 40 50 also maybe worth adding some hints from where you can get them from and what maxJobDuration means(seconds, miliseconds etc) where you cand find the paymentToken info (address, symbol what is needed) so users have a better UX.

Sure, I can enhance the usage documentation, thanks for suggestion.

@mariacarmina
Copy link
Copy Markdown
Contributor Author

mariacarmina commented Jun 6, 2025

Looks good overall, but before merge update the readme and command will be useful because for eg we have

Start Compute:

Positional:
npm run cli startCompute did1,did2 algoDid env1

but for eg maxJobDuration is required parameter and paymentToken etc saw that in the help we have it updated but readme will be nice as well

startCompute [options] <datasetDids> <algoDid> <computeEnvId> <maxJobDuration> <paymentToken> <resources> Starts a compute job

Screenshot 2025-06-05 at 15 40 50 also maybe worth adding some hints from where you can get them from and what maxJobDuration means(seconds, miliseconds etc) where you cand find the paymentToken info (address, symbol what is needed) so users have a better UX.

Hello @bogdanfazakas, I updated the README with details about positional and named fields (how they can be retrieved and what kind of value needs to be set).
The error that you encountered is not a specific log in the code with that message and that message occurs to all commands.
Screenshot 2025-06-06 at 10 41 36
I recommend to have a dedicated issue for this enhancement for all the commands not only for startCompute and merge the current functionality. Please create an issue if the README does not cover the error logging requirements and ref this PR comments there for tracking.
Thank you!

@mariacarmina mariacarmina merged commit b41aadf into main Jun 6, 2025
3 checks passed
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.

Paid compute cli

3 participants