Documentation
¶
Index ¶
- func ApplyClusterPartitionRequest(dst *model.ClusterPartition, src *ClusterPartitionRequest)
- func ApplySlurmClusterConfigRequest(dst *model.SlurmClusterConfig, src *SlurmClusterConfigRequest)
- func ApplySlurmClusterRequest(dst *model.SlurmCluster, src *SlurmClusterRequest)
- type Allocation
- type AllocationDiscoveryResponse
- type ClusterPartitionRequest
- type ClusterPartitionResponse
- type PartitionDiscoveryRequest
- type PartitionDiscoveryResponse
- type SlurmClusterConfigRequest
- type SlurmClusterConfigResponse
- type SlurmClusterRequest
- type SlurmClusterResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyClusterPartitionRequest ¶
func ApplyClusterPartitionRequest(dst *model.ClusterPartition, src *ClusterPartitionRequest)
func ApplySlurmClusterConfigRequest ¶
func ApplySlurmClusterConfigRequest(dst *model.SlurmClusterConfig, src *SlurmClusterConfigRequest)
ApplySlurmClusterConfigRequest copies the mutable fields of a request onto an entity. The cluster and the key are resolved by the service, which is what turns an unknown id into a 404 rather than a dangling reference.
func ApplySlurmClusterRequest ¶
func ApplySlurmClusterRequest(dst *model.SlurmCluster, src *SlurmClusterRequest)
ApplySlurmClusterRequest copies the mutable fields of a request onto an entity. The id and the partitions are never written from a request: partitions are managed through their own endpoints, and overwriting the collection here would risk removing rows the caller never mentioned.
A create request's inline partitions are written by the service through the partition repository, one row at a time, for that same reason — this function stays out of the collection on every path.
Types ¶
type Allocation ¶
type Allocation struct {
Account string `json:"account"`
Description *string `json:"description"`
// Partitions the account is limited to; empty means any.
Partitions []string `json:"partitions"`
QOS []string `json:"qos"`
}
Allocation is one Slurm account a login may charge jobs to.
type AllocationDiscoveryResponse ¶
type AllocationDiscoveryResponse struct {
Allocations []Allocation `json:"allocations"`
}
AllocationDiscoveryResponse is what a cluster config's login may charge.
type ClusterPartitionRequest ¶
type ClusterPartitionRequest struct {
Name string `json:"name"`
Description *string `json:"description"`
MaxRunTime *int32 `json:"maxRunTime"`
MaxNodes *int32 `json:"maxNodes"`
MaxProcessors *int32 `json:"maxProcessors"`
MaxJobsInQueue *int32 `json:"maxJobsInQueue"`
MaxMemory *int64 `json:"maxMemory"`
CPUPerNode *int32 `json:"cpuPerNode"`
DefaultNodeCount *int32 `json:"defaultNodeCount"`
DefaultCPUCount *int32 `json:"defaultCpuCount"`
DefaultWalltime *int64 `json:"defaultWalltime"`
Gres *string `json:"gres"`
Nodes *string `json:"nodes"`
IsDefaultQueue *bool `json:"isDefaultQueue"`
IsCheckpointable *bool `json:"isCheckpointable"`
}
ClusterPartitionRequest is the create/update payload for a partition.
Java: org.apache.airavata.compute.dto.ClusterPartitionRequestDto
func (*ClusterPartitionRequest) Validate ¶
func (r *ClusterPartitionRequest) Validate() []httpx.FieldError
Validate implements httpx.Validator.
type ClusterPartitionResponse ¶
type ClusterPartitionResponse struct {
PartitionID string `json:"partitionId"`
ClusterID *string `json:"clusterId"`
Name string `json:"name"`
Description *string `json:"description"`
MaxRunTime *int32 `json:"maxRunTime"`
MaxNodes *int32 `json:"maxNodes"`
MaxProcessors *int32 `json:"maxProcessors"`
MaxJobsInQueue *int32 `json:"maxJobsInQueue"`
MaxMemory *int64 `json:"maxMemory"`
CPUPerNode *int32 `json:"cpuPerNode"`
DefaultNodeCount *int32 `json:"defaultNodeCount"`
DefaultCPUCount *int32 `json:"defaultCpuCount"`
DefaultWalltime *int64 `json:"defaultWalltime"`
Gres *string `json:"gres"`
Nodes *string `json:"nodes"`
IsDefaultQueue *bool `json:"isDefaultQueue"`
IsCheckpointable *bool `json:"isCheckpointable"`
}
ClusterPartitionResponse is the read model for a partition.
Java: org.apache.airavata.compute.dto.ClusterPartitionResponseDto
func ToClusterPartitionResponse ¶
func ToClusterPartitionResponse(p *model.ClusterPartition) ClusterPartitionResponse
type PartitionDiscoveryRequest ¶
type PartitionDiscoveryRequest struct {
HeadnodeHost string `json:"headnodeHost"`
HeadnodePort int `json:"headnodePort"`
SlurmHome *string `json:"slurmHome"`
LoginUser string `json:"loginUser"`
SSHCredentialID string `json:"sshCredentialId"`
}
PartitionDiscoveryRequest names a head node and the login to read its partitions under. It is the cluster's connection details plus a login, before the cluster is registered: discovery is what fills in the partitions of the registration.
func (*PartitionDiscoveryRequest) Validate ¶
func (r *PartitionDiscoveryRequest) Validate() []httpx.FieldError
Validate checks the request is complete enough to log in with.
type PartitionDiscoveryResponse ¶
type PartitionDiscoveryResponse struct {
Partitions []ClusterPartitionRequest `json:"partitions"`
}
PartitionDiscoveryResponse is the partitions found, ready to send back as the partitions of a SlurmClusterRequest.
type SlurmClusterConfigRequest ¶
type SlurmClusterConfigRequest struct {
Name *string `json:"name"`
Description *string `json:"description"`
SlurmClusterID string `json:"slurmClusterId"`
LoginUser string `json:"loginUser"`
WorkRoot string `json:"workRoot"`
SSHCredentialID string `json:"sshCredentialId"`
}
SlurmClusterConfigRequest is the create/update payload for a cluster login config.
There is no owner field: ownership comes from the access token and is immutable, so a config can neither be registered on someone else's behalf nor handed over by editing it.
func (*SlurmClusterConfigRequest) Validate ¶
func (r *SlurmClusterConfigRequest) Validate() []httpx.FieldError
Validate implements httpx.Validator.
type SlurmClusterConfigResponse ¶
type SlurmClusterConfigResponse struct {
SlurmClusterConfigID string `json:"slurmClusterConfigId"`
Name *string `json:"name"`
Description *string `json:"description"`
OwnerID *string `json:"ownerId"`
SlurmClusterID string `json:"slurmClusterId"`
SlurmCluster *SlurmClusterResponse `json:"slurmCluster"`
LoginUser string `json:"loginUser"`
WorkRoot string `json:"workRoot"`
SSHCredentialID *string `json:"sshCredentialId"`
SSHCredential *creddto.SSHCredentialResponse `json:"sshCredential"`
Permission *string `json:"permission,omitempty"`
}
SlurmClusterConfigResponse is the read model for a cluster login config.
The cluster is inlined because a config is only meaningful together with the machine it logs in to. The key is inlined as its safe summary — name and public key, never the private material, which the credential response type has no field for at all.
func ToSlurmClusterConfigResponse ¶
func ToSlurmClusterConfigResponse(c *model.SlurmClusterConfig) SlurmClusterConfigResponse
func ToSlurmClusterConfigResponseWith ¶
func ToSlurmClusterConfigResponseWith(c *model.SlurmClusterConfig, permission string) SlurmClusterConfigResponse
ToSlurmClusterConfigResponseWith is ToSlurmClusterConfigResponse with the caller's effective permission attached.
func ToSlurmClusterConfigResponses ¶
func ToSlurmClusterConfigResponses(in []model.SlurmClusterConfig) []SlurmClusterConfigResponse
type SlurmClusterRequest ¶
type SlurmClusterRequest struct {
ClusterName string `json:"clusterName"`
ClusterDescription *string `json:"clusterDescription"`
HeadnodeHost string `json:"headnodeHost"`
HeadnodePort int `json:"headnodePort"`
// SlurmHome is the install prefix the Slurm client commands are found under. A
// cluster that omits it runs them off the login shell's PATH.
SlurmHome *string `json:"slurmHome"`
// DataHost and DataPort are the optional separate endpoint for data movement. A
// cluster that names neither stages through its head node.
DataHost *string `json:"dataHost"`
DataPort *int `json:"dataPort"`
// Partitions are the partitions to carve the cluster into as it is registered, so
// a cluster whose layout is already known arrives complete rather than needing a
// follow-up call per partition.
//
// Accepted on create only. An update that carries them is rejected rather than
// obeyed: the set has no ids in it, so there would be nothing to match an incoming
// partition to an existing row by, and replacing the collection wholesale would
// delete partitions the caller never mentioned. Adding, changing and removing them
// afterwards is what /api/v1/slurm-clusters/{slurmClusterId}/partitions is for.
Partitions []ClusterPartitionRequest `json:"partitions"`
}
SlurmClusterRequest is the create/update payload for a cluster.
It describes the machine only. The account a job submits under, the key it presents and the directory it works beneath are a SlurmClusterConfig, so registering a cluster never puts anyone's credentials into the catalogue.
func (*SlurmClusterRequest) Validate ¶
func (r *SlurmClusterRequest) Validate() []httpx.FieldError
Validate implements httpx.Validator.
type SlurmClusterResponse ¶
type SlurmClusterResponse struct {
SlurmClusterID string `json:"slurmClusterId"`
ClusterName string `json:"clusterName"`
ClusterDescription *string `json:"clusterDescription"`
HeadnodeHost string `json:"headnodeHost"`
HeadnodePort int `json:"headnodePort"`
SlurmHome *string `json:"slurmHome"`
DataHost *string `json:"dataHost"`
DataPort *int `json:"dataPort"`
Partitions []ClusterPartitionResponse `json:"partitions"`
}
SlurmClusterResponse is the read model for a cluster.
func ToSlurmClusterResponse ¶
func ToSlurmClusterResponse(c *model.SlurmCluster) SlurmClusterResponse
func ToSlurmClusterResponses ¶
func ToSlurmClusterResponses(in []model.SlurmCluster) []SlurmClusterResponse