-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbetacluster.go
More file actions
1788 lines (1636 loc) · 74.4 KB
/
Copy pathbetacluster.go
File metadata and controls
1788 lines (1636 loc) · 74.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package together
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"slices"
"time"
"github.com/togethercomputer/together-go/internal/apijson"
"github.com/togethercomputer/together-go/internal/apiquery"
"github.com/togethercomputer/together-go/internal/requestconfig"
"github.com/togethercomputer/together-go/option"
"github.com/togethercomputer/together-go/packages/param"
"github.com/togethercomputer/together-go/packages/respjson"
)
// BetaClusterService contains methods and other services that help with
// interacting with the together API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewBetaClusterService] method instead.
type BetaClusterService struct {
Options []option.RequestOption
Remediations BetaClusterRemediationService
Storage BetaClusterStorageService
}
// NewBetaClusterService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewBetaClusterService(opts ...option.RequestOption) (r BetaClusterService) {
r = BetaClusterService{}
r.Options = opts
r.Remediations = NewBetaClusterRemediationService(opts...)
r.Storage = NewBetaClusterStorageService(opts...)
return
}
// Create an Instant Cluster on Together's high-performance GPU clusters. With
// features like on-demand scaling, long-lived resizable high-bandwidth shared
// DC-local storage, Kubernetes and Slurm cluster flavors, a REST API, and
// Terraform support, you can run workloads flexibly without complex infrastructure
// management.
func (r *BetaClusterService) New(ctx context.Context, body BetaClusterNewParams, opts ...option.RequestOption) (res *Cluster, err error) {
opts = slices.Concat(r.Options, opts)
path := "compute/clusters"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return res, err
}
// Retrieve information about a specific GPU cluster.
func (r *BetaClusterService) Get(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *Cluster, err error) {
opts = slices.Concat(r.Options, opts)
if clusterID == "" {
err = errors.New("missing required cluster_id parameter")
return nil, err
}
path := fmt.Sprintf("compute/clusters/%s", clusterID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return res, err
}
// Update the configuration of an existing GPU cluster.
func (r *BetaClusterService) Update(ctx context.Context, clusterID string, body BetaClusterUpdateParams, opts ...option.RequestOption) (res *Cluster, err error) {
opts = slices.Concat(r.Options, opts)
if clusterID == "" {
err = errors.New("missing required cluster_id parameter")
return nil, err
}
path := fmt.Sprintf("compute/clusters/%s", clusterID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...)
return res, err
}
// List all GPU clusters.
func (r *BetaClusterService) List(ctx context.Context, query BetaClusterListParams, opts ...option.RequestOption) (res *BetaClusterListResponse, err error) {
opts = slices.Concat(r.Options, opts)
path := "compute/clusters"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
return res, err
}
// Delete a GPU cluster by cluster ID.
func (r *BetaClusterService) Delete(ctx context.Context, clusterID string, opts ...option.RequestOption) (res *BetaClusterDeleteResponse, err error) {
opts = slices.Concat(r.Options, opts)
if clusterID == "" {
err = errors.New("missing required cluster_id parameter")
return nil, err
}
path := fmt.Sprintf("compute/clusters/%s", clusterID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return res, err
}
// List regions and corresponding supported driver versions
func (r *BetaClusterService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *BetaClusterListRegionsResponse, err error) {
opts = slices.Concat(r.Options, opts)
path := "compute/regions"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return res, err
}
type Cluster struct {
// Enabled add-ons on this cluster. Only add-ons with enabled=true in their config
// are returned.
AddOns []ClusterAddOn `json:"add_ons" api:"required"`
// Actual number of preemptible GPUs currently allocated to the cluster. Updated
// asynchronously by the fulfillment and reclamation workers; may be less than
// desired_preemptible_gpus when capacity is constrained.
AllocatedPreemptibleGPUs int64 `json:"allocated_preemptible_gpus" api:"required"`
// Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).
//
// Any of "RESERVED", "ON_DEMAND", "SCHEDULED_CAPACITY".
BillingType ClusterBillingType `json:"billing_type" api:"required"`
ClusterID string `json:"cluster_id" api:"required"`
ClusterName string `json:"cluster_name" api:"required"`
// Type of cluster.
//
// Any of "KUBERNETES", "SLURM".
ClusterType ClusterClusterType `json:"cluster_type" api:"required"`
ControlPlaneNodes []ClusterControlPlaneNode `json:"control_plane_nodes" api:"required"`
CudaVersion string `json:"cuda_version" api:"required"`
// Customer's requested number of preemptible GPUs. Set on cluster create or
// update; persists until changed.
DesiredPreemptibleGPUs int64 `json:"desired_preemptible_gpus" api:"required"`
// Any of "H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM",
// "H100_SXM_INF".
GPUType ClusterGPUType `json:"gpu_type" api:"required"`
GPUWorkerNodes []ClusterGPUWorkerNode `json:"gpu_worker_nodes" api:"required"`
KubeConfig string `json:"kube_config" api:"required"`
// Number of GPUs to draw from a capacity pool. A component of the overall
// num_gpus, alongside num_reserved_gpus.
NumCapacityPoolGPUs int64 `json:"num_capacity_pool_gpus" api:"required"`
// Number of CPU-only worker nodes in the cluster.
NumCPUWorkers int64 `json:"num_cpu_workers" api:"required"`
NumGPUs int64 `json:"num_gpus" api:"required"`
// Number of prepaid reserved GPUs for this cluster. A component of the overall
// num_gpus, alongside num_capacity_pool_gpus.
NumReservedGPUs int64 `json:"num_reserved_gpus" api:"required"`
NvidiaDriverVersion string `json:"nvidia_driver_version" api:"required"`
// Cluster-level phase transition history.
PhaseTransitions []ClusterPhaseTransition `json:"phase_transitions" api:"required"`
ProjectID string `json:"project_id" api:"required"`
Region string `json:"region" api:"required"`
// Current status of the GPU cluster.
//
// Any of "WaitingForControlPlaneNodes", "WaitingForDataPlaneNodes",
// "WaitingForSubnet", "WaitingForSharedVolume", "InstallingDrivers",
// "RunningAcceptanceTests", "Paused", "OnDemandComputePaused", "Ready",
// "Degraded", "Deleting".
Status ClusterStatus `json:"status" api:"required"`
Volumes []ClusterVolume `json:"volumes" api:"required"`
CapacityPoolID string `json:"capacity_pool_id"`
ClusterConfig ClusterClusterConfig `json:"cluster_config"`
// Whether the control plane is currently ready.
ControlPlaneReady bool `json:"control_plane_ready"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
// GPU worker nodes retained after they left the live data plane. These are
// separate from gpu_worker_nodes and must not be counted as live capacity.
DeletedGPUWorkerNodes []ClusterDeletedGPUWorkerNode `json:"deleted_gpu_worker_nodes"`
DurationHours int64 `json:"duration_hours"`
// Timestamp when the cluster first reached the Ready phase.
FirstReadyAt time.Time `json:"first_ready_at" format:"date-time"`
InstallTraefik bool `json:"install_traefik"`
// Whether the cluster is managed inside a substrate environment.
IsInSubstrate bool `json:"is_in_substrate"`
// ID of the machine cluster backing this GPU cluster.
MachineClusterID string `json:"machine_cluster_id"`
// Recent node lifecycle events such as scale-up, scale-down, and preemption.
// Combine these with live and deleted node lists to render the cluster timeline.
NodeLifecycleEvents []ClusterNodeLifecycleEvent `json:"node_lifecycle_events"`
// Internal NVIDIA version ID for this cluster's driver and CUDA combination.
NvidiaDriverVersionID string `json:"nvidia_driver_version_id"`
OidcConfig ClusterOidcConfig `json:"oidc_config"`
// Data-volume image name for GPU worker nodes.
OsImage string `json:"os_image"`
ReservationEndTime time.Time `json:"reservation_end_time" format:"date-time"`
ReservationStartTime time.Time `json:"reservation_start_time" format:"date-time"`
SlurmShmSizeGib int64 `json:"slurm_shm_size_gib"`
// UMS organization ID associated with this cluster.
UmsOrgID string `json:"ums_org_id"`
// UMS project ID associated with this cluster.
UmsProjectID string `json:"ums_project_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AddOns respjson.Field
AllocatedPreemptibleGPUs respjson.Field
BillingType respjson.Field
ClusterID respjson.Field
ClusterName respjson.Field
ClusterType respjson.Field
ControlPlaneNodes respjson.Field
CudaVersion respjson.Field
DesiredPreemptibleGPUs respjson.Field
GPUType respjson.Field
GPUWorkerNodes respjson.Field
KubeConfig respjson.Field
NumCapacityPoolGPUs respjson.Field
NumCPUWorkers respjson.Field
NumGPUs respjson.Field
NumReservedGPUs respjson.Field
NvidiaDriverVersion respjson.Field
PhaseTransitions respjson.Field
ProjectID respjson.Field
Region respjson.Field
Status respjson.Field
Volumes respjson.Field
CapacityPoolID respjson.Field
ClusterConfig respjson.Field
ControlPlaneReady respjson.Field
CreatedAt respjson.Field
DeletedGPUWorkerNodes respjson.Field
DurationHours respjson.Field
FirstReadyAt respjson.Field
InstallTraefik respjson.Field
IsInSubstrate respjson.Field
MachineClusterID respjson.Field
NodeLifecycleEvents respjson.Field
NvidiaDriverVersionID respjson.Field
OidcConfig respjson.Field
OsImage respjson.Field
ReservationEndTime respjson.Field
ReservationStartTime respjson.Field
SlurmShmSizeGib respjson.Field
UmsOrgID respjson.Field
UmsProjectID respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r Cluster) RawJSON() string { return r.JSON.raw }
func (r *Cluster) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// AddOnInfo is returned in cluster responses and add-on CRUD operations.
type ClusterAddOn struct {
AddOnType string `json:"add_on_type" api:"required"`
// Configuration for a cluster add-on.
Config ClusterAddOnConfig `json:"config" api:"required"`
Name string `json:"name" api:"required"`
// State for a cluster add-on.
State ClusterAddOnState `json:"state" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AddOnType respjson.Field
Config respjson.Field
Name respjson.Field
State respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOn) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOn) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Configuration for a cluster add-on.
type ClusterAddOnConfig struct {
Dashboard ClusterAddOnConfigDashboard `json:"dashboard"`
// Configuration for the Headlamp Kubernetes dashboard add-on.
Headlamp ClusterAddOnConfigHeadlamp `json:"headlamp"`
Ingress ClusterAddOnConfigIngress `json:"ingress"`
// Configuration for the Slurm Web add-on.
SlurmWeb ClusterAddOnConfigSlurmWeb `json:"slurm_web"`
// Configuration for the Model Aware TorchPass add-on.
Torchpass ClusterAddOnConfigTorchpass `json:"torchpass"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dashboard respjson.Field
Headlamp respjson.Field
Ingress respjson.Field
SlurmWeb respjson.Field
Torchpass respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfig) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfig) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterAddOnConfigDashboard struct {
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfigDashboard) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfigDashboard) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Configuration for the Headlamp Kubernetes dashboard add-on.
type ClusterAddOnConfigHeadlamp struct {
// Whether to enable the Headlamp Kubernetes dashboard add-on.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfigHeadlamp) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfigHeadlamp) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterAddOnConfigIngress struct {
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfigIngress) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfigIngress) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Configuration for the Slurm Web add-on.
type ClusterAddOnConfigSlurmWeb struct {
// Whether to enable the Slurm Web add-on.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfigSlurmWeb) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfigSlurmWeb) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Configuration for the Model Aware TorchPass add-on.
type ClusterAddOnConfigTorchpass struct {
// Whether to enable the Model Aware TorchPass add-on.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnConfigTorchpass) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnConfigTorchpass) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// State for a cluster add-on.
type ClusterAddOnState struct {
Dashboard ClusterAddOnStateDashboard `json:"dashboard"`
// State for the Headlamp Kubernetes dashboard add-on.
Headlamp ClusterAddOnStateHeadlamp `json:"headlamp"`
Ingress ClusterAddOnStateIngress `json:"ingress"`
// State for the Slurm Web add-on.
SlurmWeb ClusterAddOnStateSlurmWeb `json:"slurm_web"`
// State for the Model Aware TorchPass add-on.
Torchpass ClusterAddOnStateTorchpass `json:"torchpass"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dashboard respjson.Field
Headlamp respjson.Field
Ingress respjson.Field
SlurmWeb respjson.Field
Torchpass respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnState) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnState) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterAddOnStateDashboard struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnStateDashboard) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnStateDashboard) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// State for the Headlamp Kubernetes dashboard add-on.
type ClusterAddOnStateHeadlamp struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnStateHeadlamp) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnStateHeadlamp) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterAddOnStateIngress struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnStateIngress) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnStateIngress) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// State for the Slurm Web add-on.
type ClusterAddOnStateSlurmWeb struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnStateSlurmWeb) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnStateSlurmWeb) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// State for the Model Aware TorchPass add-on.
type ClusterAddOnStateTorchpass struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterAddOnStateTorchpass) RawJSON() string { return r.JSON.raw }
func (r *ClusterAddOnStateTorchpass) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).
type ClusterBillingType string
const (
ClusterBillingTypeReserved ClusterBillingType = "RESERVED"
ClusterBillingTypeOnDemand ClusterBillingType = "ON_DEMAND"
ClusterBillingTypeScheduledCapacity ClusterBillingType = "SCHEDULED_CAPACITY"
)
// Type of cluster.
type ClusterClusterType string
const (
ClusterClusterTypeKubernetes ClusterClusterType = "KUBERNETES"
ClusterClusterTypeSlurm ClusterClusterType = "SLURM"
)
type ClusterControlPlaneNode struct {
HostName string `json:"host_name" api:"required"`
MemoryGib float64 `json:"memory_gib" api:"required"`
Network string `json:"network" api:"required"`
NodeID string `json:"node_id" api:"required"`
NumCPUCores int64 `json:"num_cpu_cores" api:"required"`
// Phase transition history for this control plane node.
PhaseTransitions []ClusterControlPlaneNodePhaseTransition `json:"phase_transitions" api:"required"`
Status string `json:"status" api:"required"`
// Public IPv4 address of the control plane node.
PublicIpv4 string `json:"public_ipv4"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HostName respjson.Field
MemoryGib respjson.Field
Network respjson.Field
NodeID respjson.Field
NumCPUCores respjson.Field
PhaseTransitions respjson.Field
Status respjson.Field
PublicIpv4 respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterControlPlaneNode) RawJSON() string { return r.JSON.raw }
func (r *ClusterControlPlaneNode) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterControlPlaneNodePhaseTransition struct {
// Node phase.
//
// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
Phase string `json:"phase" api:"required"`
// Timestamp when the phase transition occurred.
TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Phase respjson.Field
TransitionTime respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterControlPlaneNodePhaseTransition) RawJSON() string { return r.JSON.raw }
func (r *ClusterControlPlaneNodePhaseTransition) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterGPUType string
const (
ClusterGPUTypeH100Sxm ClusterGPUType = "H100_SXM"
ClusterGPUTypeH200Sxm ClusterGPUType = "H200_SXM"
ClusterGPUTypeRtx6000Pci ClusterGPUType = "RTX_6000_PCI"
ClusterGPUTypeL40Pcie ClusterGPUType = "L40_PCIE"
ClusterGPUTypeB200Sxm ClusterGPUType = "B200_SXM"
ClusterGPUTypeH100SxmInf ClusterGPUType = "H100_SXM_INF"
)
type ClusterGPUWorkerNode struct {
HostName string `json:"host_name" api:"required"`
MemoryGib float64 `json:"memory_gib" api:"required"`
Networks []string `json:"networks" api:"required"`
NodeID string `json:"node_id" api:"required"`
NumCPUCores int64 `json:"num_cpu_cores" api:"required"`
NumGPUs int64 `json:"num_gpus" api:"required"`
// Phase transition history for this GPU worker node.
PhaseTransitions []ClusterGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
Status string `json:"status" api:"required"`
// Whether auto-remediation is enabled for this node's instance.
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
// Timestamp when the node left the live data plane. Only set for
// deleted_gpu_worker_nodes.
DeletedAt time.Time `json:"deleted_at" format:"date-time"`
// Ephemeral storage size, such as 1Ti.
EphemeralStorage string `json:"ephemeral_storage"`
// Number of InfiniBand HCAs.
IbHcaCount int64 `json:"ib_hca_count"`
// InfiniBand HCA type.
IbHcaType string `json:"ib_hca_type"`
InstanceID string `json:"instance_id"`
// Remediation represents a node remediation request for an instance. An instance
// can have multiple remediations over time (e.g., failed attempts followed by
// retries).
LatestRemediation Remediation `json:"latest_remediation"`
// Whether this node is marked for deletion by the operator.
MarkedForDeletion bool `json:"marked_for_deletion"`
// Number of NVSwitches.
NvswitchCount int64 `json:"nvswitch_count"`
// NVSwitch type.
NvswitchType string `json:"nvswitch_type"`
// Public IPv4 address of the GPU worker node.
PublicIpv4 string `json:"public_ipv4"`
SlurmWorkerHostname string `json:"slurm_worker_hostname"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HostName respjson.Field
MemoryGib respjson.Field
Networks respjson.Field
NodeID respjson.Field
NumCPUCores respjson.Field
NumGPUs respjson.Field
PhaseTransitions respjson.Field
Status respjson.Field
AutoRemediationEnabled respjson.Field
DeletedAt respjson.Field
EphemeralStorage respjson.Field
IbHcaCount respjson.Field
IbHcaType respjson.Field
InstanceID respjson.Field
LatestRemediation respjson.Field
MarkedForDeletion respjson.Field
NvswitchCount respjson.Field
NvswitchType respjson.Field
PublicIpv4 respjson.Field
SlurmWorkerHostname respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterGPUWorkerNode) RawJSON() string { return r.JSON.raw }
func (r *ClusterGPUWorkerNode) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterGPUWorkerNodePhaseTransition struct {
// Node phase.
//
// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
Phase string `json:"phase" api:"required"`
// Timestamp when the phase transition occurred.
TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Phase respjson.Field
TransitionTime respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterGPUWorkerNodePhaseTransition) RawJSON() string { return r.JSON.raw }
func (r *ClusterGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterPhaseTransition struct {
// Cluster phase.
//
// Any of "CLUSTER_PHASE_QUEUED", "CLUSTER_PHASE_SCHEDULED",
// "CLUSTER_PHASE_WAITING_FOR_CONTROL_PLANE_NODES",
// "CLUSTER_PHASE_WAITING_FOR_DATA_PLANE_NODES",
// "CLUSTER_PHASE_WAITING_FOR_SUBNET", "CLUSTER_PHASE_WAITING_FOR_SHARED_VOLUME",
// "CLUSTER_PHASE_WAITING_FOR_AUTO_SCALER", "CLUSTER_PHASE_INSTALLING_DRIVERS",
// "CLUSTER_PHASE_RUNNING_ACCEPTANCE_TESTS",
// "CLUSTER_PHASE_ACCEPTANCE_TESTS_FAILED", "CLUSTER_PHASE_RUNNING_NCCL_TESTS",
// "CLUSTER_PHASE_NCCL_TESTS_FAILED", "CLUSTER_PHASE_READY",
// "CLUSTER_PHASE_PAUSED", "CLUSTER_PHASE_ON_DEMAND_COMPUTE_PAUSED",
// "CLUSTER_PHASE_DEGRADED", "CLUSTER_PHASE_DELETING".
Phase string `json:"phase" api:"required"`
// Timestamp when the phase transition occurred.
TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Phase respjson.Field
TransitionTime respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterPhaseTransition) RawJSON() string { return r.JSON.raw }
func (r *ClusterPhaseTransition) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Current status of the GPU cluster.
type ClusterStatus string
const (
ClusterStatusWaitingForControlPlaneNodes ClusterStatus = "WaitingForControlPlaneNodes"
ClusterStatusWaitingForDataPlaneNodes ClusterStatus = "WaitingForDataPlaneNodes"
ClusterStatusWaitingForSubnet ClusterStatus = "WaitingForSubnet"
ClusterStatusWaitingForSharedVolume ClusterStatus = "WaitingForSharedVolume"
ClusterStatusInstallingDrivers ClusterStatus = "InstallingDrivers"
ClusterStatusRunningAcceptanceTests ClusterStatus = "RunningAcceptanceTests"
ClusterStatusPaused ClusterStatus = "Paused"
ClusterStatusOnDemandComputePaused ClusterStatus = "OnDemandComputePaused"
ClusterStatusReady ClusterStatus = "Ready"
ClusterStatusDegraded ClusterStatus = "Degraded"
ClusterStatusDeleting ClusterStatus = "Deleting"
)
type ClusterVolume struct {
// Size of the volume in TiB.
SizeTib int64 `json:"size_tib" api:"required"`
// Current status of the volume.
Status string `json:"status" api:"required"`
// ID of the volume.
VolumeID string `json:"volume_id" api:"required"`
// User provided name of the volume.
VolumeName string `json:"volume_name" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
SizeTib respjson.Field
Status respjson.Field
VolumeID respjson.Field
VolumeName respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterVolume) RawJSON() string { return r.JSON.raw }
func (r *ClusterVolume) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterClusterConfig struct {
// Any of "NONE", "TRAEFIK", "NGINX", "ISTIO".
LoadBalancer string `json:"load_balancer" api:"required"`
// NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When
// omitted, a service default is applied.
GPUOperatorVersion string `json:"gpu_operator_version"`
Ingress ClusterClusterConfigIngress `json:"ingress"`
JumphostEnabled bool `json:"jumphost_enabled"`
KubernetesDashboardEnabled bool `json:"kubernetes_dashboard_enabled"`
// NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0).
// When omitted, a service default is applied.
NetworkOperatorVersion string `json:"network_operator_version"`
Observability ClusterClusterConfigObservability `json:"observability"`
// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
// init, extra conf).
SlurmStartupScripts ClusterClusterConfigSlurmStartupScripts `json:"slurm_startup_scripts"`
// Whether this cluster uses a per-cluster SSH certificate authority for
// OIDC-signed SSH access.
SSHCaEnabled bool `json:"ssh_ca_enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LoadBalancer respjson.Field
GPUOperatorVersion respjson.Field
Ingress respjson.Field
JumphostEnabled respjson.Field
KubernetesDashboardEnabled respjson.Field
NetworkOperatorVersion respjson.Field
Observability respjson.Field
SlurmStartupScripts respjson.Field
SSHCaEnabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterClusterConfig) RawJSON() string { return r.JSON.raw }
func (r *ClusterClusterConfig) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterClusterConfigIngress struct {
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterClusterConfigIngress) RawJSON() string { return r.JSON.raw }
func (r *ClusterClusterConfigIngress) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterClusterConfigObservability struct {
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterClusterConfigObservability) RawJSON() string { return r.JSON.raw }
func (r *ClusterClusterConfigObservability) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog,
// init, extra conf).
type ClusterClusterConfigSlurmStartupScripts struct {
// Slurm controller epilog script.
ControllerEpilog string `json:"controller_epilog"`
// Slurm controller prolog script.
ControllerProlog string `json:"controller_prolog"`
// Additional slurm.conf fragments.
ExtraSlurmConf string `json:"extra_slurm_conf"`
// Script run on Slurm login node init.
LoginInitScript string `json:"login_init_script"`
// Script run on Slurm nodeset init.
NodesetInitScript string `json:"nodeset_init_script"`
// Slurm worker node epilog script.
WorkerEpilog string `json:"worker_epilog"`
// Slurm worker node prolog script.
WorkerProlog string `json:"worker_prolog"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ControllerEpilog respjson.Field
ControllerProlog respjson.Field
ExtraSlurmConf respjson.Field
LoginInitScript respjson.Field
NodesetInitScript respjson.Field
WorkerEpilog respjson.Field
WorkerProlog respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterClusterConfigSlurmStartupScripts) RawJSON() string { return r.JSON.raw }
func (r *ClusterClusterConfigSlurmStartupScripts) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterDeletedGPUWorkerNode struct {
HostName string `json:"host_name" api:"required"`
MemoryGib float64 `json:"memory_gib" api:"required"`
Networks []string `json:"networks" api:"required"`
NodeID string `json:"node_id" api:"required"`
NumCPUCores int64 `json:"num_cpu_cores" api:"required"`
NumGPUs int64 `json:"num_gpus" api:"required"`
// Phase transition history for this GPU worker node.
PhaseTransitions []ClusterDeletedGPUWorkerNodePhaseTransition `json:"phase_transitions" api:"required"`
Status string `json:"status" api:"required"`
// Whether auto-remediation is enabled for this node's instance.
AutoRemediationEnabled bool `json:"auto_remediation_enabled"`
// Timestamp when the node left the live data plane. Only set for
// deleted_gpu_worker_nodes.
DeletedAt time.Time `json:"deleted_at" format:"date-time"`
// Ephemeral storage size, such as 1Ti.
EphemeralStorage string `json:"ephemeral_storage"`
// Number of InfiniBand HCAs.
IbHcaCount int64 `json:"ib_hca_count"`
// InfiniBand HCA type.
IbHcaType string `json:"ib_hca_type"`
InstanceID string `json:"instance_id"`
// Remediation represents a node remediation request for an instance. An instance
// can have multiple remediations over time (e.g., failed attempts followed by
// retries).
LatestRemediation Remediation `json:"latest_remediation"`
// Whether this node is marked for deletion by the operator.
MarkedForDeletion bool `json:"marked_for_deletion"`
// Number of NVSwitches.
NvswitchCount int64 `json:"nvswitch_count"`
// NVSwitch type.
NvswitchType string `json:"nvswitch_type"`
// Public IPv4 address of the GPU worker node.
PublicIpv4 string `json:"public_ipv4"`
SlurmWorkerHostname string `json:"slurm_worker_hostname"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
HostName respjson.Field
MemoryGib respjson.Field
Networks respjson.Field
NodeID respjson.Field
NumCPUCores respjson.Field
NumGPUs respjson.Field
PhaseTransitions respjson.Field
Status respjson.Field
AutoRemediationEnabled respjson.Field
DeletedAt respjson.Field
EphemeralStorage respjson.Field
IbHcaCount respjson.Field
IbHcaType respjson.Field
InstanceID respjson.Field
LatestRemediation respjson.Field
MarkedForDeletion respjson.Field
NvswitchCount respjson.Field
NvswitchType respjson.Field
PublicIpv4 respjson.Field
SlurmWorkerHostname respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterDeletedGPUWorkerNode) RawJSON() string { return r.JSON.raw }
func (r *ClusterDeletedGPUWorkerNode) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterDeletedGPUWorkerNodePhaseTransition struct {
// Node phase.
//
// Any of "NODE_PHASE_PENDING", "NODE_PHASE_SCHEDULING", "NODE_PHASE_BOOTING",
// "NODE_PHASE_BOOTSTRAPPING", "NODE_PHASE_RUNNING", "NODE_PHASE_SUCCEEDED",
// "NODE_PHASE_FAILED", "NODE_PHASE_PAUSED".
Phase string `json:"phase" api:"required"`
// Timestamp when the phase transition occurred.
TransitionTime time.Time `json:"transition_time" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Phase respjson.Field
TransitionTime respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterDeletedGPUWorkerNodePhaseTransition) RawJSON() string { return r.JSON.raw }
func (r *ClusterDeletedGPUWorkerNodePhaseTransition) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Node lifecycle event included in a GPU cluster timeline.
type ClusterNodeLifecycleEvent struct {
// Human-readable lifecycle event message.
Message string `json:"message" api:"required"`
// Tenant node name this lifecycle event applies to.
NodeID string `json:"node_id" api:"required"`
// Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or
// TogetherPreempted.
Reason string `json:"reason" api:"required"`
// Event timestamp.
Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
NodeID respjson.Field
Reason respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterNodeLifecycleEvent) RawJSON() string { return r.JSON.raw }
func (r *ClusterNodeLifecycleEvent) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type ClusterOidcConfig struct {
// OIDC client ID for authentication.
ClientID string `json:"client_id" api:"required"`
// JWT claim to use for user groups. For example, 'groups'
GroupClaim string `json:"group_claim" api:"required"`
// Prefix to add to the group claim to form the final group name. For example,
// 'oidc:'
GroupPrefix string `json:"group_prefix" api:"required"`
// OIDC issuer URL for authentication. For example, https://accounts.google.com
IssuerURL string `json:"issuer_url" api:"required"`
// JWT claim to use as the username. For example, 'sub' or 'email'
UsernameClaim string `json:"username_claim" api:"required"`
// Prefix to add to the username claim to form the final username. For example,
// 'oidc:'
UsernamePrefix string `json:"username_prefix" api:"required"`
// CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This
// field is optional but recommended if the issuer uses a private CA or self-signed
// certificate.
CaCert string `json:"ca_cert"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ClientID respjson.Field
GroupClaim respjson.Field
GroupPrefix respjson.Field
IssuerURL respjson.Field
UsernameClaim respjson.Field
UsernamePrefix respjson.Field
CaCert respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r ClusterOidcConfig) RawJSON() string { return r.JSON.raw }
func (r *ClusterOidcConfig) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)