Skip to content

Commit

Permalink
Revert "log local testnet gateway logs to file (#2118)" (#2126)
Browse files Browse the repository at this point in the history
This reverts commit a98ee3d.
  • Loading branch information
zkokelj authored Nov 5, 2024
1 parent c6a05ca commit 1d764e0
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 8 deletions.
12 changes: 6 additions & 6 deletions testnet/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ services:
dockerfile: ./dockerfiles/enclave.Dockerfile
args:
TESTMODE: true
# enclave-debug:
# image: "testnetobscuronet.azurecr.io/obscuronet/enclave_debug:latest"
# build:
# context: $ROOT_PATH
# dockerfile: ./dockerfiles/enclave.debug.Dockerfile
# enclave-debug:
# image: "testnetobscuronet.azurecr.io/obscuronet/enclave_debug:latest"
# build:
# context: $ROOT_PATH
# dockerfile: ./dockerfiles/enclave.debug.Dockerfile
ten-scan:
image: "testnetobscuronet.azurecr.io/obscuronet/tenscan:latest"
build:
Expand All @@ -38,7 +38,7 @@ services:
image: "testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway:latest"
build:
context: $ROOT_PATH
dockerfile: ./tools/walletextension/enclave.Dockerfile
dockerfile: ./tools/walletextension/Dockerfile
faucet:
image: "testnetobscuronet.azurecr.io/obscuronet/faucet:latest"
build:
Expand Down
2 changes: 1 addition & 1 deletion testnet/launcher/gateway/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (n *DockerGateway) Start() error {
fmt.Printf("Starting gateway with config: \n%s\n\n", litter.Sdump(*n.cfg))

cmds := []string{
"ego", "run", "/home/ten/go-ten/tools/walletextension/main/main",
"/home/obscuro/go-obscuro/tools/walletextension/bin/wallet_extension_linux",
"--host", "0.0.0.0",
"--port", fmt.Sprintf("%d", n.cfg.gatewayHTTPPort),
"--portWS", fmt.Sprintf("%d", n.cfg.gatewayWSPort),
Expand Down
2 changes: 1 addition & 1 deletion testnet/testnet-local-build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ command docker build -t testnetobscuronet.azurecr.io/obscuronet/enclave:latest -
#command docker build -t testnetobscuronet.azurecr.io/obscuronet/enclave_debug:latest -f "${root_path}/dockerfiles/enclave.debug.Dockerfile" "${root_path}" &
command docker build -t testnetobscuronet.azurecr.io/obscuronet/tenscan:latest -f "${tools_path}/tenscan/Dockerfile" "${root_path}" &
command docker build -t testnetobscuronet.azurecr.io/obscuronet/faucet:latest -f "${tools_path}/faucet/Dockerfile" "${root_path}" &
#command docker build -t testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway:latest -f "${tools_path}/walletextension/enclave.Dockerfile" "${root_path}" &
command docker build -t testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway:latest -f "${tools_path}/walletextension/Dockerfile" "${root_path}" &

wait

51 changes: 51 additions & 0 deletions tools/walletextension/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Build Stages:
# system = prepares the "OS" by downloading required binaries
# get-dependencies = downloads the go modules using the prepared system
# build-wallet = copies over the source code and builds the binaries using a compiler cache
# final = copies over only the executables in an alpine image that doesn't have any additional load.

FROM golang:1.22.1-alpine3.19 as system

# set the base libs to build / run
RUN apk add build-base bash git
ENV CGO_ENABLED=1
ARG TESTNET_TYPE

# Standard build stage that initializes the go dependencies
FROM system as get-dependencies
# create the base directory
# setup container data structure
RUN mkdir -p /home/obscuro/go-obscuro


# Ensures container layer caching when dependencies are not changed
WORKDIR /home/obscuro/go-obscuro
COPY go.mod .
COPY go.sum .
RUN go mod download

# Build stage that will create a wallet extension executable
FROM get-dependencies as build-wallet
# make sure the geth network code is available
COPY . /home/obscuro/go-obscuro

# build the gateway executable
WORKDIR /home/obscuro/go-obscuro/tools/walletextension/main
RUN --mount=type=cache,target=/root/.cache/go-build \
go build -o ../bin/wallet_extension_linux

# Lightweight final build stage. Includes bare minimum to start wallet extension
FROM alpine:3.18

# copy over the gateway executable
COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/bin /home/obscuro/go-obscuro/tools/walletextension/bin

# copy over the .sql migration files
COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/storage/database /home/obscuro/go-obscuro/tools/walletextension/storage/database

# copy over the entrypoint script
COPY --from=build-wallet /home/obscuro/go-obscuro/tools/walletextension/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 1d764e0

Please sign in to comment.