Skip to content

Commit

Permalink
deactivate rbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Keszey Dániel authored and Keszey Dániel committed Oct 18, 2024
1 parent e1f6420 commit 754eb7d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin r
# ADD https://worldtimeapi.org/api/ip /tmp/bustcache

# Clone and build rbuilder (gwyneth branch)
RUN git clone -b gwyneth https://github.com/taikoxyz/rbuilder.git /app/rbuilder
WORKDIR /app/rbuilder
RUN cargo build --release
# RUN git clone -b gwyneth https://github.com/taikoxyz/rbuilder.git /app/rbuilder
# WORKDIR /app/rbuilder
# RUN cargo build --release

# Copy binaries to a temporary location
RUN cp /app/target/$BUILD_PROFILE/reth /app/reth
RUN cp /app/rbuilder/target/release/rbuilder /app/rbuilder
# RUN cp /app/rbuilder/target/release/rbuilder /app/rbuilder

# Use Ubuntu as the release image
FROM ubuntu:22.04 AS runtime
Expand All @@ -63,17 +63,17 @@ ENV PATH="/root/.cargo/bin:${PATH}"

# Copy reth and rbuilder binaries over from the build stage
COPY --from=builder /app/reth /usr/local/bin
COPY --from=builder /app/rbuilder /usr/local/bin
# COPY --from=builder /app/rbuilder /usr/local/bin

# Copy the entire rbuilder repository
COPY --from=builder /app/rbuilder /app/rbuilder
# COPY --from=builder /app/rbuilder /app/rbuilder

# Copy licenses
COPY LICENSE-* ./

# Create start script
RUN echo '#!/bin/bash\nrbuilder run /app/rbuilder/config-gwyneth-reth.toml' > /app/start_rbuilder.sh && \
chmod +x /app/start_rbuilder.sh
# RUN echo '#!/bin/bash\nrbuilder run /app/rbuilder/config-gwyneth-reth.toml' > /app/start_rbuilder.sh && \
# chmod +x /app/start_rbuilder.sh

EXPOSE 30303 30303/udp 9001 8545 8546
ENTRYPOINT ["/usr/local/bin/reth"]
74 changes: 37 additions & 37 deletions packages/protocol/scripts/setup_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,43 +180,43 @@ echo "Script execution completed."


# Ensure the log file exists in the current working directory
touch ./rbuilder.log

echo "Starting rbuilder and streaming logs to ./rbuilder.log..."
docker exec -d "$CONTAINER_ID" /bin/bash -c "
/app/start_rbuilder.sh > /tmp/rbuilder.log 2>&1 &
RBUILDER_PID=\$!
tail -f /tmp/rbuilder.log &
TAIL_PID=\$!
wait \$RBUILDER_PID
"

# Start a background process to stream logs from the container to the host file
docker exec "$CONTAINER_ID" tail -f /tmp/rbuilder.log >> ./rbuilder.log &
FILE_LOG_PID=$!

# Start another process to stream logs to the terminal
docker exec "$CONTAINER_ID" tail -f /tmp/rbuilder.log &
TERMINAL_LOG_PID=$!

# Set up a trap to handle Ctrl+C (SIGINT)
trap 'echo "Interrupt received. Stopping terminal log streaming, but file logging continues."; kill $TERMINAL_LOG_PID; exit' INT TERM

echo "rbuilder is running in the container."
echo "Logs are being streamed to ./rbuilder.log and to this terminal."
echo "Press Ctrl+C to stop watching logs in the terminal. rbuilder and file logging will continue."

# Wait for the terminal log streaming to be manually interrupted
wait $TERMINAL_LOG_PID

# Check if rbuilder is still running
if docker exec "$CONTAINER_ID" pgrep -f "/app/start_rbuilder.sh" > /dev/null; then
echo "rbuilder is still running in the container. Logs continue to be written to ./rbuilder.log"
else
echo "rbuilder has stopped unexpectedly."
kill $FILE_LOG_PID
exit 1
fi
# touch ./rbuilder.log

# echo "Starting rbuilder and streaming logs to ./rbuilder.log..."
# docker exec -d "$CONTAINER_ID" /bin/bash -c "
# /app/start_rbuilder.sh > /tmp/rbuilder.log 2>&1 &
# RBUILDER_PID=\$!
# tail -f /tmp/rbuilder.log &
# TAIL_PID=\$!
# wait \$RBUILDER_PID
# "

# # Start a background process to stream logs from the container to the host file
# docker exec "$CONTAINER_ID" tail -f /tmp/rbuilder.log >> ./rbuilder.log &
# FILE_LOG_PID=$!

# # Start another process to stream logs to the terminal
# docker exec "$CONTAINER_ID" tail -f /tmp/rbuilder.log &
# TERMINAL_LOG_PID=$!

# # Set up a trap to handle Ctrl+C (SIGINT)
# trap 'echo "Interrupt received. Stopping terminal log streaming, but file logging continues."; kill $TERMINAL_LOG_PID; exit' INT TERM

# echo "rbuilder is running in the container."
# echo "Logs are being streamed to ./rbuilder.log and to this terminal."
# echo "Press Ctrl+C to stop watching logs in the terminal. rbuilder and file logging will continue."

# # Wait for the terminal log streaming to be manually interrupted
# wait $TERMINAL_LOG_PID

# # Check if rbuilder is still running
# if docker exec "$CONTAINER_ID" pgrep -f "/app/start_rbuilder.sh" > /dev/null; then
# echo "rbuilder is still running in the container. Logs continue to be written to ./rbuilder.log"
# else
# echo "rbuilder has stopped unexpectedly."
# kill $FILE_LOG_PID
# exit 1
# fi

# Extract the path to run-latest.json
RUN_LATEST_PATH=$(echo "$FORGE_OUTPUT" | grep "Transactions saved to:" | sed 's/Transactions saved to: //')
Expand Down

0 comments on commit 754eb7d

Please sign in to comment.