Skip to content

Commit 02f1d50

Browse files
committed
use capacity ID
1 parent 8fb2b63 commit 02f1d50

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

v1/providers/sfcomputev2/brev_constants.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const (
1414
// Brev environment config for SFCompute V2.
1515
// TODO: source these from environment variables rather than hardcoding them here.
1616
const (
17-
// BrevProductionCapacityID is the SFCompute V2 capacity ID for Brev production instances.
18-
BrevProductionCapacityID = "brev-production-capacity"
17+
// BrevDefaultCapacityID is the SFCompute V2 capacity ID for Brev production instances.
18+
BrevDefaultCapacityID = "brev-default-capacity"
1919

20-
// BrevProductionImageID is the SFCompute image for Brev production instances
20+
// BrevDefaultImageID is the default SFCompute image for Brev instances
2121
// (ubuntu-24.04.4-cuda-12.8, vm_images.vm_image_id).
22-
BrevProductionImageID = "vmi_4GwEvmclFURy7ztFQjOdr"
22+
BrevDefaultImageID = "vmi_4GwEvmclFURy7ztFQjOdr"
2323
)

v1/providers/sfcomputev2/instance.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ func (c *SFCClientV2) CreateInstance(ctx context.Context, attrs v1.CreateInstanc
2929

3030
cloudInit := sshKeyCloudInit(attrs.PublicKey)
3131
resp, err := c.client.Instances.Create(ctx, components.CreateInstanceRequest{
32-
Capacity: BrevProductionCapacityID,
33-
Image: BrevProductionImageID,
32+
Capacity: BrevDefaultCapacityID,
33+
Image: BrevDefaultImageID,
3434
CloudInitUserData: &cloudInit,
3535
Tags: optionalnullable.From(&tags),
3636
Name: optionalnullable.From(&attrs.Name),
@@ -95,7 +95,7 @@ func (c *SFCClientV2) ListInstances(ctx context.Context, args v1.ListInstancesAr
9595
v1.LogField("location", c.location),
9696
)
9797

98-
capacityID := BrevProductionCapacityID
98+
capacityID := BrevDefaultCapacityID
9999
resp, err := c.client.Instances.List(ctx, operations.ListInstancesRequest{
100100
Capacity: &capacityID,
101101
})

v1/providers/sfcomputev2/instancetype.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (c *SFCClientV2) availableSlots(ctx context.Context) (int, error) {
150150
// currentCapacityAllocation returns the NodeAllocation from the most recent schedule entry
151151
// in BrevProductionCapacityID that is currently in effect (EffectiveAt <= now).
152152
func (c *SFCClientV2) currentCapacityAllocation(ctx context.Context) (int, error) {
153-
resp, err := c.client.Capacities.Fetch(ctx, BrevProductionCapacityID, nil, nil)
153+
resp, err := c.client.Capacities.Fetch(ctx, BrevDefaultCapacityID, nil, nil)
154154
if err != nil {
155155
return 0, errors.WrapAndTrace(err)
156156
}
@@ -173,7 +173,7 @@ func (c *SFCClientV2) currentCapacityAllocation(ctx context.Context) (int, error
173173
// activeInstanceCount returns the number of non-terminated instances in BrevProductionCapacityID.
174174
// All non-terminated instances occupy a slot in the capacity, including failed ones.
175175
func (c *SFCClientV2) activeInstanceCount(ctx context.Context) (int, error) {
176-
capacityID := BrevProductionCapacityID
176+
capacityID := BrevDefaultCapacityID
177177
resp, err := c.client.Instances.List(ctx, operations.ListInstancesRequest{
178178
Capacity: &capacityID,
179179
})

0 commit comments

Comments
 (0)