Skip to content

Commit 5714c5e

Browse files
Chore: Extend input with platform image (#1912)
* add ImagePlatform field to Input * default image platform to amd64 and read input.ImagePlatform if available for sui * add docs and changeset --------- Co-authored-by: skudasov <[email protected]>
1 parent 263e073 commit 5714c5e

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

book/src/framework/components/blockchains/sui.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ API is available on [localhost:9000](http://localhost:9000)
99
type = "sui"
1010
image = "mysten/sui-tools:mainnet" # if omitted default is mysten/sui-tools:devnet
1111
contracts_dir = "$your_dir"
12+
image_platform = "linux/amd64" # default one
1213
```
1314

1415
## Usage

framework/.changeset/v0.9.5.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Sui image platform param

framework/components/blockchain/blockchain.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ type Input struct {
5858
// GAPv2 specific params
5959
HostNetworkMode bool `toml:"host_network_mode"`
6060
CertificatesPath string `toml:"certificates_path"`
61+
62+
// Optional params
63+
ImagePlatform *string `toml:"image_platform"`
6164
}
6265

6366
// Output is a blockchain network output, ChainID and one or more nodes that forms the network

framework/components/blockchain/sui.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ func newSui(in *Input) (*Output, error) {
9999

100100
bindPort := fmt.Sprintf("%s/tcp", in.Port)
101101

102+
// default to amd64, unless otherwise specified
103+
imagePlatform := "linux/amd64"
104+
if in.ImagePlatform != nil {
105+
imagePlatform = *in.ImagePlatform
106+
}
107+
102108
req := testcontainers.ContainerRequest{
103109
Image: in.Image,
104110
ExposedPorts: []string{in.Port, DefaultFaucetPort},
@@ -112,7 +118,7 @@ func newSui(in *Input) (*Output, error) {
112118
h.PortBindings = framework.MapTheSamePort(bindPort, DefaultFaucetPort)
113119
framework.ResourceLimitsFunc(h, in.ContainerResources)
114120
},
115-
ImagePlatform: "linux/amd64",
121+
ImagePlatform: imagePlatform,
116122
Env: map[string]string{
117123
"RUST_LOG": "off,sui_node=info",
118124
},

0 commit comments

Comments
 (0)