-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Idempotent run V1 - services can now be live-updated inside an …
…enclave (#954) ## Description: Kurtosis is now able to re-run the same Starlark script with changes to the `ServiceConfig` objects used in the `add_service` and `add_services` instructions. Kurtosis will now re-run those specific instructions to update the underlying service. Dependent instructions referencing this service (like `exec`, `wait`) will also be re-run when the service is updated. ## Is this change user facing? YES <!-- If yes, please add the "user facing" label to the PR --> <!-- If yes, don't forget to include docs changes where relevant --> ## References (if applicable): <!-- Add relevant Github Issues, Discord threads, or other helpful information. -->
- Loading branch information
Guillaume Bouvignies
authored
Jul 24, 2023
1 parent
f1b52ca
commit a6a118d
Showing
45 changed files
with
1,002 additions
and
222 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
20 changes: 10 additions & 10 deletions
20
core/server/api_container/server/service_network/mock_service_network.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
...erver/api_container/server/startosis_engine/enclave_structure/enclave_component_status.go
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,17 @@ | ||
package enclave_structure | ||
|
||
//go:generate go run github.com/dmarkham/enumer -trimprefix "EnclaveComponentStatus" -type=EnclaveComponentStatus | ||
type EnclaveComponentStatus uint8 | ||
|
||
const ( | ||
// ComponentIsNew means the component was first created during this run | ||
ComponentIsNew EnclaveComponentStatus = iota | ||
|
||
// ComponentWasLeftIntact means the component was present prior to the beginning of this run and has been left | ||
// intact | ||
ComponentWasLeftIntact | ||
|
||
// ComponentIsUpdated means the component was present prior to the beginning of this run but has been updated | ||
// during this run | ||
ComponentIsUpdated | ||
) |
26 changes: 26 additions & 0 deletions
26
core/server/api_container/server/startosis_engine/enclave_structure/enclave_components.go
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,26 @@ | ||
package enclave_structure | ||
|
||
import ( | ||
"github.com/kurtosis-tech/kurtosis/container-engine-lib/lib/backend_interface/objects/service" | ||
) | ||
|
||
type EnclaveComponents struct { | ||
enclaveServices map[service.ServiceName]EnclaveComponentStatus | ||
} | ||
|
||
func NewEnclaveComponents() *EnclaveComponents { | ||
return &EnclaveComponents{ | ||
enclaveServices: map[service.ServiceName]EnclaveComponentStatus{}, | ||
} | ||
} | ||
|
||
func (components *EnclaveComponents) AddService(serviceName service.ServiceName, componentStatus EnclaveComponentStatus) { | ||
components.enclaveServices[serviceName] = componentStatus | ||
} | ||
|
||
func (components *EnclaveComponents) HasServiceBeenUpdated(serviceName service.ServiceName) bool { | ||
if serviceStatus, found := components.enclaveServices[serviceName]; found { | ||
return serviceStatus == ComponentIsUpdated | ||
} | ||
return false | ||
} |
82 changes: 82 additions & 0 deletions
82
.../api_container/server/startosis_engine/enclave_structure/enclavecomponentstatus_enumer.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
.../api_container/server/startosis_engine/enclave_structure/instruction_resolution_status.go
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,21 @@ | ||
package enclave_structure | ||
|
||
//go:generate go run github.com/dmarkham/enumer -trimprefix "InstructionResolutionStatus" -type=InstructionResolutionStatus | ||
type InstructionResolutionStatus uint8 | ||
|
||
const ( | ||
// InstructionIsEqual means this instruction is strictly equal to the one it's being compared to. | ||
InstructionIsEqual InstructionResolutionStatus = iota | ||
|
||
// InstructionIsUpdate means this instruction is the same as the one it's being compared to, but with some | ||
// changes to its parameters. It should be re-run so that the enclave can be updated. | ||
InstructionIsUpdate | ||
|
||
// InstructionIsUnknown means the two instructions are completely different. | ||
InstructionIsUnknown | ||
|
||
// InstructionIsNotResolvableAbort means one of the compared instructions is fundamentally incompatible with the | ||
// concept of idempotency. Kurtosis should stop trying to run it in an idempotent way and fall back to the default | ||
// behaviour | ||
InstructionIsNotResolvableAbort | ||
) |
86 changes: 86 additions & 0 deletions
86
...container/server/startosis_engine/enclave_structure/instructionresolutionstatus_enumer.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.