Skip to content

Commit 1c6d9a1

Browse files
committed
add ctx
1 parent 7269cc1 commit 1c6d9a1

File tree

24 files changed

+96
-145
lines changed

24 files changed

+96
-145
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Configuration](./framework/developer_environment/toml.md)
77
- [Basic Usage](./framework/getting_started.md)
88
- [Getting Started](./framework/getting_started.md)
9+
- [Running in Kubernetes](./framework/kubernetes.md)
910
- [Advanced Usage](./framework/configuration.md)
1011
- [CLI](./framework/cli.md)
1112
- [Configuration](./framework/configuration.md)

book/src/framework/kubernetes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Running in Kubernetes
2+
3+
Set up Kubernetes context for `main.stage` and add namespace variable to run `devenv`:
4+
```bash
5+
kubectl config use-context staging-eks-admin
6+
export KUBERNETES_NAMESPACE="devenv-1"
7+
```

framework/components/blockchain/anvil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func newAnvil(ctx context.Context, in *Input) (*Output, error) {
5959
framework.L.Info().Any("Cmd", strings.Join(entryPoint, " ")).Msg("Creating anvil with command")
6060

6161
if pods.K8sEnabled() {
62-
_, err := pods.Run(&pods.Config{
62+
_, err := pods.Run(ctx, &pods.Config{
6363
Pods: []*pods.PodConfig{
6464
{
6565
Name: pods.Ptr(in.ContainerName),

framework/components/blockchain/anvil_zksync.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ package blockchain
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"path/filepath"
78
"strings"
89

910
"github.com/testcontainers/testcontainers-go"
1011

1112
"github.com/smartcontractkit/chainlink-testing-framework/framework"
13+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1214
)
1315

1416
var AnvilZKSyncRichAccountPks = []string{
@@ -58,7 +60,7 @@ func newAnvilZksync(ctx context.Context, in *Input) (*Output, error) {
5860

5961
dockerfilePath := filepath.Join(tempDir, "anvilZksync.Dockerfile")
6062

61-
if err := os.WriteFile(dockerfilePath, []byte(dockerFile), 0600); err != nil {
63+
if err := os.WriteFile(dockerfilePath, []byte(dockerFile), 0o600); err != nil {
6264
return nil, err
6365
}
6466

@@ -74,10 +76,15 @@ func newAnvilZksync(ctx context.Context, in *Input) (*Output, error) {
7476
"/root/.foundry/bin/anvil-zksync" +
7577
" --chain-id " + in.ChainID +
7678
" --port " + in.Port +
77-
" --offline"}
79+
" --offline",
80+
}
7881

7982
framework.L.Info().Any("Cmd", strings.Join(req.Entrypoint, " ")).Msg("Creating anvil zkSync with command")
8083

84+
if pods.K8sEnabled() {
85+
return nil, fmt.Errorf("K8s support is not yet implemented")
86+
}
87+
8188
output, err := createGenericEvmContainer(ctx, in, req, false)
8289
if err != nil {
8390
return nil, err

framework/components/blockchain/aptos.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/testcontainers/testcontainers-go/wait"
1313

1414
"github.com/smartcontractkit/chainlink-testing-framework/framework"
15+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1516
)
1617

1718
const (
@@ -87,6 +88,10 @@ func newAptos(ctx context.Context, in *Input) (*Output, error) {
8788
imagePlatform = "linux/amd64"
8889
}
8990

91+
if pods.K8sEnabled() {
92+
return nil, fmt.Errorf("K8s support is not yet implemented")
93+
}
94+
9095
req := testcontainers.ContainerRequest{
9196
Image: in.Image,
9297
ExposedPorts: exposedPorts,

framework/components/blockchain/besu.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package blockchain
22

3-
import "context"
3+
import (
4+
"context"
5+
"fmt"
6+
7+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
8+
)
49

510
const (
611
DefaultBesuPrivateKey1 = "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63"
@@ -50,5 +55,9 @@ func newBesu(ctx context.Context, in *Input) (*Output, error) {
5055
entryPoint := append(defaultCmd, in.DockerCmdParamsOverrides...)
5156
req.Cmd = entryPoint
5257

58+
if pods.K8sEnabled() {
59+
return nil, fmt.Errorf("K8s support is not yet implemented")
60+
}
61+
5362
return createGenericEvmContainer(ctx, in, req, true)
5463
}

framework/components/blockchain/canton.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/testcontainers/testcontainers-go"
1010

1111
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain/canton"
12+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1213
)
1314

1415
const (
@@ -81,6 +82,10 @@ func newCanton(ctx context.Context, in *Input) (*Output, error) {
8182
in.Port = DefaultCantonPort
8283
}
8384

85+
if pods.K8sEnabled() {
86+
return nil, fmt.Errorf("K8s support is not yet implemented")
87+
}
88+
8489
// Set up Postgres container
8590
postgresReq := canton.PostgresContainerRequest(in.NumberOfCantonValidators)
8691
_, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{

framework/components/blockchain/geth.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/docker/docker/api/types/mount"
1010

1111
"github.com/smartcontractkit/chainlink-testing-framework/framework"
12+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1213

1314
"github.com/testcontainers/testcontainers-go"
1415
)
@@ -185,5 +186,9 @@ func newGeth(ctx context.Context, in *Input) (*Output, error) {
185186
}
186187
req.Cmd = entryPoint
187188

189+
if pods.K8sEnabled() {
190+
return nil, fmt.Errorf("K8s support is not yet implemented")
191+
}
192+
188193
return createGenericEvmContainer(ctx, in, req, false)
189194
}

framework/components/blockchain/solana.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/testcontainers/testcontainers-go/wait"
1717

1818
"github.com/smartcontractkit/chainlink-testing-framework/framework"
19+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1920
)
2021

2122
var configYmlRaw = `
@@ -96,6 +97,10 @@ func newSolana(ctx context.Context, in *Input) (*Output, error) {
9697
}, flags...)
9798
args = append(args, in.DockerCmdParamsOverrides...)
9899

100+
if pods.K8sEnabled() {
101+
return nil, fmt.Errorf("K8s support is not yet implemented")
102+
}
103+
99104
req := testcontainers.ContainerRequest{
100105
AlwaysPullImage: in.PullImage,
101106
Image: in.Image,

framework/components/blockchain/stellar.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/testcontainers/testcontainers-go/wait"
1515

1616
"github.com/smartcontractkit/chainlink-testing-framework/framework"
17+
"github.com/smartcontractkit/chainlink-testing-framework/framework/pods"
1718
)
1819

1920
const (
@@ -75,6 +76,10 @@ func newStellar(ctx context.Context, in *Input) (*Output, error) {
7576
cmd = append(cmd, in.DockerCmdParamsOverrides...)
7677
}
7778

79+
if pods.K8sEnabled() {
80+
return nil, fmt.Errorf("K8s support is not yet implemented")
81+
}
82+
7883
req := testcontainers.ContainerRequest{
7984
AlwaysPullImage: in.PullImage,
8085
Image: in.Image,

0 commit comments

Comments
 (0)