Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate beacond connected to bArtio via docker #1848

Merged
merged 11 commits into from
Aug 20, 2024
Merged

Conversation

nidhi-singh02
Copy link
Contributor

@nidhi-singh02 nidhi-singh02 commented Aug 6, 2024

Summary by CodeRabbit

  • New Features
    • Introduced a Dockerized management system for the beacond service, facilitating easier builds and deployment.
    • Added functionality to check for existing Docker images, improving efficiency.
    • Implemented new targets for building the beacond Docker image and starting the service with customizable parameters.
    • Enhanced operational capabilities with options for enabling the API and configuring logging levels.

Copy link
Contributor

coderabbitai bot commented Aug 6, 2024

Walkthrough

The recent changes enhance the build/scripts/testing.mk Makefile by introducing comprehensive support for a Dockerized beacond service. This update adds new targets for building the Docker image and starting the service, along with essential environment variables and checks for existing images. Overall, these improvements streamline the automation and efficiency of deploying the service within a Docker environment.

Changes

Files Change Summary
build/scripts/testing.mk Introduced new targets build-beacond-image and start-bartio-docker for managing the beacond service in Docker. Added variables: IP_ADDRESS, RPC_URL, IMAGE_NAME, VERSION, and IMAGE_EXISTS for configuration and image management.

Poem

In a world of code where rabbits leap,
A Docker tale we’re here to keep.
With beacond built, we’re set to go,
Automation's dance, a joyful flow!
So hop along, let containers spin,
A new era of testing, let the fun begin! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 21.86%. Comparing base (f178f05) to head (b31dd8f).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1848   +/-   ##
=======================================
  Coverage   21.86%   21.86%           
=======================================
  Files         347      347           
  Lines       15759    15759           
  Branches       21       21           
=======================================
  Hits         3446     3446           
  Misses      12197    12197           
  Partials      116      116           

@nidhi-singh02 nidhi-singh02 force-pushed the start-full-node branch 2 times, most recently from 5012d82 to f4ae53f Compare August 9, 2024 07:52
Makefile Outdated
@@ -11,6 +11,7 @@ include build/scripts/testing.mk
include contracts/Makefile
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the pre-requisites steps are listed in the fullnode.mk file. To mount these files such as config.toml and genesis.json, building the binary won't help.
So thinking to spin up beacond using docker containers to be able to mount volumes.

Makefile Outdated Show resolved Hide resolved
@nidhi-singh02 nidhi-singh02 force-pushed the start-full-node branch 3 times, most recently from 652e87a to cbe7968 Compare August 14, 2024 05:48
@nidhi-singh02 nidhi-singh02 changed the title Start a full node with geth and beacond connected to a network Integrate beacond connected to bArtio via docker Aug 14, 2024
@nidhi-singh02 nidhi-singh02 marked this pull request as ready for review August 14, 2024 06:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 5813e7b and fb02e71148fa7b8c7ebd60adb35eff141018ba32.

Files selected for processing (1)
  • build/scripts/testing.mk (1 hunks)
Additional comments not posted (5)
build/scripts/testing.mk (5)

50-50: LGTM!

The RPC_URL variable is correctly constructed using the IP_ADDRESS.


51-52: LGTM!

The IMAGE_NAME and VERSION variables are appropriately defined for Docker image management.


54-54: LGTM!

The IMAGE_EXISTS variable is correctly set up to check for the existence of the Docker image.


49-49: Verify the IP address selection logic.

The IP_ADDRESS variable uses hostname -I to get the first IP address. Ensure this is the correct IP address for your use case, as environments with multiple network interfaces might yield unexpected results.


56-62: LGTM! But verify make build-docker is defined.

The build-beacond-image target uses conditional logic effectively. Ensure that the make build-docker command is defined and correctly implemented elsewhere in the Makefile.

Verification successful

make build-docker is defined

The build-docker target is defined in the build/scripts/build.mk file, confirming that the build-beacond-image target can successfully invoke it. No further action is needed.

  • build/scripts/build.mk: build-docker: ## build a docker image containing beacond
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `make build-docker` is defined in the Makefile.

# Test: Search for the `build-docker` target definition.
rg --type makefile '^build-docker:'

Length of output: 70


Script:

#!/bin/bash
# Find all Makefile-related files and search for the `build-docker` target definition.
fd -e mk -e Makefile | xargs rg '^build-docker:'

Length of output: 132

build/scripts/testing.mk Show resolved Hide resolved
build/scripts/testing.mk Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range comments (2)
build/scripts/testing.mk (2)

Line range hint 154-156:
Remove redundant --rm option.

The --rm option is specified twice for different volume mounts in the start-geth-bartio target. It should be specified only once.

-	--rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \
-	--rm -v $(PWD)/${BARTIO_NETWORK_FILES_DIR}:/${BARTIO_NETWORK_FILES_DIR} \
+	--rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \
+	-v $(PWD)/${BARTIO_NETWORK_FILES_DIR}:/${BARTIO_NETWORK_FILES_DIR} \

Line range hint 198-200:
Remove redundant --rm option.

The --rm option is specified twice for different volume mounts in the start-erigon target. It should be specified only once.

-	--rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \
-	--rm -v $(PWD)/.tmp:/.tmp \
+	--rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \
+	-v $(PWD)/.tmp:/.tmp \
Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between fb02e71148fa7b8c7ebd60adb35eff141018ba32 and 1dab360f709bbccc84559eefdcb39dd2ac3fd414.

Files selected for processing (1)
  • build/scripts/testing.mk (1 hunks)
Additional comments not posted (6)
build/scripts/testing.mk (6)

46-47: Reminder: Address the TODO comment for snapshot restoration.

The TODO comment indicates missing documentation or steps for restoring snapshots.


49-54: Introduction of new environment variables is appropriate.

The new variables are essential for configuring the Docker environment and managing the beacond image.


56-63: Conditional Docker image building logic is efficient.

The logic to check for the image's existence before building optimizes the build process.


64-83: Comprehensive Docker run configuration is effective.

The start-bartio-docker target includes necessary volume mounts and environment configurations, enhancing the service's operational capabilities.


85-85: Comment on IPC support limitations is informative.

The comment provides useful information about the current limitations of IPC support.


Line range hint 109-111:
Remove redundant --rm option.

The --rm option is specified twice for different volume mounts in the start-reth-bartio target. It should be specified only once.

Signed-off-by: nidhi-singh02 <[email protected]>
Signed-off-by: nidhi-singh02 <[email protected]>
Signed-off-by: nidhi-singh02 <[email protected]>
Signed-off-by: nidhi-singh02 <[email protected]>
Signed-off-by: nidhi-singh02 <[email protected]>
Signed-off-by: nidhi-singh02 <[email protected]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 1dab360f709bbccc84559eefdcb39dd2ac3fd414 and da99c67.

Files selected for processing (1)
  • build/scripts/testing.mk (1 hunks)
Additional comments not posted (4)
build/scripts/testing.mk (4)

85-85: Informative comment on start-ipc.

The comment provides necessary context for the start-ipc target.


56-63: Efficient Docker image management.

The build-beacond-image target efficiently avoids unnecessary rebuilds using IMAGE_EXISTS.

Ensure that the build-docker target is correctly defined and functional.

Verification successful

Verified: build-docker target is correctly defined and used.

The build-docker target is defined in build/scripts/build.mk and is utilized in various Makefiles, indicating proper integration and functionality.

  • build/scripts/build.mk: build-docker target definition.
  • kurtosis/Makefile: Usage of build-docker.
  • build/scripts/testing.mk: Usage of build-docker.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the definition and functionality of `build-docker` target.

# Test: Search for the `build-docker` target. Expect: Correct definition and usage.
rg --type make 'build-docker'

Length of output: 352


49-54: LGTM! Verify the variable usage in the codebase.

The introduction of these variables looks good and is essential for Docker integration.

However, ensure that these variables are used correctly throughout the codebase.

Verification successful

Variables are correctly utilized across the codebase.

The variables IP_ADDRESS, RPC_URL, IMAGE_NAME, VERSION, and IMAGE_EXISTS are consistently and correctly used in the codebase. Their integration into Docker image management and network configuration processes is appropriate.

  • IP_ADDRESS and RPC_URL are used for network configurations.
  • IMAGE_NAME and VERSION are used for Docker image management.
  • IMAGE_EXISTS is used to check the existence of Docker images before building.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new variables in the codebase.

# Test: Search for the usage of each variable. Expect: Consistent and correct usage.
rg --type make 'IP_ADDRESS|RPC_URL|IMAGE_NAME|VERSION|IMAGE_EXISTS'

Length of output: 2301


64-83: Comprehensive Docker run configuration.

The start-bartio-docker target includes a well-structured Docker run command with necessary configurations.

Verify that the Docker run command is executed correctly and all parameters are valid.

Verification successful

Docker run command parameters verified.

The parameters and environment variables used in the start-bartio-docker target are correctly defined and logically structured. This ensures that the Docker run command will execute as intended.

  • TESTAPP_FILES_DIR is set to testing/files.
  • BARTIO_NETWORK_FILES_DIR is set to testing/networks/80084.
  • IMAGE_NAME is beacond.
  • VERSION is kurtosis-local.
  • JWT_PATH is testing/files/jwt.hex.
  • RPC_URL is http://${IP_ADDRESS}:8551.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the execution and parameters of the Docker run command.

# Test: Check for the Docker run command usage. Expect: Correct execution and parameter usage.
rg --type make 'docker run'

Length of output: 862


Script:

#!/bin/bash
# Description: Search for the definitions of variables used in the Docker run command.

# Search for TESTAPP_FILES_DIR definition
rg 'TESTAPP_FILES_DIR\s*:?='

# Search for BARTIO_NETWORK_FILES_DIR definition
rg 'BARTIO_NETWORK_FILES_DIR\s*:?='

# Search for IMAGE_NAME definition
rg 'IMAGE_NAME\s*:?='

# Search for VERSION definition
rg 'VERSION\s*:?='

# Search for JWT_PATH definition
rg 'JWT_PATH\s*:?='

# Search for RPC_URL definition
rg 'RPC_URL\s*:?='

Length of output: 1358

@itsdevbear itsdevbear merged commit d1ddc15 into main Aug 20, 2024
16 checks passed
@itsdevbear itsdevbear deleted the start-full-node branch August 20, 2024 15:21
itsdevbear added a commit that referenced this pull request Aug 20, 2024
itsdevbear added a commit that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants