spanner

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 17 Imported by: 0

README ยถ

๐Ÿ”ง spanner ๐Ÿ”ง

spanner is a tool for easy job managment on HPC like referencing by name, logging, logging into nodes.

Works across Slurm and PBSPro.

Easy installation using Mamba

Install MambaForge on your cluster. In case you don't have internet access there, you can use mitten (https://github.com/unkaktus/mitten).

Then, install spanner itself:

mamba install -c https://mamba.unkaktus.art spanner

Installation using Go

  1. Install MambaForge on your cluster. In case you don't have internet access there, you can use mitten (https://github.com/unkaktus/mitten).

  2. Install Go

mamba install go
  1. Install spanner:
go install github.com/unkaktus/spanner/cmd/spanner@latest
  1. Add $HOME/go/bin into your $PATH into your .bashrc:
export PATH="$HOME/go/bin:$PATH"

Manual building

  1. Install Go (https://go.dev)

  2. Build spanner for Linux:

git clone https://github.com/unkaktus/spanner
cd spanner/cmd/spanner
env GOOS=linux GOARCH=amd64 go build
  1. scp the spanner binary to your favorite supercomp and add it to your $PATH.

Example uses

List jobs
$ spanner list
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚         NAME          โ”‚  STATE  โ”‚ QUEUE โ”‚          TIME           โ”‚ NODES โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Compare_Apples        โ”‚ R [0]   โ”‚ small โ”‚ [8%] 2h0m41s/24h0m0s    โ”‚     8 โ”‚
โ”‚ Compare_Oranges       โ”‚ Q [0]   โ”‚ small โ”‚ [0%] 0s/20h0m0s         โ”‚     2 โ”‚
โ”‚ Compare_Bananas       โ”‚ F [9]   โ”‚ small โ”‚ [0%] 0s/20h0m0s         โ”‚    16 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Logs

Open full logs in $EDITOR (defauts to vim):

$ spanner logs Compare_Apples

Follow the log tail of a job:

$ spanner logs -f Compare_Apples
Shell

To connect to the shell on the job nodes, you first need to start your job binary via spanner tent:

[mpirun -n 16] spanner tent ./exe/binary

Then, to connect to the shell of the node 1 of running job Compare_Apples:

$ spanner shell Compare_Apples 1
node123$
Stopping jobs

Cancel job Compare_Apples:

$ spanner cancel Compare_Apples
Portable jobs

Start a portable job using compare_apples.begin file and configuration file data.csv for the run:

$ spanner begin -f compare_apples.begin data.csv
Remote commands

Do all above without logging manually to the cluster:

$ spanner on supercomp list
$ spanner on supercomp shell compare_apples

This requires to have spanner to be installed and added to the PATH there.

Port forwarding

Forward a port to the node of a job:

$ spanner port-forward -p 11111 -m supercomp compare_apples

Documentation ยถ

Index ยถ

Constants ยถ

This section is empty.

Variables ยถ

This section is empty.

Functions ยถ

func Begin ยถ

func Begin(b BatchSystem, beginFilename, configFilename string, dryRun bool) error

func ListJobs ยถ

func ListJobs(bs BatchSystem, request ListRequest) error

func Logs ยถ

func Logs(b BatchSystem, jobName string, outputType string) error

func Logtail ยถ

func Logtail(b BatchSystem, jobName, outputType string, nLines int) error

func On ยถ

func On(machine string, cmdline []string) error

func PortForward ยถ

func PortForward(machine, jobName string, port, nodeID int) error

func Shell ยถ

func Shell(hostname string) error

func Tent ยถ

func Tent(bs BatchSystem, cmdline []string, mergeOutput, noCommand bool) (err error)

Types ยถ

type BatchSystem ยถ

type BatchSystem interface {
	ListJobs(all bool) ([]Job, error)
	Shell(jobName string, nodeID int) error
	Cancel(jobName string) error
	TentVariables() tent.Variables
	JobData(batchsystem.Job) (string, error)
	Submit(jobData string) error
}

type Job ยถ

type Job struct {
	Name              string
	ID                string
	Queue             string
	State             string
	ExitCode          int
	CreationTime      time.Time
	Nodes             []string
	NodeNumber        int
	CPUNumber         int
	CPUTime           time.Duration
	Walltime          time.Duration
	RequestedWalltime time.Duration
	OutputFile        string
	ErrorFile         string
	WorkingDirectory  string
}

func LatestJob ยถ

func LatestJob(bs BatchSystem) (*Job, error)

type ListRequest ยถ

type ListRequest struct {
	All             bool
	Full            bool
	MachineReadable bool
	State           string
}

Directories ยถ

Path Synopsis
pbs
cmd

Jump to

Keyboard shortcuts

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