Skip to content

Commit

Permalink
Merge pull request #52 from depot/realm
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Aug 15, 2023
2 parents 85880ee + a9ed535 commit fae0b1b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 61 deletions.
4 changes: 2 additions & 2 deletions proto/depot/cloud/v2/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ message GetDesiredStateResponse {
repeated VolumeChange volume_changes = 4;

message NewMachine {
reserved 2;
string id = 1;
string realm = 2;
Kind kind = 3;
Architecture architecture = 4;
string image = 5;
Expand All @@ -35,8 +35,8 @@ message GetDesiredStateResponse {
}

message NewVolume {
reserved 2;
string id = 1;
string realm = 2;
Kind kind = 3;
Architecture architecture = 4;
int32 size = 5;
Expand Down
2 changes: 1 addition & 1 deletion src/proto/depot/cloud/v2/cloud_connect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v0.10.1 with parameter "target=ts,import_extension=none"
// @generated by protoc-gen-connect-es v0.12.0 with parameter "target=ts,import_extension=none"
// @generated from file depot/cloud/v2/cloud.proto (package depot.cloud.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
14 changes: 1 addition & 13 deletions src/proto/depot/cloud/v2/cloud_pb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.2.1 with parameter "target=ts,import_extension=none"
// @generated by protoc-gen-es v1.3.0 with parameter "target=ts,import_extension=none"
// @generated from file depot/cloud/v2/cloud.proto (package depot.cloud.v2, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down Expand Up @@ -292,11 +292,6 @@ export class GetDesiredStateResponse_NewMachine extends Message<GetDesiredStateR
*/
id = ''

/**
* @generated from field: string realm = 2;
*/
realm = ''

/**
* @generated from field: depot.cloud.v2.GetDesiredStateResponse.Kind kind = 3;
*/
Expand Down Expand Up @@ -331,7 +326,6 @@ export class GetDesiredStateResponse_NewMachine extends Message<GetDesiredStateR
static readonly typeName = 'depot.cloud.v2.GetDesiredStateResponse.NewMachine'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */},
{no: 2, name: 'realm', kind: 'scalar', T: 9 /* ScalarType.STRING */},
{no: 3, name: 'kind', kind: 'enum', T: proto3.getEnumType(GetDesiredStateResponse_Kind)},
{no: 4, name: 'architecture', kind: 'enum', T: proto3.getEnumType(GetDesiredStateResponse_Architecture)},
{no: 5, name: 'image', kind: 'scalar', T: 9 /* ScalarType.STRING */},
Expand Down Expand Up @@ -368,11 +362,6 @@ export class GetDesiredStateResponse_NewVolume extends Message<GetDesiredStateRe
*/
id = ''

/**
* @generated from field: string realm = 2;
*/
realm = ''

/**
* @generated from field: depot.cloud.v2.GetDesiredStateResponse.Kind kind = 3;
*/
Expand All @@ -397,7 +386,6 @@ export class GetDesiredStateResponse_NewVolume extends Message<GetDesiredStateRe
static readonly typeName = 'depot.cloud.v2.GetDesiredStateResponse.NewVolume'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */},
{no: 2, name: 'realm', kind: 'scalar', T: 9 /* ScalarType.STRING */},
{no: 3, name: 'kind', kind: 'enum', T: proto3.getEnumType(GetDesiredStateResponse_Kind)},
{no: 4, name: 'architecture', kind: 'enum', T: proto3.getEnumType(GetDesiredStateResponse_Architecture)},
{no: 5, name: 'size', kind: 'scalar', T: 5 /* ScalarType.INT32 */},
Expand Down
44 changes: 0 additions & 44 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,3 @@ export interface CurrentState {
instances: Record<string, Instance>
volumes: Record<string, Volume>
}

// Desired State

export interface StateResponse {
newMachines: NewMachineDesiredState[]
newVolumes: NewVolumeDesiredState[]
machineChanges: MachineDesiredState[]
volumeChanges: VolumeDesiredState[]
}

export type MachineState = 'pending' | 'running' | 'stopped' | 'deleted'

export interface MachineDesiredState {
machineID: string
desiredState: MachineState
}

export interface NewMachineDesiredState {
id: string
image: string
realm: string
kind: string
architecture: string
securityGroup: 'buildkit' | 'closed'
}

export type VolumeState = 'pending' | 'available' | 'attached' | 'deleted'

export interface VolumeDesiredState {
volumeID: string
desiredState: VolumeState
attachedTo?: string
device?: string
}

export interface NewVolumeDesiredState {
id: string
size: number
kind: string
realm: string
architecture: string
}

export type AWSVolumeStatus = 'creating' | 'available' | 'in-use' | 'deleting' | 'deleted' | 'error'
1 change: 0 additions & 1 deletion src/utils/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ async function reconcileNewVolume(state: Record<string, Volume>, volume: GetDesi
{Key: 'Name', Value: `depot-connection-${CLOUD_AGENT_CONNECTION_ID}-${volume.id}`},
{Key: 'depot-connection', Value: CLOUD_AGENT_CONNECTION_ID},
{Key: 'depot-volume-id', Value: volume.id},
{Key: 'depot-volume-realm', Value: volume.realm},
],
},
],
Expand Down

0 comments on commit fae0b1b

Please sign in to comment.