-
Notifications
You must be signed in to change notification settings - Fork 236
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
Document how to bind-mount a mkt.yml #321
Conversation
Codecov Report
@@ Coverage Diff @@
## master #321 +/- ##
==========================================
- Coverage 46.02% 45.99% -0.04%
==========================================
Files 87 87
Lines 11200 11200
==========================================
- Hits 5155 5151 -4
- Misses 5608 5612 +4
Partials 437 437
|
README.md
Outdated
```sh | ||
mkdir ms_etc/ | ||
mv /path/to/mkts.yml ./ms_etc/ | ||
docker run --mount type=bind,source="/full/path/to/ms_etc/",target="/etc" \ |
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 believe providing the normal volume mount would be shorter:
docker run -v /full/path/to/mkts.yml:/etc/mkts.yml
Also, mounting the whole /etc might have undesirable side-effects: host lookup won't work as /etc/resolv.conf will be non-existent.
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.
would be shorter
Indeed. I originally started with that myself but went to the docker docs since I hadn't actually run a container manually in some time. They now suggest this syntax due to explicitness. I'm not very opinionated one way or the other so whatever peeps prefer.
mounting the whole /etc might have undesirable side-effects: host lookup won't work as /etc/resolv.conf will be non-existent.
I'm not sure this is such a worry given that marketstore
shouldn't need to query DNS under normal testing operation, but you're right, there's definitely blank hosts
, hostname
and resolv.conf
being generated by the container in the specified host local dir. Maybe it makes sense to instead show how to copy in a custom mkts.yml
into the image with something like docker cp ./mkts.yml <containername>/etc/mkts.yml
? The main problem with that is I don't see a command to reload the server config?
I haven't had any problems in my usage with the bind but maybe documenting both or at least warning about the networking implications is better? Either way there seems to be no easy way for testing other then without building a new image with the custom mkts.yml
moved in as in the Dockerfile
. If planning to use the server in a situation where overriding /etc
matters for networking purposes maybe a warning in the readme is sufficient?
For me personally having a set of docs going quickly to see how the project works is more important then worrying about more advanced usage details from the outset. When I first started trying to use the project it was pretty unclear go to get going anything practically useful (see #292 for example).
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.
Ahh, just realized the create
then cp
instructions are already in the readme so disregard the:
Maybe it makes sense to instead show how to copy in a custom mkts.yml into the image with something like docker cp ./mkts.yml /etc/mkts.yml? The main problem with that is I don't see a command to reload the server config?
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.
marketstore uses network for backfiller processes. overwriting /etc for a single file is really not a good idea.
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.
+1 to @tibkiss .
We might want to change the default config file path from /etc/mkts.yml
to /etc/mkts/mkts.yml
to avoid the above issue?
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.
@dakimura really like that idea. The bind mounting sure is handy for testing (at the least) imo 😸
Would you prefer I remove this documentation for now then until that is discussed and possibly PR-ed separately?
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.
Oh wait, just realizing now that @tibkiss suggestion is to bind the individual file..
I'll just do that with the shorter syntax and drop the etc/
warning.
Codecov Report
@@ Coverage Diff @@
## master #321 +/- ##
=======================================
Coverage 46.03% 46.03%
=======================================
Files 87 87
Lines 11203 11203
=======================================
Hits 5157 5157
Misses 5609 5609
Partials 437 437 |
README.md
Outdated
a local location: | ||
```sh | ||
docker run -i -p 5993:5993 alpacamarkets/marketstore:latest \ | ||
--mount type=bind,source="/<path_to_data>/marketstore",target="/data" |
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 personally still prefer the shorter -v
form, as we don't gain anything being explicit here.
I could also argue, that then you could also write --publish
and --interactive
as opposed to their short form.
I'll let others (@umitanuki / @dakimura / @leki75 ) to chime in here.
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.
+1 for the short form
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.
prefer the shorter -v form,
yes, I agree.
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.
Sounds good.
@dakimura I've noticed the integration tests aren't so healthy from also trying to use that code manually. Maybe it's worth opening a new PR to fix those? |
ah sorry it's not related to your change... I fixed the issue just now, please pull the latest master to run the test again! |
Gosh, well I would hope not! 🤣
👍 |
Document how to bind-mount in a `mkts.yml` config for quick testing of the image included plugins. Fix the python blocks so they highlight correctly. Mention that you have to build the `cmd` package before using the `connect` command.
Mention in the readme how to bind-mount the data dir using `docker` so that persistent storage is possible using the container host. Fixes alpacahq#292
README.md
Outdated
container's host storage. To accomplish this, bind the `data` directory to | ||
a local location: | ||
```sh | ||
docker run -i -p 5993:5993 alpacamarkets/marketstore:latest -v "/path/to/store/data:/data" |
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.
this is not valid, we are passing down -v "/path..." to marketstore entrypoint.
-v "/path/to/store/data:/data"
should come before the image specification:
docker run -i -p 5993:5993 -v /path/to/store/data:/data alpacamarkets/marketstore:latest
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.
Good catch 😅
Also just suggest binding the `mkts.yml` file directly to avoid issues with clobbering `/etc/` on the container.
@tibkiss fixed it! Let me know if there's anything else 🏄 |
thank you! |
Hmm you know what @tibkiss I'm thinking the bind-mount for
I'm thinking that should have:
To match the What you think? |
Document how to bind-mount in a
mkts.yml
config for quick testing ofthe image included plugins. Fix the python blocks so they highlight
correctly. Mention that you have to build the
cmd
package before usingthe
connect
command.