-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat(kurtosis-devnet): ensure kurtosis engine is running (#13611)
Unfortunately the logic for doing so is not present in the kurtosis SDK, so we have to shell out to the binary. Make sure the version we run is compatible with the client library we use to interact with the created enclaves.
- v1.11.2
- v1.11.1
- v1.11.0
- op-supervisor/0.1.0-rc.1
- op-proposer/v1.10.0
- op-proposer/v1.10.0-rc.3
- op-program/v1.5.0-rc.3
- op-program/v1.5.0-rc.2
- op-program/v1.5.0-rc.1
- op-program/v1.4.1-rc.3
- op-node/v1.11.4-synctest.1
- op-node/v1.11.4-synctest.0
- op-node/v1.11.3-synctest.1
- op-node/v1.11.3-synctest.0
- op-node/v1.11.3-rc.1
- op-node/v1.11.2
- op-node/v1.11.2-rc.1
- op-node/v1.11.2-dev.0
- op-node/v1.11.1
- op-node/v1.11.1-rc.1
- op-node/v1.11.0
- op-node/v1.11.0-rc.2
- op-node/v1.11.0-rc.1
- op-node/v1.10.4-rc.1
- op-node/v1.10.4-dev.5
- op-node/v1.10.4-dev.4
- op-node/v1.10.4-dev.3
- op-node/v1.10.4-dev.2
- op-node/v1.10.4-dev.1
- op-node/v1.10.4-dev.0
- op-node/v1.10.3
- op-node/v1.10.3-rc.1
- op-node/v1.10.3-dev.0
- op-dripper/v0.0.1
- op-deployer/v0.2.0-rc.1
- op-deployer/v0.1.0-rc.2
- op-deployer/v0.1.0-rc.1
- op-deployer/v0.0.12
- op-deployer/v0.0.11
- op-deployer/v0.0.10
- op-contracts/v3.0.0-rc.1
- op-contracts/v2.0.0-rc.1
- op-conductor/v0.3.2-rc.1
- op-conductor/v0.3.1
- op-conductor/v0.3.1-rc2
- op-conductor/v0.3.1-rc1
- op-challenger/v1.3.2
- op-challenger/v1.3.2-rc.1
- op-challenger/v1.3.1
- op-challenger/v1.3.1-rc.7
- op-challenger/v1.3.1-rc.6
- op-challenger/v1.3.1-rc.5
- op-batcher/v1.11.4
- op-batcher/v1.11.4-rc.1
- op-batcher/v1.11.3
- op-batcher/v1.11.3-rc.1
- op-batcher/v1.11.2
- op-batcher/v1.11.2-rc.2
- op-batcher/v1.11.2-rc.1
- op-batcher/v1.11.1
- op-batcher/v1.11.1-rc.1
- op-batcher/v1.11.0
- op-batcher/v1.11.0-rc.1
- ci-builder/v0.59.0
- ci-builder/v0.58.0
- ci-builder/v0.57.0
- ci-builder/v0.56.0
- cannon/v1.4.0
- cannon/v1.4.0-alpha.1
- cannon/v1.3.0
- cannon/v1.3.0-rc.1
Showing
3 changed files
with
90 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package engine | ||
|
||
import ( | ||
"fmt" | ||
"os/exec" | ||
|
||
"github.com/kurtosis-tech/kurtosis/api/golang/kurtosis_version" | ||
) | ||
|
||
// EngineManager handles running the Kurtosis engine | ||
type EngineManager struct { | ||
kurtosisBinary string | ||
version string | ||
} | ||
|
||
// Option configures an EngineManager | ||
type Option func(*EngineManager) | ||
|
||
// WithKurtosisBinary sets the path to the kurtosis binary | ||
func WithKurtosisBinary(binary string) Option { | ||
return func(e *EngineManager) { | ||
e.kurtosisBinary = binary | ||
} | ||
} | ||
|
||
// WithVersion sets the engine version | ||
func WithVersion(version string) Option { | ||
return func(e *EngineManager) { | ||
e.version = version | ||
} | ||
} | ||
|
||
// NewEngineManager creates a new EngineManager with the given options | ||
func NewEngineManager(opts ...Option) *EngineManager { | ||
e := &EngineManager{ | ||
kurtosisBinary: "kurtosis", // Default to expecting kurtosis in PATH | ||
version: kurtosis_version.KurtosisVersion, // Default to library version | ||
} | ||
for _, opt := range opts { | ||
opt(e) | ||
} | ||
return e | ||
} | ||
|
||
// EnsureRunning starts the Kurtosis engine with the configured version | ||
func (e *EngineManager) EnsureRunning() error { | ||
cmd := exec.Command(e.kurtosisBinary, "engine", "start", "--version", e.version) | ||
if err := cmd.Run(); err != nil { | ||
return fmt.Errorf("failed to start kurtosis engine: %w", err) | ||
} | ||
return nil | ||
} |