validate

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package submit permits the submission of a job to the DeepSquare Grid.

USAGE:

dps validate [command options] <job.yaml>

OPTIONS:

--sbatch.endpoint value  SBatch Service GraphQL endpoint. (default: "https://sbatch.deepsquare.run/graphql") [$SBATCH_ENDPOINT]

Index

Constants

This section is empty.

Variables

View Source
var Command = cli.Command{
	Name:      "validate",
	Usage:     "Quickly validate a job.",
	ArgsUsage: "<job.yaml>",
	Flags:     flags,
	Action: func(cCtx *cli.Context) error {
		if cCtx.NArg() < 1 {
			return errors.New("missing arguments")
		}
		jobPath := cCtx.Args().First()
		ctx := cCtx.Context
		client := sbatch.NewService(http.DefaultClient, sbatchEndpoint)
		dat, err := os.ReadFile(jobPath)
		if err != nil {
			return err
		}
		var job sbatch.Job
		if err := yaml.Unmarshal(dat, &job); err != nil {
			return err
		}
		_, err = client.Submit(ctx, &job)
		if err == nil {
			fmt.Println("valid")
		}
		return err
	},
}

Command is the validate subcommand used to submit jobs.

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