-
Notifications
You must be signed in to change notification settings - Fork 6
PRISM-928 - Document prism use case #109
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
Open
WashingtonKK
wants to merge
8
commits into
ultravioletrs:main
Choose a base branch
from
WashingtonKK:use-case
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1ce89d1
add prism use case
WashingtonKK 9208ae2
fix lint
WashingtonKK 98e564b
use placeholder ip
WashingtonKK 4ae2ed4
add alt text
WashingtonKK 8ccfad6
update use case docs
WashingtonKK f4d2f21
add images
WashingtonKK a413106
update docs
WashingtonKK 7bcd0ed
update docs
WashingtonKK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,211 @@ | ||
| # Multiparty Computation for COVID-19 Training | ||
|
||
|
|
||
| This document outlines a **real-world example** of using Prism to run a **secure multiparty computation (MPC)**. | ||
| In this scenario, multiple organizations contribute datasets to jointly run a **COVID-19 training algorithm** while keeping their data private. | ||
|
|
||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| In this example, we will: | ||
|
|
||
| 1. **Provision the Prism environment** — Set up the workspace, computation, billing, and roles. | ||
| 2. **Prepare and register assets** — Upload datasets and algorithms to Prism. | ||
| 3. **Create a CVM (Confidential Virtual Machine)** — Secure environment where computations are executed. | ||
| 4. **Run the computation** — Trigger the MPC process with all required inputs. | ||
| 5. **Consume the results** — Retrieve the computation output. | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Provision the System on Prism | ||
|
|
||
| Before running any computation: | ||
|
|
||
| 1. **Create a workspace** — A collaborative space for all computation participants. | ||
| 2. **Create a computation** — Defines the specific task to run (e.g., COVID-19 prediction). | ||
| 3. **Set up a billing account** — Required for usage tracking and payment. | ||
|
|
||
| 📖 **Reference:** See the [Getting Started guide](/docs/getting-started.md) for step-by-step instructions. | ||
|
|
||
| Once provisioned: | ||
|
|
||
| - All participating organizations **must** be registered on Prism. | ||
| - The computation owner sends **workspace invitations** to all parties so they can upload their datasets or algorithms. | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Creating & Provisioning the Computation | ||
|
|
||
| 1. **Create the computation** | ||
| - On the **Computations** page, click **New Computation**. | ||
| - Fill in the required fields in the modal form. | ||
|
|
||
|  | ||
|
|
||
| 2. **Initial state of a new computation** | ||
| - No assets, asset providers, or result consumers are linked yet. | ||
| - These must be **manually added by the computation admin**. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ### Computation Roles | ||
|
|
||
| Each computation has **default roles** (e.g., Admin, Asset Provider, Result Consumer). | ||
|
|
||
| - Members must be **assigned to roles** before the computation can run. | ||
| - Roles control **permissions** (who can upload datasets, run computations, view results, etc.). | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ### Preparing the Assets | ||
|
|
||
| 1. Prepare datasets following the guidelines in the | ||
| [AI Docs for COVID-19 testing](https://github.com/ultravioletrs/ai/tree/main/covid19#testing-with-cocos). | ||
|
|
||
| 2. Upload each dataset to Prism: | ||
| - Include the **file checksum** for verification. | ||
| - Associate it with the computation. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| A **fully provisioned computation** looks like this: | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ### Public & Private Keys | ||
|
|
||
| Before running the computation: | ||
|
|
||
| 1. Generate a **public/private key pair**. | ||
| 2. Upload the **public key** to Prism. | ||
| 3. Use the **private key** when uploading assets to the CVM. | ||
|
|
||
| This ensures assets are **securely transmitted**. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Create a CVM | ||
|
|
||
| **CVMs (Confidential Virtual Machines)** are secure execution environments where computations run. | ||
|
|
||
| 1. Navigate to the **CVMs** page. | ||
| 2. Click **New CVM** and fill in the required details. | ||
|
|
||
|  | ||
|
|
||
| 📖 **Reference:** See the [CVM documentation](/docs/cvms.md) for detailed setup instructions. | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Running the Computation | ||
|
|
||
| Once the CVM is **created** and **online**: | ||
|
|
||
| 1. Go to the **Computations** page. | ||
| 2. Click **Run** on your computation. | ||
| 3. In the modal, select the CVM you just created. | ||
|
|
||
|  | ||
|
|
||
| The computation will enter the **waiting** state until the algorithm and datasets are uploaded. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ### Set CVM Agent URL | ||
|
|
||
| Export the CVM’s gRPC endpoint so the CLI can communicate with it: | ||
|
|
||
| ```bash | ||
| export AGENT_GRPC_URL=192.0.2.1:6110 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Uploading Assets | ||
|
|
||
| Assets are uploaded using the [Cocos CLI](https://docs.cocos.ultraviolet.rs/cli). | ||
|
|
||
| --- | ||
|
|
||
| ### Upload the Algorithm | ||
|
|
||
| If your algorithm is in **Python** and has dependencies: | ||
|
|
||
| ```bash | ||
| export AGENT_GRPC_URL=192.0.2.1:6110 | ||
| ./build/cocos-cli algo ../ai/covid19/train.py ./private.pem \ | ||
| -a python \ | ||
| -r ../ai/covid19/requirements.txt | ||
| ``` | ||
|
|
||
| Result: | ||
|
|
||
|  | ||
|
|
||
| UI will update to show the transition from **Waiting for Algorithm** → **Waiting for Datasets**. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ### Upload the Datasets | ||
|
|
||
| Example: Uploading three COVID-19 datasets: | ||
|
|
||
| ```bash | ||
| ./build/cocos-cli data ../ai/covid19/datasets/h1.zip ./private.pem \ | ||
| && ./build/cocos-cli data ../ai/covid19/datasets/h2.zip ./private.pem \ | ||
| && ./build/cocos-cli data ../ai/covid19/datasets/h3.zip ./private.pem | ||
| ``` | ||
|
|
||
| Result: | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ## 6. Computation Execution | ||
|
|
||
| Once all assets are uploaded: | ||
|
|
||
| - Logs and events appear on the computation’s **UI page** in real-time. | ||
| - Progress updates are sent as the computation runs. | ||
|
|
||
|  | ||
|
|
||
| When finished: | ||
|
|
||
| - A **Completed** event appears. | ||
| - Results are ready for consumption. | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ## 7. Consuming the Results | ||
|
|
||
| Once computation completes: | ||
|
|
||
| - Authorized **Result Consumers** can obtain the results using the CLI. | ||
| - Results can only be consumed once. | ||
|
|
||
| ```bash | ||
| ./build/cocos-cli result ./private.pem | ||
| ``` | ||
|
|
||
| The response: | ||
|  | ||
|
|
||
| This also reflects on ui with an event to indicate the computation is complete: | ||
|
|
||
|  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,8 @@ const sidebars: SidebarsConfig = { | |
| 'logs_api_docs' | ||
| ] | ||
| }, | ||
| "billing" | ||
| "billing", | ||
| "use_case" | ||
| ], | ||
| }; | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be multiple parties to demonstrate the use case. here all data comes from one user