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

fix: adding Hardhat Dockerfile in GitHub Workflow #693

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

epsjunior
Copy link
Contributor

Fixes #692

What

  • Added a hardhat step to the GitHub workflow to build and push a Docker image for the Hardhat service.
  • Configured the step to use the docker-build-and-push-image.yml reusable workflow with appropriate parameters:
    • docker_build_context: .
    • dockerfile: docker/Dockerfile.hardhat
    • dockerhub_repo: yeagerai/simulator-hardhat
    • dockerhub_username: ${{ vars.DOCKERHUB_USERNAME }}
    • dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}

Why

  • To address the issue of missing Hardhat Docker images in the registry.
  • To ensure the Hardhat service is available for CLI and dependent services, aligning it with other Studio services.

Testing done

  • Verified workflow syntax locally.
  • Confirmed similar jobs for other services (e.g., jsonrpc, frontend) function as expected using the reusable workflow.

Decisions made

  • Used the existing reusable workflow for consistency across services.
  • Chose not to add additional Dockerfile-specific testing in this PR, as the reusable workflow already ensures proper image building.

Checks

  • I have tested this code.
  • I have reviewed my own PR.
  • I have created an issue for this PR.
  • I have set a descriptive PR title compliant with conventional commits.

Reviewing tips

  • Focus on the added hardhat step in the workflow and confirm the parameters are correct.
  • Check the reusable workflow configuration for consistency with other services.

User facing release notes

  • Added a Hardhat Docker image to the CI/CD workflow. The image is now published to Docker Hub, making it available for use in Studio and CLI-related services.

@epsjunior epsjunior self-assigned this Dec 6, 2024
@epsjunior epsjunior linked an issue Dec 6, 2024 that may be closed by this pull request
@epsjunior epsjunior requested a review from cristiam86 December 6, 2024 12:21
Copy link

sonarqubecloud bot commented Dec 6, 2024

@epsjunior epsjunior requested a review from kstroobants December 6, 2024 15:32
Copy link
Contributor

@AgustinRamiroDiaz AgustinRamiroDiaz left a comment

Choose a reason for hiding this comment

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

for another PR:
We should also re-think the names for the images, since we are renaming from simulator. Maybe localnetwork or studio

cc @cristiam86 @MuncleUscles what's the branding here?

@cristiam86
Copy link
Collaborator

Studio is the whole product. Local net is the backend which can be used on its own

@AgustinRamiroDiaz
Copy link
Contributor

Studio is the whole product. Local net is the backend which can be used on its own

@cristiam86 so do you think the images should be studio-frontend and then localnetwork-image-name for all the rest?

@cristiam86
Copy link
Collaborator

Studio is the whole product. Local net is the backend which can be used on its own

@cristiam86 so do you think the images should be studio-frontend and then localnetwork-image-name for all the rest?

Makes sense, not sure it should be done on this PR though.

@epsjunior epsjunior merged commit e6ec066 into main Dec 9, 2024
17 of 21 checks passed
@cristiam86
Copy link
Collaborator

@epsjunior we just merged this PR, which had failing tests. This is no longer allowed unless we manually take a look and discuss the issue that is making the tests fail.
The issue seems to be building the frontend, which was addressed in the last PR. I wonder if this is due to not having the branch updated with main before merging

@epsjunior
Copy link
Contributor Author

@epsjunior we just merged this PR, which had failing tests. This is no longer allowed unless we manually take a look and discuss the issue that is making the tests fail. The issue seems to be building the frontend, which was addressed in the last PR. I wonder if this is due to not having the branch updated with main before merging

Ok, got it

And yes, the branch wasn't updated with main, because of that some tests failed

Copy link
Contributor

🎉 This PR is included in version 0.28.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

cristiam86 added a commit that referenced this pull request Dec 10, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>
cristiam86 added a commit that referenced this pull request Dec 10, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>
cristiam86 added a commit that referenced this pull request Dec 10, 2024
…698)

* chore(deps): update dependency @vue/eslint-config-typescript to v14

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update dependency @vue/eslint-config-typescript to v14

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>
cristiam86 added a commit that referenced this pull request Dec 11, 2024
* chore(deps): update dependency @vue/eslint-config-prettier to v10 (#697)

* chore(deps): update dependency @vue/eslint-config-prettier to v10

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>

* chore(deps): update sonarsource/sonarcloud-github-action action to v4 (#696)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update node.js to v22 (#695)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update codecov/codecov-action action to v5 (#660)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update dependency pre-commit to v4 (#557)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update dependency @types/chai to v5 (#551)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* fix(deps): update all non-major dependencies (#534)

* fix(deps): update all non-major dependencies

* remove trailing whitespace

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Den <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update dependency @vitejs/plugin-vue-jsx to v4 (#514)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: updated target branch to staging

* chore: update dependencies

* chore(deps): update dependency @vue/eslint-config-prettier to v10 (#716)

* chore(deps): update dependency @vue/eslint-config-prettier to v10

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>

* chore(deps): update node.js to v22 (#717)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: updated frontend dependencies config

* fix: dependencies

* chore(deps): update dependency @vue/eslint-config-typescript to v14 (#698)

* chore(deps): update dependency @vue/eslint-config-typescript to v14

* fix: adding Hardhat Dockerfile in GitHub Workflow (#693)

* fix(hardhat): prevent race conditions in contract deployment (#704)

* fix(hardhat): Add contract deployment and healthcheck to prevent race conditions

- Added healthcheck to hardhat service in docker-compose.yml
- Modified Dockerfile.hardhat to deploy contracts after node is ready
- Added proper service dependency in docker-compose.yml to ensure jsonrpc waits for hardhat

This fixes the race condition where jsonrpc would try to access hardhat accounts before they were available, causing the finality window to crash.

* fix: use named volume for hardhat artifacts to fix permissions issue

- Changed hardhat artifacts from bind mount to named volume
- This ensures correct permissions are maintained
- Fixes CI/CD pipeline issues with hardhat compilation

* chore(docker): add curl to Dockerfile.hardhat and update healthcheck method

* chore(docker): merge RUN instructions and sort package names in Dockerfile

* fix: change health check command to nc instead of curl

* fix: healthcheck trying curl with increased retries

---------

Co-authored-by: kstroobants <[email protected]>

* fix: catch exception to keep loop running (#705)

Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: add BACKEND_BUILD_TARGET used in docker compose file in .env.example to run in debug (#707)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore: Update reviewers for renovate (#694)

Co-authored-by: Cristiam Da Silva <[email protected]>

* chore(deps): update dependency @vue/eslint-config-typescript to v14

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Cristiam Da Silva <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>

* chore(deps): update codecov/codecov-action action to v5 (#719)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Cristiam Da Silva <[email protected]>

* fix: docker python images version

* fix: removed unused dependencies

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edinaldo Pereira da Silva Junior <[email protected]>
Co-authored-by: Miguel Paya <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: kstroobants <[email protected]>
Co-authored-by: Agustín Díaz <[email protected]>
Co-authored-by: Den <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Hardhat Dockerfile in GitHub Workflow
3 participants