-
Notifications
You must be signed in to change notification settings - Fork 21
Feature/auto prep deal scheduling reopened #512
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
Merged
ianconsolata
merged 94 commits into
data-preservation-programs:main
from
anjor:feature/auto-prep-deal-scheduling-reopened
Jun 27, 2025
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
e9942a1
implement Connect to / Add Storage
anjor ca51c8e
Add auto-deal fields to Preparation model and integrate onboard command
anjor a676131
Update handlers for auto-deal integration
anjor 13dfdfd
Update dataset worker to trigger auto-deals on job completion
anjor 1e1f66a
Add documentation and demo materials
anjor b25e18b
Update README with comprehensive auto-deal documentation
anjor 7703ac4
Add missing auto-deal CLI flags to prep create command
anjor ae148e3
Fix auto-deal service interface compatibility
anjor 7d1decb
Add version.json file for Docker build
anjor 3b434aa
deal template
anjor 456e606
docs
anjor 06daa7a
gofmt
anjor 7bfdd9e
Update generated code and documentation for deal template functionality
anjor 1d03d89
Merge branch 'main' into feature/auto-prep-deal-scheduling-reopened
Sankara-Jefferson 855e9ba
fixes based on feedback
anjor 85912f8
more fixes
anjor fbd10ba
go fmt
anjor 780349e
Update generated documentation and client code for DealConfig struct
anjor 364b85b
Fix test failures after DealConfig refactoring
anjor e041d76
Address PR #512 feedback comments
anjor ba18d89
Add database migrations for notifications and deal templates
anjor 96795c4
gofmt
anjor 88f2af8
fix
anjor 1b0addb
fix lint
anjor 7615d91
fix tests
anjor 3261e77
gofmt
anjor af35568
fix import cycle
anjor 8807a08
fix go check
anjor ded3a96
fixes
anjor 1802b1f
fix
anjor d5bbc48
gofmt
anjor 22f0316
fix
anjor 01c625b
fixing ci
anjor 9cd9ca8
gofmt
anjor b8ecd31
fix
anjor 42d45df
fix lint
anjor c839811
fix test
anjor 5145d9e
fix
anjor 6313a72
lint
anjor 70a9bfe
fix downloadserver test error message assertion
anjor 83eb675
Fix DealTracker test failures
anjor 5e208db
fix
anjor b957b93
fix Windows test: ensure worker uptime is greater than 0
anjor 00f7320
fix ubuntu
anjor 3d3e754
Fix wallet import test error handling
anjor 2e2f0e8
Fix CID parsing tests by replacing invalid 'unrecoverable' strings wi…
anjor 4e9ae3b
fix
anjor 52e78e7
fix tests
anjor 5a454cd
fix flaky tests: use unique names and proper GORM associations
anjor ebf5955
gofmt
anjor 67fcae0
fix staticcheck CI issue: replace external workflow with local one
anjor 8aa9ee7
fix golangci-lint version mismatch: upgrade to v2
anjor 1e70c7b
fix golangci-lint action: upgrade to v7 for v2 support
anjor 7116309
fix golangci-lint: convert config to v1 format and use stable version
anjor 6003b32
fix golangci-lint config: use valid exclude-generated value
anjor 59319d1
fix golangci-lint config: remove invalid linters and settings
anjor 93e326f
fix golangci-lint issues: stylecheck, gosimple, and import formatting
anjor e55b647
fix
anjor 3631eef
fixes
anjor cbc4cf7
go mod tidy
anjor 9ccb1e2
progress
anjor 78889ae
fix
anjor 0949b86
merge conflicts
anjor e26fde8
go mod
anjor a5df2b3
fix golangci version
anjor 7cdacf9
fix
anjor 72a6611
fix linter config
anjor 9db5659
lint
anjor d5c39c4
moar linting
anjor 6021983
errcheck
anjor a7df380
errcheck
anjor 265c4e9
gofmt
anjor a1dc339
errcheck
anjor 260aa4e
gosec
anjor 47579fc
lint
anjor 10650ad
fixes
anjor e56f489
fix
anjor 0189d97
fixes
anjor 8dd1f7d
lint
anjor 17a3020
lint
anjor d94e6dc
fix
anjor 1bc7fcd
gofmt
anjor a1f564e
fox
anjor 45f0d8d
fix
anjor b8b6a27
gofmt
anjor d0ea77d
fix lint
anjor 222eec6
lint
anjor 6b92797
funcorder
anjor debfefb
fixing tests
anjor 9365c00
tests
anjor e50100a
gofmt
anjor 8eb71ee
lint
anjor 5df5c70
fix
anjor a7d5f49
fixes
anjor 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
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
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
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
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,287 @@ | ||
| # Auto-Prep Deal Scheduling Demo | ||
|
|
||
| This demo showcases the new **Auto-Prep Deal Scheduling** feature that provides complete data onboarding in a single command - from data source to storage deals. | ||
|
|
||
| ## Overview | ||
|
|
||
| The auto-prep deal scheduling feature eliminates manual intervention by providing: | ||
| - **Deal Templates**: Reusable deal configurations for consistent parameters | ||
| - **Unified Onboarding**: Complete data preparation with automated deal creation | ||
| - **Automatic Storage**: Creates storage connections automatically | ||
| - **Seamless Workflow**: Automatic progression from scanning to deal creation | ||
| - **Worker Management**: Built-in workers process jobs automatically | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ```bash | ||
| # Ensure Singularity is built with the latest changes | ||
| go build -o singularity | ||
|
|
||
| # No additional setup required - the onboard command manages everything automatically | ||
| ``` | ||
|
|
||
| ## Demo 1: Using Deal Templates (Recommended) | ||
|
|
||
| The most efficient way to onboard data with reusable deal configurations: | ||
|
|
||
| ```bash | ||
| # First, create a deal template (one-time setup) | ||
| ./singularity deal-template create \ | ||
| --name "standard-archive" \ | ||
| --description "Standard archival storage with 18-month retention" \ | ||
| --deal-price-per-gb 0.0000000001 \ | ||
| --deal-duration 535days \ | ||
| --deal-start-delay 72h \ | ||
| --deal-verified \ | ||
| --deal-keep-unsealed \ | ||
| --deal-announce-to-ipni \ | ||
| --deal-provider "f01234" | ||
|
|
||
| # Now onboard data using the template | ||
| ./singularity prep create \ | ||
| --name "my-dataset" \ | ||
| --source "/path/to/your/data" \ | ||
| --output "/path/to/output" \ | ||
| --auto-create-deals \ | ||
| --deal-template "standard-archive" \ | ||
| --auto-start \ | ||
| --auto-progress | ||
| ``` | ||
|
|
||
| ## Demo 2: Direct Parameters (No Template) | ||
|
|
||
| You can still specify deal parameters directly without using templates: | ||
|
|
||
| ```bash | ||
| # Complete onboarding with direct parameters | ||
| ./singularity prep create \ | ||
| --name "my-dataset" \ | ||
| --source "/path/to/your/data" \ | ||
| --output "/path/to/output" \ | ||
| --auto-create-deals \ | ||
| --deal-provider "f01234" \ | ||
| --deal-verified \ | ||
| --deal-price-per-gb 0.0000001 \ | ||
| --deal-duration 535days \ | ||
| --deal-start-delay 72h \ | ||
| --auto-start \ | ||
| --auto-progress | ||
| ``` | ||
|
|
||
| That's it! This single command will: | ||
| 1. ✅ Create source and output storage automatically | ||
| 2. ✅ Create preparation with auto-deal configuration | ||
| 3. ✅ Start managed workers to process jobs | ||
| 4. ✅ Begin scanning immediately | ||
| 5. ✅ Automatically progress through scan → pack → daggen → deals | ||
| 6. ✅ Monitor progress until completion | ||
|
|
||
| ## Demo Script | ||
|
|
||
| Here's a complete demo script showcasing both deal templates and direct parameters: | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| echo "=== Auto-Prep Deal Scheduling Demo with Templates ===" | ||
| echo | ||
|
|
||
| echo "📋 Step 1: Creating deal templates for reuse..." | ||
|
|
||
| # Create enterprise template | ||
| ./singularity deal-template create \ | ||
| --name "enterprise-tier" \ | ||
| --description "Enterprise-grade storage with 3-year retention" \ | ||
| --deal-duration 1095days \ | ||
| --deal-price-per-gb 0.0000000002 \ | ||
| --deal-verified \ | ||
| --deal-keep-unsealed \ | ||
| --deal-announce-to-ipni \ | ||
| --deal-start-delay 72h | ||
|
|
||
| # Create research template | ||
| ./singularity deal-template create \ | ||
| --name "research-archive" \ | ||
| --description "Long-term research data archive" \ | ||
| --deal-duration 1460days \ | ||
| --deal-price-per-gb 0.0000000001 \ | ||
| --deal-verified \ | ||
| --deal-keep-unsealed | ||
|
|
||
| echo "✅ Deal templates created!" | ||
| echo | ||
|
|
||
| # List templates | ||
| echo "📋 Available deal templates:" | ||
| ./singularity deal-template list | ||
| echo | ||
|
|
||
| echo "🚀 Step 2: Onboarding data using templates..." | ||
|
|
||
| # Create some demo data if needed (check if directories already exist) | ||
| if [ -d "./demo-data" ] && [ "$(ls -A ./demo-data)" ]; then | ||
| echo "Warning: ./demo-data directory already exists and contains files. Please remove or backup existing content before proceeding." | ||
| echo "Use: rm -rf ./demo-data ./demo-output" | ||
| exit 1 | ||
| fi | ||
| mkdir -p ./demo-data ./demo-output | ||
| echo "Sample file for enterprise demo" > ./demo-data/enterprise-data.txt | ||
| echo "Sample file for research demo" > ./demo-data/research-data.txt | ||
|
|
||
| echo "Creating enterprise dataset with template..." | ||
| ./singularity prep create \ | ||
| --name "enterprise-dataset" \ | ||
| --source "./demo-data" \ | ||
| --output "./demo-output" \ | ||
| --auto-create-deals \ | ||
| --deal-template "enterprise-tier" \ | ||
| --auto-start \ | ||
| --auto-progress | ||
|
|
||
| echo | ||
| echo "Creating research dataset with template override..." | ||
| ./singularity prep create \ | ||
| --name "research-dataset" \ | ||
| --source "./demo-data" \ | ||
| --auto-create-deals \ | ||
| --deal-template "research-archive" \ | ||
| --deal-provider "f01000" \ | ||
| --auto-start \ | ||
| --auto-progress | ||
|
|
||
| echo | ||
| echo "🎉 Demo Complete!" | ||
| echo "✅ Deal templates created for reuse" | ||
| echo "✅ Multiple datasets prepared with consistent deal parameters" | ||
| echo "✅ Template values overridden when needed" | ||
| ``` | ||
|
|
||
| ## Deal Template Management | ||
|
|
||
| Manage your deal templates for reuse across projects: | ||
|
|
||
| ```bash | ||
| # List all templates | ||
| ./singularity deal-template list | ||
|
|
||
| # View template details | ||
| ./singularity deal-template get enterprise-tier | ||
|
|
||
| # Create additional templates for different use cases | ||
| ./singularity deal-template create \ | ||
| --name "budget-tier" \ | ||
| --description "Cost-effective storage for non-critical data" \ | ||
| --deal-duration 365days \ | ||
| --deal-price-per-gb 0.00000000005 \ | ||
| --deal-start-delay 168h | ||
|
|
||
| # Delete templates when no longer needed | ||
| ./singularity deal-template delete old-template | ||
| ``` | ||
|
|
||
| ## Manual Monitoring | ||
|
|
||
| Monitor your preparations and deal creation: | ||
|
|
||
| ```bash | ||
| # Monitor preparation progress | ||
| ./singularity prep status my-dataset | ||
|
|
||
| # Check if deals were created | ||
| ./singularity deal schedule list | ||
|
|
||
| # View specific template details | ||
| ./singularity deal-template get enterprise-tier | ||
|
|
||
| # View schedules for this preparation via API | ||
| curl http://localhost:7005/api/preparation/my-dataset/schedules | ||
| ``` | ||
|
|
||
| ## Key Features Demonstrated | ||
|
|
||
| 1. **Deal Templates**: Reusable deal configurations for consistency across projects | ||
| 2. **Template Override**: Ability to override specific template values per preparation | ||
| 3. **Automatic Storage Creation**: Local storage connections created automatically | ||
| 4. **Integrated Auto-Progress**: Seamless flow from scanning to deal creation | ||
| 5. **Parameter Flexibility**: Choose between templates or direct parameter specification | ||
| 6. **Template Management**: Full CRUD operations for deal template lifecycle | ||
|
|
||
| ## Expected Output | ||
|
|
||
| When the demo completes successfully, you should see: | ||
| - ✅ Deal templates created and available for reuse | ||
| - ✅ Storage connections created automatically for each preparation | ||
| - ✅ Preparations created with auto-deal configuration from templates | ||
| - ✅ Template values applied with option to override specific parameters | ||
| - ✅ Progress updates showing scan → pack → daggen → deals | ||
| - ✅ Storage deals created using template configurations | ||
|
|
||
| ## Advanced Usage | ||
|
|
||
| ```bash | ||
| # Create multiple sources with template | ||
| ./singularity prep create \ | ||
| --name "multi-source-dataset" \ | ||
| --source "/path/to/source1" \ | ||
| --source "/path/to/source2" \ | ||
| --output "/path/to/output" \ | ||
| --auto-create-deals \ | ||
| --deal-template "enterprise-tier" \ | ||
| --wallet-validation \ | ||
| --sp-validation \ | ||
| --auto-start \ | ||
| --auto-progress | ||
|
|
||
| # Preparation without automatic deal creation | ||
| ./singularity prep create \ | ||
| --name "prep-only-dataset" \ | ||
| --source "/path/to/data" \ | ||
| --auto-start \ | ||
| --auto-progress | ||
|
|
||
| # Override template with custom parameters | ||
| ./singularity prep create \ | ||
| --name "custom-deals-dataset" \ | ||
| --source "/path/to/data" \ | ||
| --auto-create-deals \ | ||
| --deal-template "research-archive" \ | ||
| --deal-provider "f01000" \ | ||
| --deal-verified=false \ | ||
| --deal-price-per-gb 0.0000000005 | ||
|
|
||
| # Multiple templates for different tiers | ||
| ./singularity deal-template create --name "hot-storage" --deal-duration 180days --deal-price-per-gb 0.0000000005 | ||
| ./singularity deal-template create --name "cold-archive" --deal-duration 1460days --deal-price-per-gb 0.0000000001 | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ```bash | ||
| # Check preparation status | ||
| ./singularity prep status <preparation-name> | ||
|
|
||
| # List all deal schedules | ||
| ./singularity deal schedule list | ||
|
|
||
| # View available deal templates | ||
| ./singularity deal-template list | ||
|
|
||
| # Check specific template configuration | ||
| ./singularity deal-template get <template-name> | ||
|
|
||
| # Check worker status (if using separate terminals) | ||
| ./singularity run unified --dry-run | ||
| ``` | ||
|
|
||
| ## Benefits of Deal Templates | ||
|
|
||
| This approach offers several advantages over manual parameter specification: | ||
|
|
||
| 1. **Consistency**: Ensure all datasets use the same deal parameters | ||
| 2. **Reusability**: Create templates once, use across multiple projects | ||
| 3. **Organization**: Maintain different templates for different data tiers | ||
| 4. **Simplification**: Reduce complex command-line arguments to simple template names | ||
| 5. **Flexibility**: Override specific parameters when needed while keeping template defaults | ||
| 6. **Maintenance**: Update deal parameters organization-wide by modifying templates | ||
|
|
||
| This streamlined approach with deal templates reduces what used to be a complex multi-step process into a standardized, reusable workflow, making large-scale data onboarding to Filecoin much simpler and more accessible. | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.