admin

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cli.Command{
	Name:  "init",
	Usage: "Initialize the database",
	Action: func(c *cli.Context) error {
		db, closer, err := database.OpenFromCLI(c)
		if err != nil {
			return err
		}
		defer closer.Close()
		return admin.InitHandler(c.Context, db)
	},
}
View Source
var MigrateDatasetCmd = &cli.Command{
	Name:  "migrate-dataset",
	Usage: "Migrate dataset from old singularity mongodb",
	Description: "Migrate datasets from singularity V1 to V2. Those steps include\n" +
		"  1. Create a new dataset in V2.\n" +
		"  2. Create a new datasource which is either an S3 path or local path.\n" +
		"  3. Create all folder structures and files in the new dataset.\n" +
		"Caveats:\n" +
		"  1. The created dataset won't be compatible with the new dataset worker.\n" +
		"     So do not attempt to resume a data preparation or push new files onto migrated dataset.\n" +
		"     You can make deals or browse the dataset without issues.\n" +
		"  2. The folder CID won't be generated or migrated due to the complexity",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "mongo-connection-string",
			Usage:   "MongoDB connection string",
			EnvVars: []string{"MONGO_CONNECTION_STRING"},
			Value:   "mongodb://localhost:27017",
		},
		&cli.BoolFlag{
			Name:  "skip-files",
			Usage: "Skip migrating details about files and folders. This will make the migration much faster. Useful if you only want to make deals.",
			Value: false,
		},
	},
	Action: migrate.MigrateDataset,
}
View Source
var MigrateScheduleCmd = &cli.Command{
	Name:  "migrate-schedule",
	Usage: "Migrate schedule from old singularity mongodb",
	Description: "Migrate schedules from singularity V1 to V2. Note that\n" +
		"  1. You must complete dataset migration first\n" +
		"  2. All new schedules will be created with status 'paused'\n" +
		"  3. The deal states will not be migrated over as it will be populated with deal tracker automatically\n" +
		"  4. --output-csv is no longer supported. We will provide a new tool in the future\n" +
		"  5. # of replicas is no longer supported as part of the schedule. We will make this a configurable policy in the future\n" +
		"  6. --force is no longer supported. We may add similar support to ignore all policy restrictions in the future\n" +
		"  7. --offline is no longer supported. It will be always offline deal for legacy market and online deal for boost market if URL template is configured",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "mongo-connection-string",
			Usage:   "MongoDB connection string",
			EnvVars: []string{"MONGO_CONNECTION_STRING"},
			Value:   "mongodb://localhost:27017",
		},
	},
	Action: migrate.MigrateSchedule,
}
View Source
var ResetCmd = &cli.Command{
	Name:  "reset",
	Usage: "Reset the database",
	Flags: []cli.Flag{cliutil.ReallyDotItFlag},
	Action: func(c *cli.Context) error {
		if err := cliutil.HandleReallyDoIt(c); err != nil {
			return err
		}
		db, closer, err := database.OpenFromCLI(c)
		if err != nil {
			return err
		}
		defer closer.Close()
		return admin.ResetHandler(c.Context, db)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL