mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
formatting
This commit is contained in:
parent
8c95107bbe
commit
074321b323
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
@ -1,8 +1,8 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: npm
|
- package-ecosystem: npm
|
||||||
directory: "/"
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: weekly
|
interval: weekly
|
||||||
time: '03:00'
|
time: '03:00'
|
||||||
timezone: Europe/Berlin
|
timezone: Europe/Berlin
|
||||||
|
@ -5,16 +5,14 @@ slug: /concepts/compute-to-data/
|
|||||||
section: concepts
|
section: concepts
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
The most basic scenario for a Publisher is to provide access to the datasets they own or manage.
|
The most basic scenario for a Publisher is to provide access to the datasets they own or manage.
|
||||||
In addition to that, a Publisher could offer a service to execute some computation on top of their data. This has some benefits:
|
In addition to that, a Publisher could offer a service to execute some computation on top of their data. This has some benefits:
|
||||||
|
|
||||||
- The data **never** leaves the Publisher enclave.
|
- The data **never** leaves the Publisher enclave.
|
||||||
- It's not necessary to move the data; the algorithm is sent to the data.
|
- It's not necessary to move the data; the algorithm is sent to the data.
|
||||||
- Having only one copy of the data and not moving it makes it easier to be compliant with data protection regulations.
|
- Having only one copy of the data and not moving it makes it easier to be compliant with data protection regulations.
|
||||||
|
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
@ -40,8 +38,8 @@ Because of these credentials, the execution of Brizo **SHOULD NOT** be delegated
|
|||||||
|
|
||||||
### Compute-to-Data Enviroment (Operator-Service)
|
### Compute-to-Data Enviroment (Operator-Service)
|
||||||
|
|
||||||
The Operator Service is a micro-service implementing part of the Ocean Protocol
|
The Operator Service is a micro-service implementing part of the Ocean Protocol
|
||||||
[Compute to the Data OEP-12](https://github.com/oceanprotocol/OEPs/tree/master/12),
|
[Compute to the Data OEP-12](https://github.com/oceanprotocol/OEPs/tree/master/12),
|
||||||
in charge of managing the workflow executing requests.
|
in charge of managing the workflow executing requests.
|
||||||
|
|
||||||
Typically the Operator Service is integrated from the [Brizo proxy](https://github.com/oceanprotocol/brizo),
|
Typically the Operator Service is integrated from the [Brizo proxy](https://github.com/oceanprotocol/brizo),
|
||||||
@ -56,7 +54,6 @@ The Operator Service is in charge of stablishing the communication with the K8s
|
|||||||
|
|
||||||
The Operator Service doesn't provide any storage capability, all the state is stored directly in the K8s cluster.
|
The Operator Service doesn't provide any storage capability, all the state is stored directly in the K8s cluster.
|
||||||
|
|
||||||
|
|
||||||
<repo name="operator-service"></repo>
|
<repo name="operator-service"></repo>
|
||||||
|
|
||||||
### Responsibilities
|
### Responsibilities
|
||||||
@ -70,7 +67,6 @@ The main responsibilities are:
|
|||||||
- Retrieve the logs generated during executions.
|
- Retrieve the logs generated during executions.
|
||||||
- Register newly-derived assets arising from the executions (i.e. as new Ocean assets) (if required by the consumer).
|
- Register newly-derived assets arising from the executions (i.e. as new Ocean assets) (if required by the consumer).
|
||||||
|
|
||||||
|
|
||||||
### Flow
|
### Flow
|
||||||
|
|
||||||
![Sequence Diagram for computing services](images/4_Starting_New_Compute_Job.png)
|
![Sequence Diagram for computing services](images/4_Starting_New_Compute_Job.png)
|
||||||
@ -87,4 +83,3 @@ Before the flow can begin, the following pre-conditions must be met:
|
|||||||
- The Asset DDO has a compute service.
|
- The Asset DDO has a compute service.
|
||||||
- The Asset DDO must specify the Brizo endpoint exposed by the Publisher.
|
- The Asset DDO must specify the Brizo endpoint exposed by the Publisher.
|
||||||
- The Service Agreement template must already be predefined and whitelisted `on-chain`.
|
- The Service Agreement template must already be predefined and whitelisted `on-chain`.
|
||||||
|
|
||||||
|
@ -64,6 +64,5 @@ A local testnet similar to Spree but launched by using the `--local-ganache-node
|
|||||||
|
|
||||||
> You shouldn't use a Ganache-Based Testnet unless you know why you're doing so. For example, a Ganache-based testnet can be used to test some smart contracts, but it can't be used with a Secret Store.
|
> You shouldn't use a Ganache-Based Testnet unless you know why you're doing so. For example, a Ganache-based testnet can be used to test some smart contracts, but it can't be used with a Secret Store.
|
||||||
|
|
||||||
|
|
||||||
[^1]: Formerly called Ocean Protocol Testnet v0.1, it was announced as part of the Plankton milestone.
|
[^1]: Formerly called Ocean Protocol Testnet v0.1, it was announced as part of the Plankton milestone.
|
||||||
[^2]: Also known as the Nile Beta Network. Formerly called the Ocean POA Testnet.
|
[^2]: Also known as the Nile Beta Network. Formerly called the Ocean POA Testnet.
|
||||||
|
@ -35,15 +35,14 @@ GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583
|
|||||||
|
|
||||||
## Final Result
|
## Final Result
|
||||||
|
|
||||||
Now that we have all the requirements, we need a function to handle it.
|
Now that we have all the requirements, we need a function to handle it.
|
||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 58-89,92-94 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 58-89,92-94 GITHUB-EMBED
|
||||||
|
|
||||||
|
|
||||||
The last thing we need is a button to start our compute job:
|
The last thing we need is a button to start our compute job:
|
||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 202-207 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 202-207 GITHUB-EMBED
|
||||||
|
|
||||||
** Notice that the button will be disabled if there were no previous published Datasets and Algorithms.
|
\*\* Notice that the button will be disabled if there were no previous published Datasets and Algorithms.
|
||||||
|
|
||||||
**Move on to [Get Status of a Compute Job](react-compute-status).**
|
**Move on to [Get Status of a Compute Job](react-compute-status).**
|
||||||
|
@ -29,7 +29,6 @@ and them import it to our Compute.js:
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 4 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 4 GITHUB-EMBED
|
||||||
|
|
||||||
|
|
||||||
## Define Compute Output
|
## Define Compute Output
|
||||||
|
|
||||||
Let's define some options for our upcoming job:
|
Let's define some options for our upcoming job:
|
||||||
@ -60,6 +59,6 @@ The last thing we need is a button inside the `render()` function:
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 208-211 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 208-211 GITHUB-EMBED
|
||||||
|
|
||||||
** Notice that the button will be disabled if there were no previous published Datasets.
|
\*\* Notice that the button will be disabled if there were no previous published Datasets.
|
||||||
|
|
||||||
**Move on to [Get Status of a Compute Job](react-compute-status).**
|
**Move on to [Get Status of a Compute Job](react-compute-status).**
|
||||||
|
@ -29,4 +29,4 @@ and have a button for it:
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 223 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 223 GITHUB-EMBED
|
||||||
|
|
||||||
** Notice that the button will be disabled if jobId is missing.
|
\*\* Notice that the button will be disabled if jobId is missing.
|
||||||
|
@ -15,13 +15,13 @@ Open `src/Compute.js` from your `marketplace/` folder.
|
|||||||
|
|
||||||
First, let's add the [asset](/concepts/terminology/#asset-or-data-asset) that we want to publish.
|
First, let's add the [asset](/concepts/terminology/#asset-or-data-asset) that we want to publish.
|
||||||
|
|
||||||
To do that, we need to define the Algorithm asset based on the [OEP-08](https://github.com/oceanprotocol/OEPs/tree/master/8) metadata structure. An algorithm asset can have multiple `files` attached to it and each file's `url` value will be encrypted during the publish process.
|
To do that, we need to define the Algorithm asset based on the [OEP-08](https://github.com/oceanprotocol/OEPs/tree/master/8) metadata structure. An algorithm asset can have multiple `files` attached to it and each file's `url` value will be encrypted during the publish process.
|
||||||
|
|
||||||
Let's create a new file `src/asset-compute.js` and fill it with:
|
Let's create a new file `src/asset-compute.js` and fill it with:
|
||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/asset-compute.js jsx 1-33 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/asset-compute.js jsx 1-33 GITHUB-EMBED
|
||||||
|
|
||||||
** Notice the “ALGO” macro in the entrypoint attribute, this is replaced with the downloaded executable algorithm inside the pod
|
\*\* Notice the “ALGO” macro in the entrypoint attribute, this is replaced with the downloaded executable algorithm inside the pod
|
||||||
|
|
||||||
Then import this asset definition at the top of `src/Compute.js`:
|
Then import this asset definition at the top of `src/Compute.js`:
|
||||||
|
|
||||||
@ -37,5 +37,4 @@ The last thing we need is a button to start our registration inside the `render(
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 153 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 153 GITHUB-EMBED
|
||||||
|
|
||||||
|
|
||||||
**Move on to [Compute using a published algorithm on a Data Set](/tutorials/react-compute-published-algorithm/).**
|
**Move on to [Compute using a published algorithm on a Data Set](/tutorials/react-compute-published-algorithm/).**
|
||||||
|
@ -19,7 +19,6 @@ This is achiveable by adding a 'compute' service to the DDO:
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 23-27 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 23-27 GITHUB-EMBED
|
||||||
|
|
||||||
|
|
||||||
## Handle Asset Publishing
|
## Handle Asset Publishing
|
||||||
|
|
||||||
Note that ocean.assets.create will define an 'access' service if the services list is missing. Since we are providing this attribute, our asset will have only a 'compute' service and no 'access' service.
|
Note that ocean.assets.create will define an 'access' service if the services list is missing. Since we are providing this attribute, our asset will have only a 'compute' service and no 'access' service.
|
||||||
@ -30,5 +29,4 @@ The last thing we need is a button to start our registration inside the `render(
|
|||||||
|
|
||||||
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 143 GITHUB-EMBED
|
GITHUB-EMBED https://github.com/oceanprotocol/react-tutorial/blob/107d1fa7d0c583cc8042339f1f5090ff9ee0920b/src/Compute.js jsx 143 GITHUB-EMBED
|
||||||
|
|
||||||
|
|
||||||
**Move on to [Publish a Algorithm](/tutorials/react-publish-algorithm/).**
|
**Move on to [Publish a Algorithm](/tutorials/react-publish-algorithm/).**
|
||||||
|
Loading…
Reference in New Issue
Block a user