Skip to content

Commit

Permalink
fix parallelism set through frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rk3y committed Oct 9, 2023
1 parent df81997 commit 1458dbd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/server/api_container/server/api_container_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const (
isScript = true
isNotScript = false
isNotRemote = false
defaultParallelism = 4
)

// Guaranteed (by a unit test) to be a 1:1 mapping between API port protos and port spec protos
Expand Down Expand Up @@ -112,7 +113,7 @@ func NewApiContainerService(
PackageId: startosis_constants.PackageIdPlaceholderForStandaloneScript,
SerializedScript: "",
SerializedParams: "",
Parallelism: 0,
Parallelism: defaultParallelism,
RelativePathToMainFile: startosis_constants.PlaceHolderMainFileForPlaceStandAloneScript,
MainFunctionName: "",
ExperimentalFeatures: []kurtosis_core_rpc_api_bindings.KurtosisFeatureFlag{},
Expand All @@ -128,6 +129,9 @@ func (apicService *ApiContainerService) RunStarlarkScript(args *kurtosis_core_rp
serializedStarlarkScript := args.GetSerializedScript()
serializedParams := args.GetSerializedParams()
parallelism := int(args.GetParallelism())
if parallelism == 0 {
parallelism = defaultParallelism
}
dryRun := shared_utils.GetOrDefaultBool(args.DryRun, defaultStartosisDryRun)
mainFuncName := args.GetMainFunctionName()
experimentalFeatures := args.GetExperimentalFeatures()
Expand Down Expand Up @@ -223,6 +227,9 @@ func (apicService *ApiContainerService) InspectFilesArtifactContents(_ context.C
func (apicService *ApiContainerService) RunStarlarkPackage(args *kurtosis_core_rpc_api_bindings.RunStarlarkPackageArgs, stream kurtosis_core_rpc_api_bindings.ApiContainerService_RunStarlarkPackageServer) error {
packageId := args.GetPackageId()
parallelism := int(args.GetParallelism())
if parallelism == 0 {
parallelism = defaultParallelism
}
dryRun := shared_utils.GetOrDefaultBool(args.DryRun, defaultStartosisDryRun)
serializedParams := args.GetSerializedParams()
relativePathToMainFile := args.GetRelativePathToMainFile()
Expand Down

0 comments on commit 1458dbd

Please sign in to comment.