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

[feature] #1898: share workdir as a volume with dev docker instances #1910

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

mversic
Copy link
Contributor

@mversic mversic commented Feb 14, 2022

Signed-off-by: Marin Veršić marin.versic101@gmail.com

Description of the Change

this should enable you to build on locally and deploy in docker if you build for x86_64-unknown-linux-gnu target. This may not always be the case because it links statically against glibc so there can arise version mismatch. In this case you can build for x86_64-unknown-linux-musl target which is links to libc statically

building in docker would bloat the container size so I haven't included cargo or rustc in the docker image, but you can install them if you find it easier to build inside docker

Issue

Closes #1898

Benefits

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Feb 14, 2022
@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Merging #1910 (c3b4e6b) into iroha2-dev (2102df4) will decrease coverage by 0.55%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           iroha2-dev    #1910      +/-   ##
==============================================
- Coverage       78.26%   77.71%   -0.56%     
==============================================
  Files             164      164              
  Lines           22528    22528              
==============================================
- Hits            17631    17507     -124     
- Misses           4897     5021     +124     
Impacted Files Coverage Δ
core/src/sumeragi/mod.rs 77.69% <0.00%> (-8.08%) ⬇️
core/src/sumeragi/view_change.rs 91.81% <0.00%> (-6.04%) ⬇️
core/src/sumeragi/network_topology.rs 91.11% <0.00%> (-5.28%) ⬇️
crypto/src/signature.rs 83.05% <0.00%> (-1.70%) ⬇️
p2p/src/peer.rs 82.48% <0.00%> (-0.89%) ⬇️
actor/src/lib.rs 89.07% <0.00%> (-0.35%) ⬇️
data_model/src/expression.rs 70.77% <0.00%> (-0.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2102df4...c3b4e6b. Read the comment docs.

@@ -14,4 +16,5 @@ services:
- "1337:1337"
- "8080:8080"
- "8180:8180"
init: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why this flag is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no init system in docker and therefore, first process that is executed (./iroha in our case) gets PID = 1. This PID is special because it ignores signals sent to it like SIGKILL or SIGTERM. You can see this if you try to kill the process from inside container(and you cannot) or you can see that running docker stop takes 10sec to complete because it waits on graceful shutdown which isn't happening.

This can be resolved in two ways, either by adding small init system called tini which is packed with docker or explicit signal handling needs to be included in the iroha binary(I haven't confirmed this)

Copy link
Contributor

Choose a reason for hiding this comment

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

Explicit signal handling is planned after #1480. With that said, we don't gracefully exit regardless, so the implicit signal handling is fine for now.

Comment on lines +6 to +7
volumes:
- './:/root/soramitsu/iroha'
Copy link
Contributor

@s8sato s8sato Feb 17, 2022

Choose a reason for hiding this comment

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

The local repository path varies by developer though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they vary. That is why .(current dir) is mapped to /root/soramitsu/iroha in container. It doesn't need to be mapped, I needed a way to copy locally built iroha into docker container and run it. I can get away with docker cp but maybe someone would like to build iroha inside container and now they have the possibility with shared volume

Copy link
Contributor

Choose a reason for hiding this comment

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

I mistook right for left of :

Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Comment on lines +6 to +7
volumes:
- './:/root/soramitsu/iroha'
Copy link
Contributor

Choose a reason for hiding this comment

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

I mistook right for left of :

@mversic mversic merged commit e0eda1e into hyperledger:iroha2-dev Feb 18, 2022
@mversic mversic deleted the shared_docker_volume branch April 16, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants