Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ body:
description: What database backend are you using?
options:
- SQLite
- MySQL
- PostgreSQL
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ check-go:
@which go > /dev/null || (echo "Go is not installed. Please install Go." && exit 1)

install-lint-deps:
@which golangci-lint > /dev/null || (echo "Required golangci-lint not found. Installing it..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
@which golangci-lint > /dev/null || (echo "Required golangci-lint not found. Installing it..." && go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest)
@which staticcheck > /dev/null || (echo "Required staticcheck not found. Installing it..." && go install honnef.co/go/tools/cmd/staticcheck@latest)

install-test-deps:
Expand Down
4 changes: 2 additions & 2 deletions analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ var logger = log.Logger("analytics")

// Init initializes the global variables 'Instance' and 'Enabled' based on values stored in the database
// and environment variables respectively. The function uses the 'instance_id' key to fetch the 'Instance'
// value from the database. If the 'Instance' value is already set, the function returns early. If the environment
// variable 'SINGULARITY_ANALYTICS' is set to "0", 'Enabled' is set to false.
// value from the database. If the 'Instance' value is already set, the function returns early. Analytics are
// opt-in: unless the environment variable 'SINGULARITY_ANALYTICS' is set to "1", 'Enabled' is set to false.
//
// Parameters:
// - ctx: The context for managing timeouts and cancellation.
Expand Down
7 changes: 1 addition & 6 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,9 @@ var logger = logging.Logger("api")
//
// Parameters:
// - ctx: A context.Context used to control the server's lifecycle and propagate cancellation.
// - exitErr: A channel that receives the terminal error (or nil) once the server has shut down.
//
// Returns:
// - A slice of channels (service.Done) that signal when different parts of the service
// have completed their work. This includes:
// 1. The main echo server's completion.
// 2. The host's completion.
// 3. Completion of analytics event flushing.
// - A channel (service.Fail) that reports errors that occur while the server is running.
// - An error if there is an issue during the initialization phase, otherwise nil.
func (s *Server) Start(ctx context.Context, exitErr chan<- error) error {
err := analytics.Init(ctx, s.db)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/swagger/models/dataprep_create_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/swagger/models/deal_proposal.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/swagger/models/schedule_create_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/swagger/models/schedule_update_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/admin/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var InitCmd = &cli.Command{
Usage: "Name of the user or service that is running the Singularity for tracking and logging purpose",
},
},
Description: "This commands need to be run before running any singularity daemon or after any version upgrade",
Description: "This command needs to be run before running any singularity daemon or after any version upgrade",
Action: func(c *cli.Context) error {
db, closer, err := database.OpenFromCLI(c)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dataprep/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var CreateCmd = &cli.Command{
&cli.StringSliceFlag{
Name: "local-output",
Category: "Quick creation with local output paths",
Usage: "The local output path to be used for the preparation. This is a convenient flag that will create a output storage with the provided path",
Usage: "The local output path to be used for the preparation. This is a convenient flag that will create an output storage with the provided path",
},
&cli.StringFlag{
Name: "max-size",
Expand Down
2 changes: 1 addition & 1 deletion cmd/dataprep/daggen.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var PauseDagGenCmd = &cli.Command{
Name: "pause-daggen",
Usage: "Pause a DAG generation job",
Category: "Job Management",
ArgsUsage: "<preparation_id> <storage_name>",
ArgsUsage: "<preparation id|name> <storage id|name>",
Before: cliutil.CheckNArgs,
Action: func(c *cli.Context) error {
db, closer, err := database.OpenFromCLI(c)
Expand Down
4 changes: 2 additions & 2 deletions cmd/dataprep/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

var AttachOutputCmd = &cli.Command{
Name: "attach-output",
Usage: "Attach a output storage to a preparation",
Usage: "Attach an output storage to a preparation",
ArgsUsage: "<preparation id|name> <storage id|name>",
Category: "Preparation Management",
Before: cliutil.CheckNArgs,
Expand All @@ -31,7 +31,7 @@ var AttachOutputCmd = &cli.Command{

var DetachOutputCmd = &cli.Command{
Name: "detach-output",
Usage: "Detach a output storage to a preparation",
Usage: "Detach an output storage from a preparation",
ArgsUsage: "<preparation id|name> <storage id|name>",
Category: "Preparation Management",
Before: cliutil.CheckNArgs,
Expand Down
2 changes: 1 addition & 1 deletion cmd/dataprep/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var ListWalletsCmd = &cli.Command{

var DetachWalletCmd = &cli.Command{
Name: "detach-wallet",
Usage: "Detach a wallet to a preparation",
Usage: "Detach a wallet from a preparation",
ArgsUsage: "<preparation id|name> <wallet_id>",
Category: "Wallet Management",
Before: cliutil.CheckNArgs,
Expand Down
4 changes: 2 additions & 2 deletions cmd/deal/schedule/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ func scheduleCreateFlags(includeDealType bool) []cli.Flag {
Name: "max-pending-deal-size",
Category: "Restrictions",
Aliases: []string{"pending-size"},
Usage: "Max pending deal sizes overall for this request, i.e. 1000",
Usage: "Max pending deal sizes overall for this request, i.e. 100TiB",
DefaultText: "Unlimited",
Value: "0",
},
&cli.IntFlag{
Name: "max-pending-deal-number",
Category: "Restrictions",
Aliases: []string{"pending-number"},
Usage: "Max pending deal number overall for this request, i.e. 100TiB",
Usage: "Max pending deal number overall for this request, i.e. 1000",
DefaultText: "Unlimited",
},
&cli.StringSliceFlag{
Expand Down
4 changes: 2 additions & 2 deletions cmd/deal/schedule/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ var UpdateCmd = &cli.Command{
Name: "max-pending-deal-size",
Category: "Restrictions",
Aliases: []string{"pending-size"},
Usage: "Max pending deal sizes overall for this request, i.e. 1000",
Usage: "Max pending deal sizes overall for this request, i.e. 100TiB",
},
&cli.IntFlag{
Name: "max-pending-deal-number",
Category: "Restrictions",
Aliases: []string{"pending-number"},
Usage: "Max pending deal number overall for this request, i.e. 100TiB",
Usage: "Max pending deal number overall for this request, i.e. 1000",
},
&cli.StringSliceFlag{
Name: "allowed-piece-cid",
Expand Down
2 changes: 1 addition & 1 deletion cmd/deal/send-manual.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Notes:
&cli.Float64Flag{
Name: "price-per-gb",
Category: "Deal Proposal",
Usage: "Price in FIL per GiB",
Usage: "Price in FIL per GiB",
Value: 0,
},
&cli.Float64Flag{
Expand Down
4 changes: 2 additions & 2 deletions cmd/ez/prep.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ var PrepCmd = &cli.Command{
Before: cliutil.CheckNArgs,
ArgsUsage: "<path>",
Usage: "Prepare a dataset from a local path",
Description: "This commands can be used to prepare a dataset from a local path with minimum configurable parameters.\n" +
"For more advanced usage, please use the subcommands under `storage` and `data-prep`.\n" +
Description: "This command can be used to prepare a dataset from a local path with minimum configurable parameters.\n" +
"For more advanced usage, please use the subcommands under `storage` and `prep`.\n" +
"You can also use this command for benchmarking with in-memory database and inline preparation, i.e.\n" +
" mkdir dataset\n" +
" truncate -s 1024G dataset/1T.bin\n" +
Expand Down
3 changes: 1 addition & 2 deletions cmd/run/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ var APICmd = &cli.Command{
Action: func(c *cli.Context) error {
// run automigrate + legacy key check before handing off to api.Run,
// which opens its own db connection internally
db, closer, err := openAndMigrate(c)
_, closer, err := openAndMigrate(c)
if err != nil {
return err
}
closer.Close()
_ = db

return api.Run(c)
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/storage/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var HTTPClientConfigFlagsForUpdate = []cli.Flag{
},
&cli.StringSliceFlag{
Name: "client-header",
Usage: "Set HTTP header for all transactions (i.e. key=value). This will replace the existing header values. To remove a header, use --http-header \"key=\"\". To remove all headers, use --http-header \"\"",
Usage: "Set HTTP header for all transactions (i.e. key=value). This will replace the existing header values. To remove a header, use --client-header \"key=\"\". To remove all headers, use --client-header \"\"",
Category: "Client Config",
},
&cli.BoolFlag{
Expand Down
1 change: 1 addition & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var VersionCmd = &cli.Command{
buildInfo, ok := debug.ReadBuildInfo()
if !ok {
fmt.Println("unknown version")
return nil
}

version := buildInfo.Main.Version
Expand Down
6 changes: 3 additions & 3 deletions database/connstring.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func AddPragmaToSQLite(connString string) (string, error) {

qs := u.Query()
qs.Add("_pragma", "busy_timeout(50000)")
qs.Set("_pragma", "foreign_keys(1)")
qs.Add("_pragma", "foreign_keys(1)")
if strings.HasPrefix(connString, "file::memory:") {
qs.Set("_pragma", "journal_mode(MEMORY)")
qs.Add("_pragma", "journal_mode(MEMORY)")
qs.Set("mode", "memory")
qs.Set("cache", "shared")
} else {
qs.Set("_pragma", "journal_mode(WAL)")
qs.Add("_pragma", "journal_mode(WAL)")
}

u.RawQuery = qs.Encode()
Expand Down
5 changes: 1 addition & 4 deletions database/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,5 @@ func retryOn(err error) bool {
emsg := err.Error()
return strings.Contains(emsg, sqlSerializationFailure) ||
strings.Contains(emsg, "database is locked") ||
strings.Contains(emsg, "database table is locked") ||
// MySQL/InnoDB serialization conflict
strings.Contains(emsg, "Record has changed since last read") ||
strings.Contains(emsg, "Error 1020 (HY000)")
strings.Contains(emsg, "database table is locked")
}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "2.1"

services:
db:
image: postgres:15
Expand All @@ -22,6 +20,8 @@ services:
image: ghcr.io/data-preservation-programs/singularity:main
command: admin init
restart: on-failure # Restart only on failure
environment:
DATABASE_CONNECTION_STRING: postgres://postgres:postgres@db:5432/singularity
depends_on:
db:
condition: service_healthy
Expand Down
4 changes: 2 additions & 2 deletions docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Users will appreciate Singularity's ability to maintain dataset hierarchies. Fol

## Content Distribution

Beyond preparation, Singularity doubles as a nimble storage provider, eliminating traditional storage provider operations like sealing and proving. Users can effortlessly download either CAR files or original files from Singularity using a range of protocols, including Graphsync, HTTP, and Bitswap.
Beyond preparation, Singularity doubles as a nimble storage provider, eliminating traditional storage provider operations like sealing and proving. Users can effortlessly download either CAR files or original files from Singularity over HTTP (trustless gateway and piece retrieval).

### Efficient CAR Distribution

With inline preparation in play, storage providers can swiftly download CAR files from Singularity. It optimally streams the CAR file directly from the original data source. This streamlined process can also integrate with Boost market deals and is multi-threading compatible.

### Convenient Content Retrieval

For all prepared files, Singularity offers Graphsync/HTTP/Bitswap retrievals. This feature positions Singularity as an alternative to a traditional storage provider, bypassing the need for storage proofs.
For all prepared files, Singularity offers HTTP retrievals (trustless gateway and piece retrieval). This feature positions Singularity as an alternative to a traditional storage provider, bypassing the need for storage proofs.

## Deal Making

Expand Down
2 changes: 1 addition & 1 deletion docs/en/cli-reference/admin/init.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/en/cli-reference/deal/schedule/create-batch.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/en/cli-reference/deal/schedule/create.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/en/cli-reference/deal/schedule/update.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/en/cli-reference/deal/send-manual.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading