Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Extend the API to expose the options required to provision an instance with GPU attached #654

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/v1beta1/gcpmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ const (
IPForwardingDisabled IPForwarding = "Disabled"
)

// AcceleratorConfig defines the type & number of accelerator required
type AcceleratorConfig struct {
// AccleratorType is the full reference to a valid GPU to be used for this machine
// +required
Type string `json:"type,omitempty"`

// AcceleratorCount is the number of GPUs to be available at the instance creation time
// default=1
// +optional
Count int64 `json:"count,omitempty"`
}

// GCPMachineSpec defines the desired state of GCPMachine.
type GCPMachineSpec struct {
// InstanceType is the type of instance to create. Example: n1.standard-2
Expand All @@ -89,6 +101,20 @@ type GCPMachineSpec struct {
// +optional
Image *string `json:"image,omitempty"`

// Accelerator is the reference to a valid GPU Accelerator
Accelerator *AcceleratorConfig `json:"accelerator,omitempty"`

// OnHostMaintenance is an option to set the behaviour of selected Google Cloud virtual machine
// instance during a maintenance event
// default=MIGRATE
// +optional
OnHostMaintenance string `json:"onHostMaintenance,omitempty"`

// AutomaticRestart defines if the instance should be restarted when it is
// default=True
// +optional
AutomaticRestart bool `json:"automaticRestart,omitempty"`

// AdditionalLabels is an optional set of tags to add to an instance, in addition to the ones added by default by the
// GCP provider. If both the GCPCluster and the GCPMachine specify the same tag name with different values, the
// GCPMachine's value takes precedence.
Expand Down