oceanprotocol-archive / dev-ocean

🕶 Ocean Engineering Pages with documentation about Development, Application Lifecycle, DevOps
3 stars 2 forks source link

Output section - V2 - squid - compute #161

Open alexcos20 opened 4 years ago

alexcos20 commented 4 years ago

In the workflow schema that it's passed to the compute service is one section called output.

"output": { "brizoAddress": "0x4aaab179035dc57b35e2ce066919048686f82972", "brizoUrl": "https://brizo.marketplace.dev-ocean.com", "metadata": { "name": "Workflow output" }, "metadataUrl": "https://aquarius.marketplace.dev-ocean.com", "nodeUri": "https://nile.dev-ocean.com", "owner": "0xC41808BBef371AD5CFc76466dDF9dEe228d2BdAA", "publishAlgorithmLog": true, "publishOutput": true, "secretStoreUrl": "https://secret-store.nile.dev-ocean.com", "whitelist": [ "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e", "0xACBd138aBD70e2F00903268F3Db08f2D25677C9e" ] }

Here is the definition of the fields, as intended:

Squid should get that object from the user and autocomplete with current settings if any required value is missing (Ocean object has all the URI already, so they can be filled)

Pro:

Thoughts ?

kremalicious commented 4 years ago

so if I get this right this would mean that ocean.compute.start() should optionally accept an output object and passes that through to Brizo.

Fine for advanced users since there is room for a lot of confusion with all those values. So there always should be a default which ideally does not have to be set in squid-js. The output object should then be standardized somewhere, in OEP-12 or Squid API I guess.

Maybe should be like this:

"output": {
  "brizoAddress": "0x4aaab179035dc57b35e2ce066919048686f82972",
  "brizoUri": "https://brizo.marketplace.dev-ocean.com",
  "metadata": {
    "main": {
      "name": "Job output"
    },
    "additionalInformation": {
      "description": "Job output from my algorithm."
    }
  },
  "aquariusUri": "https://aquarius.marketplace.dev-ocean.com",
  "nodeUri": "https://nile.dev-ocean.com",
  "owner": "0xC41808BBef371AD5CFc76466dDF9dEe228d2BdAA",
  "publishAlgorithmLog": true,
  "publishOutput": true,
  "secretStoreUri": "https://secret-store.nile.dev-ocean.com",
  "whitelist": [
    "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
    "0xACBd138aBD70e2F00903268F3Db08f2D25677C9e"
  ]
}

and we need to define what's required and when stuff gets autofilled. E.g. for not publishing a result I would expect I have to do:

const output = {
  "publishOutput": false
}
const status = ocean.compute.start(account, agreementId, algoDid, undefined, output)

And then we probably don't want to autofill anything else?

alexcos20 commented 4 years ago

I agree with:

"metadata": {
    "main": {
      "name": "Job output"
    },
    "additionalInformation": {
      "description": "Job output from my algorithm."
    }
  },

this will give us more slack in setting the metadata of the result

alexcos20 commented 4 years ago

We can have it like this:

The rest are optional:

metadata
owner
whitelist
alexcos20 commented 4 years ago

Let's standardize the output object in Squid API , section compute.start.

kremalicious commented 4 years ago

like so: https://github.com/oceanprotocol/dev-ocean/pull/159/commits/52dfa68f566ad0051fb97a2549f538925e2b86b2

Still part of https://github.com/oceanprotocol/dev-ocean/pull/159

alexcos20 commented 4 years ago

what shoud be the default values for publishAlgorithmLog and publishOutput? It makes sense to have them both true and fill up the required URL with current this.config. states ?