diff --git a/README.md b/README.md index 7abd156..28ff1c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Ocean Protocol VSCode Extension -Run compute jobs on Ocean Protocol directly from VS Code. The extension automatically detects your active algorithm file and streamlines job submission, monitoring, and results retrieval. Simply open a python or javascript file and click **Start Compute Job**. +Run Compute-to-Data jobs on Ocean Protocol directly from VS Code. + +The extension streamlines project creation, job submission, monitoring, and results retrieval. + +Create a new project with built-in algorithm templates and dependencies, then click **Start FREE Compute Job**. ![Ocean Protocol VSCode Extension](./screenshots/main-screenshot.png) @@ -8,30 +12,35 @@ Run compute jobs on Ocean Protocol directly from VS Code. The extension automati ### πŸš€ One-Click Compute Jobs -Select your algorithm, choose a dataset, and run compute jobs with a single click. +Create new compute projects with automatic Dockerfile and dependencies setup. Choose between Python or JavaScript templates. + +### πŸ’° Free Compute Jobs + +Start with free compute jobs, then upgrade to paid compute for more power. ### πŸ“Š Real-Time Monitoring -Track job progress and view algorithm logs directly in VS Code. +Track job progress and view algorithm logs directly in VS Code's Output console. ### πŸ“ Automatic Results Handling -Results are automatically saved and opened when your job completes. +Results and logs are automatically saved in your project folder when your job completes. ## Getting Started 1. Install the extension from the VS Code Marketplace 2. Open the Ocean Protocol panel from the activity bar -3. Configure your compute settings: - - Node URL (pre-filled with default Ocean compute node) - - Optional private key for your wallet -4. Select your files: - - Algorithm file (JS or Python) - - Optional dataset file (JSON) - - Results folder location -5. Click **Start Compute Job** -6. Monitor the job status and logs in the output panel -7. Once completed, the results file will automatically open in VSCode +3. Create a new project folder: + - Choose a parent directory for your project + - Name your project (default: `new-compute-job`) + - Select your language: Python or JavaScript +4. Explore your project structure: + - Algorithm file (`.py` or `.js`) + - Dockerfile with environment setup + - Dependencies file (`requirements.txt` or `package.json`) +5. Click **Start FREE Compute Job** +6. Monitor job status and logs in the Output console +7. Check results and logs in your project's `results` folder ### Requirements @@ -41,33 +50,38 @@ VS Code 1.96.0 or higher The extension adds a dedicated Ocean Protocol section to the activity bar. Here you can: -- Configure compute settings (Ocean Node URL, Private Key). - Optionally select a dataset file. -- Choose a folder to store compute results. -- Start a compute job with the current algorithm file automatically detected. +- Create new project folders or select existing ones +- View compute resources under the Setup dropdown +- Configure compute settings (accessible via Configure Compute) +- Start free or paid compute jobs ### Starting a Compute Job -1. Navigate to the "Start Compute Job" section. -2. Ensure your active file is either a JavaScript or Python algorithm. -3. Optionally select a dataset file. -4. Choose a folder for saving results. -5. Click **Start Compute Job**. -6. Monitor the job status and logs in the output panel. -7. Once completed, the results file will automatically open in VSCode. +1. Create a new project folder or select an existing one +2. Review your algorithm, Dockerfile, and dependencies +3. Click **Start FREE Compute Job** (or upgrade to paid for more resources) +4. Monitor job status and logs in the Output console +5. Check results in your project folder under `results/` -## Optional Setup +## Advanced Setup -- Custom Compute Node: Enter your own node URL or use the default Ocean Protocol node -- Wallet Integration: Use auto-generated wallet or enter private key for your own wallet -- Custom Docker Images. If you need a custom environment with your own dependencies installed, you can use a custom docker image. Default is oceanprotocol/algo_dockers (Python) or node (JavaScript) -- Docker Tags: Specify version tags for your docker image (like python-branin or latest) -- Algorithm: The vscode extension automatically detects open JavaScript or Python files. Or alternatively you can specify the algorithm file manually here. -- Dataset: Optional JSON file for input data -- Results Folder: Where computation results will be saved +- **Custom Docker Image/Tag**: Use your own docker image and tag (only if no Dockerfile is provided in your project folder) +- **Auth Token**: Auto-generated when you configure your compute settings +- **Custom Compute Node**: Enter your own node URL or use the default Ocean Protocol node +- **Compute Resources**: Free compute uses minimal resources. View available resources under the Setup dropdown +- **Paid Compute**: Upgrade from free to paid compute for more computational power +- **Node Status Check**: Use the Check button under Setup dropdown to verify node availability ![Ocean Protocol VSCode Extension](./screenshots/setup-screenshot.png) +## Troubleshooting + +- **Job cannot start** β†’ Check node status (under Setup dropdown, press the Check button) +- **Job not running** β†’ Verify your Node URL in Configure Compute +- **Not enough funds** β†’ Use Configure Compute to adjust your settings or switch to free compute +- **General issues** β†’ Check extension logs in the Output console. Logs are also saved in your project folder under `logs/` + ## Development & Contributing Refer to the project structure and available scripts for local development. Contributions are always welcomeβ€”please check our guidelines in the repository. diff --git a/cheatsheet.md b/cheatsheet.md new file mode 100644 index 0000000..e4c2aee --- /dev/null +++ b/cheatsheet.md @@ -0,0 +1,74 @@ +# 🌊 Ocean Protocol VS Code Extension β€” User Cheatsheet + +Run **Compute-to-Data jobs** directly from VS Code. + +--- + +## βœ… Requirements + +- VS Code **v1.96.0 or higher** + +--- + +## πŸ“¦ Installation + +1. Install from [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=OceanProtocol.ocean-protocol-vscode-extension). +2. Open the **Ocean Protocol** panel (left Activity Bar). + +--- + +## ▢️ Run your first compute job + +1. Create a **new project folder**. +2. Pick a **parent directory** for your project. This is where your algo and compute results will be saved. +3. Find a name for your new project. Default is `new-compute-job`. +4. Pick your favorite language for your algorithm. At the moment, we support **Python** and **JavaScript**. +5. Explore your newly created project. It will have a `Dockerfile`, dependencies file and an algorithm. +6. Run your first compute job by clicking **Start FREE Compute Job**. +7. Watch logs & job status in the **Output console**. +8. When finished, results and logs will be saved in your project folder under the `results` folder. + +--- + +## ⚑ Tips + +- **Free compute** uses an environment with minimal resources. +- Resources are displayed under the **Setup** dropdown. +- Whenever you want to get more resources, you can upgrade to a paid compute job. +- Go to **Configure Compute** to change your compute settings. +- Logs & errors show up in the **Output console**. +- If no dockerfile is provided, you can use your own docker image and tag. + +--- + +## πŸ› οΈ Troubleshooting + +- ❌ Job cannot start β†’ check node status. (Under the **Setup** dropdown, press the **Check** button) +- ❌ Job not running β†’ check Node URL. +- ❌ Not enough funds β†’ use **Configure Compute** to change your compute settings. +- Always check **extension logs** in Output. Logs are also saved in your project folder under the `logs` folder. + +--- + +## πŸ“¦ Advanced Setup + +- Custom Docker image/tag. Only if no dockerfile is provided in your project folder. +- Auth Token. This is auto-generated once you configure your compute settings. + +--- + +## πŸ”„ Workflow Summary + +| Step | Action | +| ---- | ------------------------------------------------------------ | +| 1 | Create a new project folder / Select existing project folder | +| 2 | Click **Start Compute Job** | +| 3 | Monitor logs & job status | +| 4 | Check results in your project folder | + +--- + +## πŸ“š Resources + +- [Ocean Protocol Docs](https://docs.oceanprotocol.com/developers/vscode) +- [GitHub Repo](https://github.com/oceanprotocol/vscode-extension) diff --git a/screenshots/main-screenshot.png b/screenshots/main-screenshot.png index a22e212..7bfec2d 100644 Binary files a/screenshots/main-screenshot.png and b/screenshots/main-screenshot.png differ diff --git a/screenshots/setup-screenshot.png b/screenshots/setup-screenshot.png index 862774d..5ac127a 100644 Binary files a/screenshots/setup-screenshot.png and b/screenshots/setup-screenshot.png differ