Closed PB-TW closed 1 year ago
I tried installing Colima
and starting flagd. I can confirm that flagd detects the mounted file and starts successfully. My assumption is the way you bind the volume. Make sure your flags.json is available at $(pwd)/ (which translates to current directory you are executing the docker command) & file is named exactly flags.json
Anyway, when using Colima
, I noticed that changes to file are not propogated to flagd (i.e - changing feature flag definition is not reflected in flagd [1]).
This should be a limitation/issue of colima
. So you might not be able to experience the full potential of flagd.
[1] - https://docs.openfeature.dev/docs/tutorials/getting-started/java/#step-6-rerun-the-application
Alternatively, you can download flagd binary matching your system from the releases [1] and run it locally.
The run command is simple : ./flagd start --uri file: <BASE_PATH>/flags.json
@PB-TW I'm not able to reproduce this on docker + Linux. Could you tell us what OS are you using?
Can you try docker run -p 8013:8013 -v {ABSOLUTE_DIR}:/etc/flagd/ -it ghcr.io/open-feature/flagd:latest start --uri file:/etc/flagd/flags.json
, where {ABSOLUTE_DIR}
is a full path to your working directory (or is that what you mean by making the path explicit?) Note that it should be a DIRECTORY, not a file, if you are specifying it manually.
Can you also make sure that the flags.json file has the appropriate permissions and ownership?
I'm using MacOS 13.2. The file is named correctly. Colima version is 0.5.2.
I tried it with the {ABSOLUTE_DIR}
, leading to the same result as in my original post.
I also don't think that the -v
flag is an issue, because when I run docker inspect [container_id]
, then I can see that:
"HostConfig": {
"Binds": [
"[correct directory path, in which flags.json lives]/:/etc/flagd/"
],
...
}
...
"Mounts": [
{
"Type": "bind",
"Source": "[correct directory path, in which flags.json lives]",
"Destination": "/etc/flagd",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
I will try to download the flagd binary and run it next.
The binary is sadly not usable on my system since it is not signed and therefore I may not open it on my Mac.
Covered by: https://github.com/open-feature/flagd/issues/328
I installed flagd via homebrew and ran flagd start --uri file:./flags.json
. This is working as expected now!
But of course would be more happy to use it dockerized.
@PB-TW this sounds a lot like your problem. I'm not familiar enough with Colima
, but maybe this could be helpful?
We will keep troubleshooting on our end.
I'm using macOS Ventura 13.2.
I could not reproduce this issue, these are the steps I took:
flags.json
in my working directorycolima start
(version 0.5.2)docker run -p 8013:8013 -v $(pwd)/:/etc/flagd/ -it ghcr.io/open-feature/flagd:latest start --uri file:/etc/flagd/flags.json
Unable to find image 'ghcr.io/open-feature/flagd:latest' locally
latest: Pulling from open-feature/flagd
5f80a38cb015: Pull complete
de3ec0d85b60: Pull complete
Digest: sha256:91515407e8527b8a0dc8857efebfbcba291bc3cd498085e99a7d5c5cddd97440
Status: Downloaded newer image for ghcr.io/open-feature/flagd:latest
______ __ ________ _______ ______
/_____/\ /_/\ /_______/\ /______/\ /_____/\
\::::_\/_\:\ \ \::: _ \ \\::::__\/__\:::_ \ \
\:\/___/\\:\ \ \::(_) \ \\:\ /____/\\:\ \ \ \
\:::._\/ \:\ \____\:: __ \ \\:\\_ _\/ \:\ \ \ \
\:\ \ \:\/___/\\:.\ \ \ \\:\_\ \ \ \:\/.:| |
\_\/ \_____\/ \__\/\__\/ \_____\/ \____/_/
{"level":"info","ts":1675346378.0725162,"caller":"service/connect_service.go:108","msg":"metrics listening at 8014","component":"service"}
{"level":"info","ts":1675346378.0725548,"caller":"file/filepath_sync.go:29","msg":"Starting filepath sync notifier","component":"sync","sync":"filepath"}
{"level":"info","ts":1675346378.0742724,"caller":"file/filepath_sync.go:49","msg":"Watching filepath: /etc/flagd/flags.json","component":"sync","sync":"filepath"}
Thanks a lot for the support!
@toddbaert Your link helped. Clearing out the ~/.colima/
folder made it work for me now as well! So nothing wrong on your side and just one of Colima's quirks.
@PB-TW great news! Thanks for your interest in the project. Please don't hesitate to reach out if you need any more help or support, or you'd like to provide feedback.
Change in the documentation
I was following this guide: https://docs.openfeature.dev/docs/tutorials/getting-started/java
In step 5, I create the
flags.json
file in my working directory and then I am running this command:docker run -p 8013:8013 -v $(pwd)/:/etc/flagd/ -it ghcr.io/open-feature/flagd:latest start --uri file:/etc/flagd/flags.json
This leads to the following stacktrace:
I tried several different ways, including moving the file around, making the path explicit etc. When I run
docker inspect
, the volume looks correct to me.I am using Colima instead of Docker Desktop, if that is relevant.
Either the documentation is wrong or there is a bug in the latest version of flagd.