Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions infrastructure/docker/Dockerfile.bidderemulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.23.0-alpine AS builder

WORKDIR /app

COPY p2p/go.mod p2p/go.sum /app/p2p/
COPY x/go.mod x/go.sum /app/x/
COPY contracts-abi/go.mod contracts-abi/go.sum /app/contracts-abi/

RUN cd /app/p2p && go mod download
RUN cd /app/x && go mod download
RUN cd /app/contracts-abi && go mod download

COPY . .

RUN go build -o /app/bidder-emulator ./p2p/integrationtest/real-bidder

FROM alpine:3.10

COPY --from=builder /app/bidder-emulator /usr/local/bin/bidder-emulator
COPY --from=builder /app/p2p/integrationtest/real-bidder/entrypoint.sh entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
25 changes: 25 additions & 0 deletions infrastructure/docker/Dockerfile.l1transactor
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.23.0-alpine AS builder

WORKDIR /app

COPY tools/go.mod tools/go.sum /app/tools/
COPY p2p/go.mod p2p/go.sum /app/p2p/
COPY x/go.mod x/go.sum /app/x/
COPY contracts-abi/go.mod contracts-abi/go.sum /app/contracts-abi/
COPY bridge/standard/go.mod bridge/standard/go.sum /app/bridge/standard/

RUN cd /app/tools && go mod download
RUN cd /app/x && go mod download
RUN cd /app/contracts-abi && go mod download
RUN cd /app/p2p && go mod download
RUN cd /app/bridge/standard && go mod download

COPY . .

RUN go build -o /app/l1-transactor ./tools/l1-transaction-emulator

FROM alpine:3.10

COPY --from=builder /app/l1-transactor /usr/local/bin/l1-transactor

ENTRYPOINT ["l1-transactor"]
22 changes: 22 additions & 0 deletions infrastructure/docker/Dockerfile.provideremulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.23.0-alpine AS builder

WORKDIR /app

COPY p2p/go.mod p2p/go.sum /app/p2p/
COPY x/go.mod x/go.sum /app/x/
COPY contracts-abi/go.mod contracts-abi/go.sum /app/contracts-abi/

RUN cd /app/p2p && go mod download
RUN cd /app/x && go mod download
RUN cd /app/contracts-abi && go mod download

COPY . .

RUN go build -o /app/provider-emulator ./p2p/integrationtest/provider

FROM alpine:3.10

COPY --from=builder /app/provider-emulator /usr/local/bin/provider-emulator
COPY --from=builder /app/p2p/integrationtest/provider/entrypoint.sh entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
25 changes: 25 additions & 0 deletions infrastructure/docker/Dockerfile.relayemulator
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.23.0-alpine AS builder

WORKDIR /app

COPY tools/go.mod tools/go.sum /app/tools/
COPY p2p/go.mod p2p/go.sum /app/p2p/
COPY x/go.mod x/go.sum /app/x/
COPY contracts-abi/go.mod contracts-abi/go.sum /app/contracts-abi/
COPY bridge/standard/go.mod bridge/standard/go.sum /app/bridge/standard/

RUN cd /app/tools && go mod download
RUN cd /app/x && go mod download
RUN cd /app/contracts-abi && go mod download
RUN cd /app/bridge/standard && go mod download
RUN cd /app/p2p && go mod download

COPY . .

RUN go build -o /app/relay-emulator ./tools/relay-emulator

FROM alpine:3.10

COPY --from=builder /app/relay-emulator /usr/local/bin/relay-emulator

ENTRYPOINT ["relay-emulator"]
32 changes: 32 additions & 0 deletions p2p/integrationtest/provider/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

EMULATOR_LOG_LEVEL=${EMULATOR_LOG_LEVEL:-"debug"}
EMULATOR_LOG_FMT=${EMULATOR_LOG_FMT:-"json"}

flags="-log-level $EMULATOR_LOG_LEVEL -log-fmt $EMULATOR_LOG_FMT"

if [ -n "$EMULATOR_LOG_TAGS" ]; then
flags="$flags -log-tags $EMULATOR_LOG_TAGS"
fi

if [ -n "$EMULATOR_IP_RPC_PORT" ]; then
flags="$flags -server-addr $EMULATOR_IP_RPC_PORT"
fi

if [ -n "$EMULATOR_METRICS_PORT" ]; then
flags="$flags -http-port $EMULATOR_METRICS_PORT"
fi

if [ -n "$EMULATOR_RELAY_URL" ]; then
flags="$flags -relay $EMULATOR_RELAY_URL"
fi

if [ -n "$EMULATOR_ERROR_PROBABILITY" ]; then
flags="$flags -error-probability $EMULATOR_ERROR_PROBABILITY"
fi

if [ -n "$EMULATOR_OTEL_COLLECTOR_ENDPOINT_URL" ]; then
flags="$flags -otel-collector-endpoint-url $EMULATOR_OTEL_COLLECTOR_ENDPOINT_URL"
fi

provider-emulator $flags
3 changes: 2 additions & 1 deletion p2p/integrationtest/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
logTagsFlagName = "log-tags"
httpPortFlagName = "http-port"
errorProbabilityFlagName = "error-probability"
relayFlagName = "relay"
)

var (
Expand Down Expand Up @@ -71,7 +72,7 @@ var (
"The probability of returning an error when sending a bid response",
)
relay = flag.String(
"relay",
relayFlagName,
"",
"Relay address",
)
Expand Down
29 changes: 29 additions & 0 deletions p2p/integrationtest/real-bidder/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

EMULATOR_LOG_LEVEL=${EMULATOR_LOG_LEVEL:-"debug"}
EMULATOR_LOG_FMT=${EMULATOR_LOG_FMT:-"json"}
EMULATOR_BID_WORKERS=${EMULATOR_BID_WORKERS:-"1"}

flags="-log-level $EMULATOR_LOG_LEVEL -log-fmt $EMULATOR_LOG_FMT -bid-workers $EMULATOR_BID_WORKERS"

if [ -n "$EMULATOR_LOG_TAGS" ]; then
flags="$flags -log-tags $EMULATOR_LOG_TAGS"
fi

if [ -n "$EMULATOR_IP_RPC_PORT" ]; then
flags="$flags -server-addr $EMULATOR_IP_RPC_PORT"
fi

if [ -n "$EMULATOR_METRICS_PORT" ]; then
flags="$flags -http-port $EMULATOR_METRICS_PORT"
fi

if [ -n "$EMULATOR_OTEL_COLLECTOR_ENDPOINT_URL" ]; then
flags="$flags -otel-collector-endpoint-url $EMULATOR_OTEL_COLLECTOR_ENDPOINT_URL"
fi

if [ -n "$EMULATOR_L1_RPC_URL" ]; then
flags="$flags -rpc-addr $EMULATOR_L1_RPC_URL"
fi

bidder-emulator $flags
2 changes: 1 addition & 1 deletion p2p/integrationtest/real-bidder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
)
rpcAddr = flag.String(
"rpc-addr",
"localhost:13524",
"localhost:8545",
"The server address in the format of host:port",
)
logLevel = flag.String(
Expand Down
Loading