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

feat: add docker configuration for the simulator #416

Merged
merged 8 commits into from
Dec 31, 2024

Conversation

georgi-l95
Copy link
Contributor

Description:

This PR simplifies the simulator development process by introducing Docker containerization and improves documentation clarity.

  • Add Docker setup for simulator components
  • Add new Gradle task startSimulatorDockerContainers
  • Reorganize configuration documentation with consistent table format
  • Simplify metrics viewing process in quickstart guide

The changes streamline the development process by replacing manual configuration steps with automated Docker container setup, making it easier for users to run and monitor the simulator in both Publisher and Consumer modes.

Related issue(s):

Fixes #412

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@georgi-l95 georgi-l95 added the Simulator Issue related to Block Stream Simulator label Dec 17, 2024
@georgi-l95 georgi-l95 added this to the 0.4.0 milestone Dec 17, 2024
@georgi-l95 georgi-l95 self-assigned this Dec 17, 2024
@georgi-l95 georgi-l95 requested a review from a team as a code owner December 17, 2024 13:29
@georgi-l95 georgi-l95 linked an issue Dec 17, 2024 that may be closed by this pull request
Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

I believe changes must be made to match the agreed upon team convention for making gradle tasks.

server/docs/configuration.md Outdated Show resolved Hide resolved
simulator/build.gradle.kts Outdated Show resolved Hide resolved
simulator/docker/docker-compose.yml Outdated Show resolved Hide resolved
simulator/build.gradle.kts Show resolved Hide resolved
simulator/build.gradle.kts Outdated Show resolved Hide resolved
simulator/docker/docker-compose.yml Outdated Show resolved Hide resolved
simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
simulator/docs/configuration.md Outdated Show resolved Hide resolved
simulator/build.gradle.kts Outdated Show resolved Hide resolved
simulator/build.gradle.kts Outdated Show resolved Hide resolved
@georgi-l95 georgi-l95 force-pushed the 412-add-docker-configuration-for-the-simulator branch from 72a5eb0 to 453f534 Compare December 17, 2024 14:41
Copy link
Member

@jsync-swirlds jsync-swirlds left a comment

Choose a reason for hiding this comment

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

Just a couple minor (non-blocking) items.

server/docker/metrics/prometheus.yml Outdated Show resolved Hide resolved
simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
Signed-off-by: georgi-l95 <[email protected]>

improve dockerfile

Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>

cleanup docker setup

Signed-off-by: georgi-l95 <[email protected]>

rework documentation

Signed-off-by: georgi-l95 <[email protected]>

spotless

Signed-off-by: georgi-l95 <[email protected]>

fix conflicts

Signed-off-by: georgi-l95 <[email protected]>

address feedback

Signed-off-by: georgi-l95 <[email protected]>

revert documentation improvements

Signed-off-by: georgi-l95 <[email protected]>

revert docs

Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>

remove docker compose version

Signed-off-by: georgi-l95 <[email protected]>

add update-env script

Signed-off-by: georgi-l95 <[email protected]>

rename file

Signed-off-by: georgi-l95 <[email protected]>

simplify docs

Signed-off-by: georgi-l95 <[email protected]>

update order

Signed-off-by: georgi-l95 <[email protected]>
@georgi-l95 georgi-l95 force-pushed the 412-add-docker-configuration-for-the-simulator branch from 1ca124a to c391d57 Compare December 19, 2024 13:01
Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

Much improved @georgi-l95.
A few more things I think we should do, described below, but here the gist of it:

  1. Add startDockerContainerDebug and stopDockerContainer
  2. We can remove the prepare-docker.sh and simplify a lot the process
  3. The copying of resources in the prepare-docker.sh must be extracted and done in the copy task in gradle which you created.
  4. We can very easily add some conditional logic to the update-env.sh to enable debugging for example.

The inspiration is coming from server.

simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
simulator/docker/docker-compose.yml Outdated Show resolved Hide resolved
simulator/docker/docker-compose.yml Outdated Show resolved Hide resolved
simulator/docker/update-env.sh Show resolved Hide resolved
simulator/docker/prepare-docker.sh Outdated Show resolved Hide resolved
simulator/build.gradle.kts Show resolved Hide resolved
server/build.gradle.kts Outdated Show resolved Hide resolved
@georgi-l95 georgi-l95 requested a review from ata-nas December 19, 2024 21:27
@jsync-swirlds
Copy link
Member

Quick note. Consensus teams were looking to use the simulator for their own testing, and found the readme and quickstart woefully outdated.
Would you mind creating an issue to update those documents after this PR merges to reflect all of the recent changes?

Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

@georgi-l95 this looks amazing!

However I would suggest to revert the createDotEnv chagnes and simply call the ./update-env.sh directly at the startDockerContainer task. This simplifies things a lot and we do not touch things that are planned to be removed because were a temporary workaround.

server/build.gradle.kts Outdated Show resolved Hide resolved
simulator/build.gradle.kts Outdated Show resolved Hide resolved
suites/build.gradle.kts Outdated Show resolved Hide resolved
Signed-off-by: georgi-l95 <[email protected]>
@georgi-l95 georgi-l95 requested a review from ata-nas December 19, 2024 22:00
@georgi-l95
Copy link
Contributor Author

Quick note. Consensus teams were looking to use the simulator for their own testing, and found the readme and quickstart woefully outdated. Would you mind creating an issue to update those documents after this PR merges to reflect all of the recent changes?

Yes, I've noticed that too, mostly about configuration and opened a issue couple of days ago. #407

ata-nas
ata-nas previously approved these changes Dec 19, 2024
Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

@georgi-l95 looks great!

suites/build.gradle.kts Outdated Show resolved Hide resolved
Signed-off-by: georgi-l95 <[email protected]>
Copy link
Contributor

@ata-nas ata-nas left a comment

Choose a reason for hiding this comment

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

Looks good! 🔥

Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM

@AlfredoG87 AlfredoG87 merged commit 287adeb into main Dec 31, 2024
9 checks passed
@AlfredoG87 AlfredoG87 deleted the 412-add-docker-configuration-for-the-simulator branch December 31, 2024 16:33
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.77%. Comparing base (3ad4efc) to head (676cc96).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #416   +/-   ##
=========================================
  Coverage     96.77%   96.77%           
  Complexity      409      409           
=========================================
  Files            82       82           
  Lines          1458     1458           
  Branches         90       90           
=========================================
  Hits           1411     1411           
  Misses           34       34           
  Partials         13       13           

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

Successfully merging this pull request may close these issues.

Add Docker configuration for the Simulator
4 participants