You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2024. It is now read-only.
Starting a discussion to capture initial thoughts for how project motion can depends on Singularity to achieve core functionality
Initialization
Project motion should setup environment variables correctly for Singularity
Database connection string
Dataset worker concurrency - default to nproc / 4
Lotus API - default to GLIF
HTTP Hostname - for distributing CAR file in boost deal proposal
Retry Policy parameters
Project motion should also setup port forwarding to expose the Singularity HTTP service for CAR download
Project motion should call Singularity API to
create a default dataset and default datasource
—inline-preparation - whether to export CAR files
—output-dir - for storing CAR files
—staging-dir - for storing uploaded files
—delete-after-export - whether to delete uploaded files after exporting to CAR files
—target-piece-size 32G|64G
—pad-piece - whether to pad the CAR file if it’s not full
—scan-interval - how often should the staging folder to be scanned
—max-wait — how long to wait before we pack a CAR file that is not full
POST /v0/data
There are two approaches for how POST works with Singularity
Approach One: Motion is responsible of managing the staging folder and tells Singularity when a new file is ready to grab. - that's the one I'm in favor of.
Less change in Singularity. The implementation of API spec resides in Project motion
Singularity current implementation delays CID calculation. If Motion needs the CID in /GET, it needs to make sure it’s calculated the same way (using same chunker/hasher)
How it works
Motion accepts the request, save it to staging folder and calls /dataset/push API with the file path. Motion manages lifecycle of the staging folder
Motion will handle the case where the blob already exist
Singularity returns itemID and and delays the preparation
Motion saves mapping of dataID ↔ Singularity ItemID
Motion can query the status of this item using the itemID
Motion forward the stream to Singularity and let Singularity manage the staging folder
Singularity can calculate CID while accepting the stream
How it works
Motion accepts the request and return necessary response header
Motion send the binary stream in the body(octet-stream) to Singularity /dataset/upload API (multipart-formdata)
Singularity saves the stream to a file in staging folder
Singularity calculates the CID while streaming
Singularity returns both CID and itemID
Singularity will also return whether the blob already exists
Motion saves mapping of dataID ↔ Singularity ItemID
Motion can query the status of this item using the itemID
GET /v0/data/{id}
With /POST approach 1, Motion owns the staging folder and the implementation of this API
With /POST approach 2, Motion will make a call to Singularity content provider service and return the file stream in the body.
GET /v0/data/{id}/status
Singularity already has everything in the database. How it works
Motion calls Singularity API GET /item/<item_id>/deals
Singularity returns all deals for this item
Motion converts it to the its own format and return
“LastVerified” is not there - need research on how to get it from lotus chain state
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Starting a discussion to capture initial thoughts for how project motion can depends on Singularity to achieve core functionality
Initialization
POST /v0/data
There are two approaches for how POST works with Singularity
GET /v0/data/{id}
With /POST approach 1, Motion owns the staging folder and the implementation of this API
With /POST approach 2, Motion will make a call to Singularity content provider service and return the file stream in the body.
GET /v0/data/{id}/status
Singularity already has everything in the database. How it works
Beta Was this translation helpful? Give feedback.
All reactions