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

Wrapper Process for Erigon #289

Merged
merged 10 commits into from
Sep 27, 2024
Merged

Wrapper Process for Erigon #289

merged 10 commits into from
Sep 27, 2024

Conversation

praetoriansentry
Copy link
Collaborator

@praetoriansentry praetoriansentry commented Sep 26, 2024

Description

In several of our manual test procedures, we need a way to stop Erigon, but keep the container alive so that we can do an unwind or some other operations within the container. In an ideal world, I think the data on disk would ideally be in a volume so that we could just kill the container. We don't have that setup right now.

The PR creates a proc-runner.sh Bourne Shell (not bash) script that starts a child process. If that child process dies, this process will also exit properly. However, if we send a SIGTRAP signal to the to the parent process, the child will be gracefully terminated and then a new child process will be started that runs tail -f /dev/null. The idea is to have something that runs forever and keeps the container up and running.

image

In addition to the process manager, there are a few other changes:

  • We've tried to standardize on rpc and ws-rpc for the port names for RPC and websockets (fyi @vcastellm )
  • Updated to the latest version of the bridge service (fyi (@ARR552 )
  • Whitespace cleanup on the config file
  • Adding the sanity check URL with a temporary configuration that points directly to the sequencer URL

@praetoriansentry praetoriansentry marked this pull request as ready for review September 27, 2024 00:46
Copy link
Collaborator

@cffls cffls left a comment

Choose a reason for hiding this comment

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

LGTM

@praetoriansentry praetoriansentry merged commit df5eb26 into main Sep 27, 2024
18 checks passed
@praetoriansentry praetoriansentry deleted the jhilliard/process-manager branch September 27, 2024 02:46
@@ -38,7 +38,7 @@ jobs:

- name: Monitor verified batches (CDK Erigon Permissionless RPC)
working-directory: .github/scripts
run: ./monitor-verified-batches.sh --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-node-001 http-rpc)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@vcastellm
Copy link
Contributor

What it will take to go to the ideal world and maintain the data in a volume?

@praetoriansentry
Copy link
Collaborator Author

What it will take to go to the ideal world and maintain the data in a volume?

Good question. So it's already technically possible. The data directory, or whatever directory we want access to, would need to be running within a Kurtosis Directory. If you do that, your data is in a docker volume.

The challenge is finding where that volume is ultimately mounted on your host OS. It's pretty easy on linux, but I'm not sure how easy / hard it would be in the mac Docker Desktop setup. In my case..

  1. Get a container name that you're interested in messing with
  2. Check its mount points docker inspect cdk-erigon-sequencer-001--8771f8c91967470ea69f44756a8a9ef5 | jq '.[].Mounts'
  3. Start hacking away.

I didn't opt for this solution because it's a little tricky to do and it also doesn't help in some of the other testing scenarios that I do. Docker volumes would work will if the data directory is in a volume and we want to run some commands against the data from the host OS... But that requires that whatever tools that you need are actually in the host OS. A lot of the tools are actually in the container, so it's actually more convenient to run the command from within the container. The other benefit of this setup is we can do weird stuff like updating the version of the binary in the container without changing the image!! E.g. in order to test a new feature before a container is created, I can build a new version of the binary, stop the process, and docker cp the new binary in place. It's complicated, but helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants