-
Notifications
You must be signed in to change notification settings - Fork 277
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
2bab90a
to
03850ea
Compare
@@ -14,4 +16,5 @@ services: | |||
- "1337:1337" | |||
- "8080:8080" | |||
- "8180:8180" | |||
init: true |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
volumes: | ||
- './:/root/soramitsu/iroha' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :
03850ea
to
f1bbeaa
Compare
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
f1bbeaa
to
c3b4e6b
Compare
volumes: | ||
- './:/root/soramitsu/iroha' |
There was a problem hiding this comment.
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
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 forx86_64-unknown-linux-musl
target which is links to libc staticallybuilding 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]