Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9bbece7
Create initializeCompute command and refator computeStart command.
mariacarmina May 21, 2025
93bbf84
Fix config and imports from ocean.js in the commands.
mariacarmina May 23, 2025
3043d11
Added checks for escrow and porvider fees in compute start command.
mariacarmina May 26, 2025
24d6501
Make exports work.
mariacarmina May 26, 2025
1c0e8fe
Fix await.
mariacarmina May 26, 2025
2b0f78d
Fix asset and ddo types.
mariacarmina May 26, 2025
5ea1f32
Update publish script.
mariacarmina May 26, 2025
d7b6863
Update workflow to not use old c2d.
mariacarmina May 26, 2025
6b91e43
Added tests for compute environments and fix ci.
mariacarmina May 26, 2025
18b719e
Fix branch for node.
mariacarmina May 26, 2025
50f1796
Correct ci.
mariacarmina May 26, 2025
5d84cfb
Print ocean node logs.
mariacarmina May 26, 2025
b0de69f
Fix conflicts.
mariacarmina May 27, 2025
a73a418
Fix import.
mariacarmina May 27, 2025
d48b7e4
Added test for initialize and get compute envs.
mariacarmina May 28, 2025
99ae56e
Rename tests suit.
mariacarmina May 28, 2025
8bb7f35
Add test for start compute.
mariacarmina May 28, 2025
1dd07a0
Changed publish approach command.
mariacarmina May 28, 2025
f1e4007
Print ocean node logs in ci.
mariacarmina May 28, 2025
dd2df33
Update examples with indexedMetadata.
mariacarmina May 28, 2025
a88b036
Replace with runCommand.
mariacarmina May 28, 2025
6c18875
Increased timeout.
mariacarmina May 29, 2025
f239748
Debug logs for compute dataset.
mariacarmina May 29, 2025
018a8d6
Fix retrieval for did.
mariacarmina May 29, 2025
3d34f9e
Remove eval.
mariacarmina May 29, 2025
21dd3b3
Debug getDDO command.
mariacarmina May 29, 2025
f43f3ba
Updated test.
mariacarmina May 29, 2025
825d575
Updated test.
mariacarmina May 29, 2025
8dcd878
debug.
mariacarmina May 29, 2025
3a0a8f8
Trim response from get compute envs response.
mariacarmina May 29, 2025
a96a19d
Added validation for fields in initialize command and start compute. …
mariacarmina May 29, 2025
834f1db
Update setup and cli.
mariacarmina May 29, 2025
50c5768
Fix condition.
mariacarmina May 29, 2025
b023f27
Fix resources.
mariacarmina May 29, 2025
8b12f94
Modified config and updated test.
mariacarmina May 29, 2025
b0f2e28
Add logs in initialize.
mariacarmina May 29, 2025
8bf0fc2
Refactor condition.
mariacarmina May 29, 2025
e626fba
Fix stringified resources.
mariacarmina May 29, 2025
560a135
Update import.
mariacarmina May 29, 2025
73e4596
Fix envs.
mariacarmina May 29, 2025
593002c
Debug command initialize.
mariacarmina May 29, 2025
48fc3dc
Modified test.
mariacarmina May 29, 2025
89c5af0
stringify in program command.
mariacarmina May 29, 2025
8cf605b
Refactor parsing of initialize response.
mariacarmina May 29, 2025
046e3ec
Added missing parameter from startCompute.
mariacarmina May 29, 2025
40e2b69
Added one dash.
mariacarmina May 29, 2025
8906731
Fix envs reponse + missing parameters from command.
mariacarmina May 29, 2025
5d5f5d1
modified commands.
mariacarmina May 29, 2025
f441d97
Cleanup.
mariacarmina May 29, 2025
3f70d57
debug start compute command.
mariacarmina May 30, 2025
dd9cad5
Fix name for amountToDeposit.
mariacarmina May 30, 2025
31ef23c
Fix import between the test.
mariacarmina May 30, 2025
0005908
Created util for tests.
mariacarmina May 30, 2025
0dfb9a0
remove duplicate argument.
mariacarmina May 30, 2025
f6cfcd7
debug parsing initialize response.
mariacarmina May 30, 2025
6aea23c
Fix all tests, refactor code for startCompute. Added tests for comput…
mariacarmina May 31, 2025
1f155ba
Fix import.
mariacarmina May 31, 2025
7579a05
Cleanup + fix ci.
mariacarmina Jun 2, 2025
7536d31
Make agreement ID optional back.
mariacarmina Jun 2, 2025
59e1cda
Update ocean.js
mariacarmina Jun 2, 2025
eaee66c
Make amount to deposit optional.
mariacarmina Jun 2, 2025
2118d21
Incorporate initializeCommand in startCompute.
mariacarmina Jun 3, 2025
a6a1ab0
Updated logic for startCompute command.
mariacarmina Jun 3, 2025
1252a28
Fix condition. Updated test.
mariacarmina Jun 4, 2025
a40ddbe
Fix amount.
mariacarmina Jun 4, 2025
e6e7096
Fix print and lint.
mariacarmina Jun 4, 2025
2550695
Fix option.
mariacarmina Jun 4, 2025
950c492
Fix test.
mariacarmina Jun 4, 2025
47d55ef
Fix test.
mariacarmina Jun 4, 2025
e079cae
Fix setup test.
mariacarmina Jun 4, 2025
3a623de
Resolve conflicts.
mariacarmina Jun 5, 2025
f95d7f4
Fix README.
mariacarmina Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ jobs:
sleep 10
attempt=$((attempt + 1))
done

- name: docker logs
run: docker logs ocean-ocean-contracts-1 && docker logs ocean-ganache-1 && docker logs ocean-typesense-1
run: docker logs ocean_ocean-contracts_1 && docker logs ocean_typesense_1
if: ${{ failure() }}

- name: Run system tests
Expand All @@ -131,4 +132,9 @@ jobs:
INDEXING_RETRY_INTERVAL: 4000
INDEXING_MAX_RETRIES: 120
NODE_URL: 'http://127.0.0.1:8001'
AVOID_LOOP_RUN: true
AVOID_LOOP_RUN: true
- name: Print Ocean Node Logs if tests fail
if: ${{ failure() }}
run: |
echo "========== Ocean Node Logs =========="
tac ${{ github.workspace }}/ocean-node/ocean-node.log || echo "Log file not found"
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,19 @@ npm run cli <command> [options] <arguments>
**Start Compute:**

- **Positional:**
`npm run cli startCompute did1,did2 algoDid env1`
`npm run cli startCompute -- did1,did2 algoDid env1 maxJobDuration paymentToken resources --accept true`

- **Named Options:**
`npm run cli startCompute --datasets did1,did2 --algo algoDid --env env1`
`npm run cli startCompute --datasets did1,did2 --algo algoDid --env env1 --maxJobDuration maxJobDuration --token paymentToken --resources resources --accept true`
(Options can be provided in any order.)


- `maxJobDuration` is a required parameter an represents the time measured in seconds for job maximum execution, the payment is based on this maxJobDuration value, user needs to provide this.
- `paymentToken` is required and represents the address of the token that is supported by the environment for processing the compute job payment. It can be retrieved from `getComputeEnvironments` command output.
- `resources` is required and represents a stringified JSON object obtained from `getComputeEnvironments` command output. `getComputeEnvironments` command shows the available resources and the selected resources by the user need to be within the available limits.
e.g.: `'[{"id":"cpu","amount":3},{"id":"ram","amount":16772672536},{"id":"disk","amount":0}]'`
- `--accept` option can be set to `true` or `false`. If it is set to `false` a prompt will be displayed to the user for manual accepting the payment before starting a compute job. If it is set to `true`, the compute job starts automatically, without user input.

---

**Start Free Compute:**
Expand Down Expand Up @@ -291,6 +298,11 @@ npm run cli <command> [options] <arguments>
`-d, --datasets <datasetDids>`
`-a, --algo <algoDid>`
`-e, --env <computeEnvId>`
`--init <initializeResponse>`
`--maxJobDuration <maxJobDuration>`
`-t, --token <paymentToken>`
`--resources <resources>`
`--amountToDeposit <amountToDeposit>` (Id `''`, it will fallback to initialize compute payment amount.)

- **startFreeCompute:**
`-d, --datasets <datasetDids>`
Expand Down
46 changes: 23 additions & 23 deletions metadata/downloadAssetPaymentUSDC.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,32 @@
"timeout": 86400
}
],
"event": {
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [{
"orders": 0,
"token": "0xf08A50178dfcDe18524640EA6618a1f965821715",
"prices": [
{
"price": "2"
}
]
}]
},
"datatokens": [
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "2",
"tokenAddress": "0xf08A50178dfcDe18524640EA6618a1f965821715",
"tokenSymbol": "USDC"
}
},

"accessDetails": {
"baseToken": {
"address": "0xf08A50178dfcDe18524640EA6618a1f965821715",
Expand Down
40 changes: 25 additions & 15 deletions metadata/jsAlgo.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,30 @@
}
}
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "0"
}
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [
{
"orders": 0,
"prices": [
{
"price": "0"
}
]
}
],
"datatokens": []
}
}
40 changes: 25 additions & 15 deletions metadata/jsIPFSAlgo.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,30 @@
}
}
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "0"
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [
{
"orders": 0,
"prices": [
{
"price": "0"
}
]
}
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
}
],
"datatokens": []
}
}
40 changes: 25 additions & 15 deletions metadata/pythonAlgo.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,30 @@
"serviceEndpoint": "http://10.84.128.6:8001"
}
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "0"
}
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [
{
"orders": 0,
"prices": [
{
"price": "0"
}
]
}
],
"datatokens": []
}
}
47 changes: 25 additions & 22 deletions metadata/simpleComputeDataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,30 @@
}
}
],
"event": {
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"datatokens": [
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "0"
}
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [
{
"orders": 0,
"prices": [
{
"price": "0"
}
]
}
],
"datatokens": []
}
}
47 changes: 25 additions & 22 deletions metadata/simpleDownloadDataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,30 @@
"timeout": 86400
}
],
"event": {
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"datatokens": [
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "2"
}
"indexedMetadata": {
"event": {},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"stats": [
{
"orders": 0,
"prices": [
{
"price": "0"
}
]
}
],
"datatokens": []
}
}
Loading