Documentation
¶
Overview ¶
Package model holds the cluster and partition entities. The host a cluster is reached through, and the credentials for it, belong to the credentials vertical.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterPartition ¶
type ClusterPartition struct {
ID string `gorm:"column:partition_id;primaryKey;type:varchar(36)" json:"partitionId"`
// The owning side of this association is SlurmCluster.Partitions, which declares the
// cascade. Only the key is held here; a back-reference would produce a second,
// redundant foreign key on the same column.
ClusterID *string `gorm:"column:cluster_id;type:varchar(36);index" json:"clusterId,omitempty"`
Name string `gorm:"column:name;type:varchar(255);not null" json:"name"`
Description *string `gorm:"column:description;type:varchar(1024)" json:"description,omitempty"`
MaxRunTime *int32 `gorm:"column:max_run_time" json:"maxRunTime,omitempty"`
MaxNodes *int32 `gorm:"column:max_nodes" json:"maxNodes,omitempty"`
MaxProcessors *int32 `gorm:"column:max_processors" json:"maxProcessors,omitempty"`
MaxJobsInQueue *int32 `gorm:"column:max_jobs_in_queue" json:"maxJobsInQueue,omitempty"`
MaxMemory *int64 `gorm:"column:max_memory" json:"maxMemory,omitempty"`
CPUPerNode *int32 `gorm:"column:cpu_per_node" json:"cpuPerNode,omitempty"`
DefaultNodeCount *int32 `gorm:"column:default_node_count" json:"defaultNodeCount,omitempty"`
DefaultCPUCount *int32 `gorm:"column:default_cpu_count" json:"defaultCpuCount,omitempty"`
DefaultWalltime *int64 `gorm:"column:default_walltime" json:"defaultWalltime,omitempty"`
// Gres and Nodes are comma-separated lists, stored verbatim as in the Java model.
Gres *string `gorm:"column:gres;type:varchar(1024)" json:"gres,omitempty"`
Nodes *string `gorm:"column:nodes;type:varchar(4096)" json:"nodes,omitempty"`
IsDefaultQueue *bool `gorm:"column:is_default_queue" json:"isDefaultQueue,omitempty"`
IsCheckpointable *bool `gorm:"column:is_checkpointable" json:"isCheckpointable,omitempty"`
}
ClusterPartition is a Slurm partition (queue) on a SlurmCluster.
Every limit is nullable: an unset MaxNodes means "no declared limit", which is distinct from a limit of zero. Hence the pointers.
Java: org.apache.airavata.compute.model.ClusterPartitionEntity
func (*ClusterPartition) BeforeCreate ¶
func (p *ClusterPartition) BeforeCreate(*gorm.DB) error
BeforeCreate assigns a UUID when none was supplied.
func (ClusterPartition) TableName ¶
func (ClusterPartition) TableName() string
TableName returns the table backing ClusterPartition.
type SlurmCluster ¶
type SlurmCluster struct {
ID string `gorm:"column:slurm_cluster_id;primaryKey;type:varchar(36)" json:"slurmClusterId"`
ClusterName string `gorm:"column:cluster_name;type:varchar(255);not null" json:"clusterName"`
ClusterDescription *string `gorm:"column:cluster_description;type:varchar(1024)" json:"clusterDescription,omitempty"`
HeadnodeHost string `gorm:"column:headnode_host;type:varchar(255);not null" json:"headnodeHost"`
HeadnodePort int `gorm:"column:headnode_port;type:int;not null" json:"headnodePort"`
// SlurmHome is where Slurm is installed on this machine
SlurmHome *string `gorm:"column:slurm_home;type:varchar(1024)" json:"slurmHome,omitempty"`
// optional endpoint to configure additional data movement path
DataHost *string `gorm:"column:data_host;type:varchar(255)" json:"dataHost,omitempty"`
DataPort *int `gorm:"column:data_port;type:int" json:"dataPort,omitempty"`
// Partitions are owned by the cluster: created, replaced and deleted with it, and
// meaningless outside it. Note that the Java service deliberately never mutated
// this collection — it wrote through the partition repository instead, because
// touching an orphan-removing collection risks deleting unrelated rows. Go code
// should keep that discipline and treat this field as a read-side projection.
Partitions []ClusterPartition `gorm:"foreignKey:ClusterID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE" json:"partitions,omitempty"`
}
SlurmCluster is a Slurm cluster Airavata can submit to.
It describes the machine and nothing about who reaches it: the head node to submit through, an optional separate endpoint for data movement, and the partitions it is carved into. How a particular person logs in — under which account, with which key, beneath which work root — is a SlurmClusterConfig, so one registered cluster serves every user without the catalogue holding anyone's credentials.
func (*SlurmCluster) BeforeCreate ¶
func (c *SlurmCluster) BeforeCreate(*gorm.DB) error
BeforeCreate assigns a UUID when none was supplied.
func (SlurmCluster) TableName ¶
func (SlurmCluster) TableName() string
TableName returns the table backing SlurmCluster.
type SlurmClusterConfig ¶
type SlurmClusterConfig struct {
ID string `gorm:"column:slurm_cluster_config_id;primaryKey;type:varchar(36)" json:"slurmClusterConfigId"`
Name *string `gorm:"column:name;type:varchar(255)" json:"name,omitempty"`
Description *string `gorm:"column:description;type:varchar(1024)" json:"description,omitempty"`
SlurmClusterID string `gorm:"column:slurm_cluster_id;type:varchar(36);index" json:"slurmClusterId"`
SlurmCluster *SlurmCluster `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"slurmCluster,omitempty"`
LoginUser string `gorm:"column:login_user;type:varchar(255);not null" json:"loginUser"`
WorkRoot string `gorm:"column:work_root;type:varchar(1024);not null" json:"workRoot"`
SSHCredentialID *string `gorm:"column:ssh_credential_id;type:varchar(36);index" json:"sshCredentialId,omitempty"`
SSHCredential *cred.SSHCredential `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"sshCredential,omitempty"`
// OwnerID is named for its role because ownership, not mere reference, is what the
// authorisation checks read. RESTRICT: a user who still owns configs cannot be
// deleted out from under them.
OwnerID *string `gorm:"column:user_id;type:varchar(255);index" json:"ownerId,omitempty"`
Owner *iammodel.User `gorm:"references:ID;constraint:OnDelete:RESTRICT,OnUpdate:CASCADE" json:"-"`
}
SlurmClusterConfig is one way of logging in to a SlurmCluster: an account, a key, and the directory work is done beneath.
It belongs to whoever registered it, and everyone else reaches it through the sharing rows below — which is what lets a PI hand a team access to an allocation without handing over the key itself. Ownership is not transferable through the API: a run is launched against a config by id, so handing one over would silently hand over the identity every job on it submits as.
func (*SlurmClusterConfig) BeforeCreate ¶
func (c *SlurmClusterConfig) BeforeCreate(*gorm.DB) error
BeforeCreate assigns a UUID when none was supplied.
func (*SlurmClusterConfig) OwnedBy ¶
func (c *SlurmClusterConfig) OwnedBy(userID string) bool
OwnedBy reports whether userID owns this config. A config with no owner is owned by nobody, so it must not match the empty principal name.
func (SlurmClusterConfig) TableName ¶
func (SlurmClusterConfig) TableName() string
TableName returns the table backing SlurmClusterConfig.