-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Do not to use --stdout for relay credential generate #1267
Conversation
|
So we can see what uid/gid is running docker, try to change uid/gid of
But this is what I have thought of, @BYK @untitaker @chadwhitacre What do you think about this? Is it something obvious I'm missing which can handle this situation easily? Or redirecting and using |
Created
It used to be like 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.
Seems like relay
is still complaining about not being able to read credentials: https://github.com/getsentry/self-hosted/runs/4913039350?check_suite_focus=true#step:5:1026
install/relay-credentials.sh
Outdated
@@ -13,11 +14,12 @@ if [[ ! -f "$RELAY_CREDENTIALS_JSON" ]]; then | |||
# JSON. We hit this case as we redirect output to the same config folder, | |||
# creating an empty credentials file before relay runs. | |||
|
|||
docker run --rm --volume "$(pwd)/$RELAY_DIRECTORY:/tmp/relay" busybox chown -R 10001 /tmp/relay |
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.
Why not put these in a custom entrypoint
script and use $dcr
instead?
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.
Does this (1d7c7a7) look good?
I've made a change trying to read it, and it seems that user running docker which is |
851bc12
to
d494dcd
Compare
Both are JSON blobs, just one is better formatted. Should be fine. |
$dcr \ | ||
--no-deps \ | ||
--volume "$(pwd)/$RELAY_DIRECTORY:/tmp/relay" \ | ||
relay --config /tmp/relay credentials generate |
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'd say, in the final version, we can just use the mounter relay
config dir for 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.
Can you elaborate please?
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.
We already mount the relay
directory for the relay
service and set that as the config folder so you should not need the --volume "$(pwd)/$RELAY_DIRECTORY:/tmp/relay"
part and --config /tmp/relay
part.
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.
We have this:
self-hosted/docker-compose.yml
Lines 340 to 358 in da8f490
relay: | |
<<: *restart_policy | |
image: "$RELAY_IMAGE" | |
volumes: | |
- type: bind | |
read_only: true | |
source: ./relay | |
target: /work/.relay | |
- type: bind | |
read_only: true | |
source: ./geoip | |
target: /geoip | |
depends_on: | |
kafka: | |
<<: *depends_on-healthy | |
redis: | |
<<: *depends_on-healthy | |
web: | |
<<: *depends_on-healthy |
which mounts relay directory read-only and AFAICS there is no
--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.
We can mount it as writable for that run but yeah, I get your point :)
@aminvakil Can we switch this to a draft PR if it's still under active development? 😶 |
939fb44
to
61024e3
Compare
Sure, sorry for the noise these past days. |
5805d92
to
9c4b533
Compare
9c4b533
to
a624348
Compare
Considering current changes in relay generation, this |
First brought up in #1251 (comment)