From 754eb7de3979096bc162136448cb637cf2524079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keszey=20D=C3=A1niel?= Date: Fri, 18 Oct 2024 09:00:18 +0200 Subject: [PATCH 1/2] deactivate rbuilder --- Dockerfile | 16 +++--- packages/protocol/scripts/setup_deps.sh | 74 ++++++++++++------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3a6514d0ef04..777a3d8834fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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"] diff --git a/packages/protocol/scripts/setup_deps.sh b/packages/protocol/scripts/setup_deps.sh index d787319b97b6..9756af6765de 100755 --- a/packages/protocol/scripts/setup_deps.sh +++ b/packages/protocol/scripts/setup_deps.sh @@ -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: //') From f62801d28c1bce5eb6852850177e41d43d633a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keszey=20D=C3=A1niel?= Date: Wed, 23 Oct 2024 18:39:45 +0200 Subject: [PATCH 2/2] more uncomment --- packages/protocol/scripts/setup_deps.sh | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/protocol/scripts/setup_deps.sh b/packages/protocol/scripts/setup_deps.sh index 9756af6765de..6a8cbf2be15d 100755 --- a/packages/protocol/scripts/setup_deps.sh +++ b/packages/protocol/scripts/setup_deps.sh @@ -139,22 +139,22 @@ else echo "Found container ID: $CONTAINER_ID" fi -# Check if the file exists in the container -FILE_PATH="/app/rbuilder/config-gwyneth-reth.toml" -if ! docker exec "$CONTAINER_ID" test -f "$FILE_PATH"; then - echo "File $FILE_PATH does not exist in the container." - exit 1 -fi +# # Check if the file exists in the container +# FILE_PATH="/app/rbuilder/config-gwyneth-reth.toml" +# if ! docker exec "$CONTAINER_ID" test -f "$FILE_PATH"; then +# echo "File $FILE_PATH does not exist in the container." +# exit 1 +# fi -# Update the cl_node_url in the file, regardless of its current content -ESCAPED_URL=$(echo "$BEACON_HTTP_URL" | sed 's/[\/&]/\\&/g') -UPDATE_COMMAND="sed -i '/^cl_node_url[[:space:]]*=/c\cl_node_url = [\"$ESCAPED_URL\"]' $FILE_PATH" -if docker exec "$CONTAINER_ID" sh -c "$UPDATE_COMMAND"; then - echo "Successfully updated $FILE_PATH in the container." -else - echo "Failed to update $FILE_PATH in the container." - exit 1 -fi +# # Update the cl_node_url in the file, regardless of its current content +# ESCAPED_URL=$(echo "$BEACON_HTTP_URL" | sed 's/[\/&]/\\&/g') +# UPDATE_COMMAND="sed -i '/^cl_node_url[[:space:]]*=/c\cl_node_url = [\"$ESCAPED_URL\"]' $FILE_PATH" +# if docker exec "$CONTAINER_ID" sh -c "$UPDATE_COMMAND"; then +# echo "Successfully updated $FILE_PATH in the container." +# else +# echo "Failed to update $FILE_PATH in the container." +# exit 1 +# fi # Verify the change VERIFY_COMMAND="grep 'cl_node_url' $FILE_PATH"