Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added enclave pool for improving performance on enclave creation (
#787) ## Description: - Added enclave pool for improving performance on enclave creation - The `pool-size` new flag was added in the `engine start and engine restart` commands ## What is pending? - reuse idle enclaves when the engine is restarted ## Is this change user-facing? YES ## References (if applicable): [Docs are here](https://www.notion.so/kurtosistech/Enclave-Pool-Project-7273552e53e44b0f931a57568cd170a0?d=2f870450d01d4ad7b8af6d0045602a2a#a20862960dad4868b0b9b6eb320b6178) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Guillaume Bouvignies <guillaume.bouvignies@kurtosistech.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kurtosisbot <89932784+kurtosisbot@users.noreply.github.com> Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com> Co-authored-by: Gyanendra Mishra <anomaly.the@gmail.com> Co-authored-by: h4ck3rk3y <h4ck3rk3y@users.noreply.github.com> Co-authored-by: thylocine33 <137217810+thylocine33@users.noreply.github.com> Co-authored-by: Karla Forester <karlaforester@Karlas-MacBook-Pro.local>
- Loading branch information
1 parent
aff6289
commit d6efa43
Showing
31 changed files
with
1,127 additions
and
304 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/kurtosis-tech/kurtosis/cli/cli/helpers/kurtosis_config_getter" | ||
"github.com/kurtosis-tech/kurtosis/cli/cli/kurtosis_config/resolved_config" | ||
"github.com/kurtosis-tech/stacktrace" | ||
) | ||
|
||
func ValidateEnclavePoolSizeFlag(enclavePoolSize uint8) error { | ||
if enclavePoolSize > 0 { | ||
isEnclavePoolAvailableForCurrentCluster, err := isEnclavePoolAvailableForCurrentClusterType() | ||
if err != nil { | ||
return stacktrace.Propagate(err, "An error occurred validating if the enclave pool feature is valid for the current cluster type") | ||
} | ||
if !isEnclavePoolAvailableForCurrentCluster { | ||
return stacktrace.NewError("The enclave pool feature is not available for the current cluster type, please switch to the 'Kubernetes' Kurtosis backend type if you want to use it.") | ||
} | ||
} | ||
return nil | ||
} | ||
|
||
func isEnclavePoolAvailableForCurrentClusterType() (bool, error) { | ||
clusterConfig, err := kurtosis_config_getter.GetKurtosisClusterConfig() | ||
if err != nil { | ||
return false, stacktrace.Propagate(err, "An error occurred getting the Kurtosis cluster config") | ||
} | ||
|
||
clusterType := clusterConfig.GetClusterType() | ||
|
||
if clusterType == resolved_config.KurtosisClusterType_Kubernetes { | ||
return true, nil | ||
} | ||
return false, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.