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

Create Go supervisor #80

Closed
19 tasks done
torives opened this issue Sep 8, 2023 · 5 comments
Closed
19 tasks done

Create Go supervisor #80

torives opened this issue Sep 8, 2023 · 5 comments
Assignees
Labels
! High priority epic A issue with several steps #feat:go-supervisor Feature: Go supervisor
Milestone

Comments

@torives
Copy link
Contributor

torives commented Sep 8, 2023

📚 Context

Running a node right now requires the orchestration of several Docker containers. For testing, running locally, and/or deploying in a VPS a simpler option is desirable.

Original issue/discussion: #26

✔️ Solution

Create a single binary to execute all of our services. All service configuration should be done via environment variables, as the binary will have just a single parameter defining its execution mode: reader, validator, full (reader+validator), or host.

It will forward each service's stdout and stderr to its own stdout and stderr, similar to what is currently done when running the node using the docker-compose.yml file.

Although server-manager is not a service built in this repository, it will also be executed by the binary: it will assume it is installed in the system and available in the PATH.

It will also assume the Redis, PostgreSQL, and Hardhat services are already running and ready to connect by the time it starts.

📈 Subtasks

@torives torives added the epic A issue with several steps label Sep 8, 2023
@torives torives added this to the 1.1.0 milestone Sep 8, 2023
@torives torives self-assigned this Sep 8, 2023
@torives torives added this to Node Unit Sep 8, 2023
@torives torives moved this to 🏗 In progress in Node Unit Sep 8, 2023
@gligneul
Copy link
Contributor

gligneul commented Sep 8, 2023

We could rename host mode to backendless mode, following the idea of sunodo.

@endersonmaia
Copy link
Contributor

Create a single binary to execute all of our services....

It will forward each service's stdout and stderr to its own stdout and stderr ...

Are you planning to create another process/service supervisor? Why not reuse some existing software that already does this?

For sunodo/rollups-node, we're using s6-overlay,, but there are a lot of other options if you think s6 is not a fit.

The choice for s6 was 'cause it's made for running inside containers and it's very light.

@endersonmaia
Copy link
Contributor

Since you're considering migrating some code to golang, maybe this supervisord golang implementation is an option.

@gligneul
Copy link
Contributor

We want to do something much simpler than a supervisor. And, as we rewrite code in Go, we will replace the external binaries with Go packages. So, in the end, there won't be any "supervisor" code left.

@gligneul gligneul modified the milestones: 1.1.0, 1.2.0 Sep 15, 2023
@torives torives removed their assignment Sep 18, 2023
@torives torives mentioned this issue Sep 18, 2023
4 tasks
@gligneul
Copy link
Contributor

Suggestion for the supervisor code using goroutines: https://gist.github.com/gligneul/dafa46f3e778888e108da13aa2d89d17

@torives torives moved this from 🏗 In progress to 📋 Backlog in Node Unit Sep 27, 2023
@gligneul gligneul moved this from 📋 Backlog to 🏗 In progress in Node Unit Oct 2, 2023
@gligneul gligneul modified the milestones: 1.2.0, 1.3.0 Nov 6, 2023
@gligneul gligneul assigned renan061, torives and gligneul and unassigned renan061 Nov 8, 2023
@gligneul gligneul removed their assignment Nov 14, 2023
@gligneul gligneul self-assigned this Nov 14, 2023
@gligneul gligneul added the #feat:go-supervisor Feature: Go supervisor label Nov 16, 2023
@gligneul gligneul added the ! High priority label Dec 8, 2023
@gligneul gligneul changed the title Create a single node binary Create Go supervisor Dec 13, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Node Unit Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
! High priority epic A issue with several steps #feat:go-supervisor Feature: Go supervisor
Projects
Archived in project
Development

No branches or pull requests

4 participants