Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.44.0
go.opentelemetry.io/otel/trace v1.44.0
go.opentelemetry.io/proto/otlp v1.10.0
go.temporal.io/api v1.63.6-0.20260909222256-20151aa90480
go.temporal.io/api v1.63.7-0.20261008215930-cdda301d97b4
go.temporal.io/auto-scaled-workers v0.0.0-20260928183627-719679297cbe
go.temporal.io/sdk v1.48.0
go.temporal.io/sdk v1.49.0
go.uber.org/fx v1.24.0
go.uber.org/goleak v1.3.0
go.uber.org/mock v0.6.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,12 @@ go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0 h1:R
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0/go.mod h1:I89cynRj8y+383o7tEQVg2SVA6SRgDVIouWPUVXjx0U=
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0 h1:CQvJSldHRUN6Z8jsUeYv8J0lXRvygALXIzsmAeCcZE0=
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0/go.mod h1:xSQ+mEfJe/GjK1LXEyVOoSI1N9JV9ZI923X5kup43W4=
go.temporal.io/api v1.63.6-0.20260909222256-20151aa90480 h1:1w2xEZFpL7R9NagEQeWTh7oZmZU3YUJGogusn9/LfCg=
go.temporal.io/api v1.63.6-0.20260909222256-20151aa90480/go.mod h1:acM0I9WPuYg8W3Pd9jOZvEgi7mRUttUQ4+e7fowKVnM=
go.temporal.io/api v1.63.7-0.20261008215930-cdda301d97b4 h1:B59pbaK9+ex9e15DO87YNfEL7MkVtQOyq8pudt+LGcw=
go.temporal.io/api v1.63.7-0.20261008215930-cdda301d97b4/go.mod h1:acM0I9WPuYg8W3Pd9jOZvEgi7mRUttUQ4+e7fowKVnM=
go.temporal.io/auto-scaled-workers v0.0.0-20260928183627-719679297cbe h1:BlshPqVI1uh/AsdfGPPjfKc37HEZdGfcmvx+uW+rbe8=
go.temporal.io/auto-scaled-workers v0.0.0-20260928183627-719679297cbe/go.mod h1:6Q4guHwlbJldBOZwvc201E0+Jz9Tly1L1Db6C7RJuLw=
go.temporal.io/sdk v1.48.0 h1:WDctKDVuh0Z8Nf7euAyqs/EwcPg1JTIIq1Fut8Tq118=
go.temporal.io/sdk v1.48.0/go.mod h1:SHv3+fLzD0GGZAwf0xNSvu8UmO1nFgG9WBSYoowApIk=
go.temporal.io/sdk v1.49.0 h1:CtGI0BUe/SCo3eoqTwuWWtXKueii9GBVus7KrKKH1Vo=
go.temporal.io/sdk v1.49.0/go.mod h1:xP0FulN5JJSfisESUP60LlWsrKz2tLSStGjVdk8r5cc=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
Expand Down
4 changes: 4 additions & 0 deletions service/worker/workerdeployment/compute_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func computeConfigScalingGroupsToWCISpec(scalingGroups map[string]*computepb.Com
for name, sg := range scalingGroups {
groupSpec := wciiface.ScalingGroupSpec{
TaskTypes: sg.GetTaskQueueTypes(),
RegionIds: sg.GetRegionIds(),
Compute: wciiface.ComputeProviderSpec{
ProviderType: wciiface.ComputeProviderType(sg.GetProvider().GetType()),
},
Expand All @@ -39,6 +40,7 @@ func scalingGroupUpdatesToWCI(updates map[string]*computepb.ComputeConfigScaling
sg := update.GetScalingGroup()
spec := wciiface.ScalingGroupSpec{
TaskTypes: sg.GetTaskQueueTypes(),
RegionIds: sg.GetRegionIds(),
Compute: wciiface.ComputeProviderSpec{
ProviderType: wciiface.ComputeProviderType(sg.GetProvider().GetType()),
Config: sg.GetProvider().GetDetails(),
Expand Down Expand Up @@ -67,6 +69,7 @@ func wciSpecToComputeConfig(spec *wciiface.WorkerControllerInstanceSpec) *comput
for name, sg := range spec.ScalingGroupSpecs {
group := &computepb.ComputeConfigScalingGroup{
TaskQueueTypes: sg.TaskTypes,
RegionIds: sg.RegionIds,
Provider: &computepb.ComputeProvider{
Type: string(sg.Compute.ProviderType),
Details: sg.Compute.Config,
Expand Down Expand Up @@ -94,6 +97,7 @@ func wciSpecToComputeConfigSummary(spec *wciiface.WorkerControllerInstanceSpec)
groups[name] = &computepb.ComputeConfigScalingGroupSummary{
TaskQueueTypes: sg.TaskTypes,
ProviderType: string(sg.Compute.ProviderType),
RegionIds: sg.RegionIds,
}
}
return &computepb.ComputeConfigSummary{ScalingGroups: groups}
Expand Down
24 changes: 24 additions & 0 deletions service/worker/workerdeployment/compute_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@ func TestComputeConfigScalingGroupsToWCISpec_WithComputeAndScaling(t *testing.T)
assert.Nil(t, g2.Scaling, "no scaler means nil scaling spec")
}

func TestComputeConfigConversions_RegionIds(t *testing.T) {
t.Parallel()
regions := []string{"aws-us-east-1", "aws-us-west-2"}
groups := map[string]*computepb.ComputeConfigScalingGroup{
"workflows": {
TaskQueueTypes: []enumspb.TaskQueueType{enumspb.TASK_QUEUE_TYPE_WORKFLOW},
RegionIds: regions,
Provider: &computepb.ComputeProvider{Type: "aws-lambda"},
},
}

spec := computeConfigScalingGroupsToWCISpec(groups)
assert.Equal(t, regions, spec.ScalingGroupSpecs["workflows"].RegionIds)

updates := scalingGroupUpdatesToWCI(scalingGroupsToUpsertUpdates(groups))
assert.Equal(t, regions, updates["workflows"].Spec.RegionIds)

config := wciSpecToComputeConfig(spec)
assert.Equal(t, regions, config.GetScalingGroups()["workflows"].GetRegionIds())

summary := wciSpecToComputeConfigSummary(spec)
assert.Equal(t, regions, summary.GetScalingGroups()["workflows"].GetRegionIds())
}

func TestWciValidationStatusToComputeStatus_Nil(t *testing.T) {
t.Parallel()
require.Nil(t, wciValidationStatusToComputeStatus(nil))
Expand Down