-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Build: hardcode the Docker username for now #10172
Conversation
This is a quick fix for a hotfix. `RTD_DOCKER_USER` is `docs:docs` so we can't use it inside the path.
These old images are using `pyenv` instead of `asdf`, so we need to use some different paths to find the binaries.
…mitos/build-hotfix
…mitos/build-hotfix
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 think you could simplify it as proposed?
|
||
# On local development, we are using root user | ||
if settings.RTD_DOCKER_COMPOSE: | ||
paths = paths.replace("/home/docs/", "/root/") |
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 one is not part of the else clause?
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.
Nope, this is only required for the new Ubuntu images since these use asdf
and this path is where asdf
is installed.
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 we just use $HOME or similar, instead of adding more hacks? I'm fine with this though for now, assuming we've tested it and it works.
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 hard-coding makes sense, probably there should be a follow-up issue for this?
Edit: If posting a follow-up issue, it could also note that this area of the code has 0% test coverage, in case its possible to put together a test.
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 the downside of trying to set explicit paths, instead of letting the container define them. Lots of complexity abounds when we start trying to define things like this outside of the container environment.
I'm 👍 on shipping this as a hotfix, but we'll likely get bit by this again in the future, so might be worth trying to see if there's a way to avoid setting these paths.
|
||
# On local development, we are using root user | ||
if settings.RTD_DOCKER_COMPOSE: | ||
paths = paths.replace("/home/docs/", "/root/") |
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 we just use $HOME or similar, instead of adding more hacks? I'm fine with this though for now, assuming we've tested it and it works.
I prefer to set the environment exactly as we want from the application than rely on the darkness of the things defined in the Dockerfile used to create the image. This approach gives a lot more control and allows us to solve issues without having to rebuild the image 👍🏼 |
@humitos I think it might be tedious to use $HOME and since this is getting cleaned up later anyways, perhaps just leave a code comment with @ericholscher 's suggestion? |
@benjaoming @ericholscher I've already tried that and I wasn't able to make The |
@humitos that's exactly the result I'd fear that you would run into, so best saved for later 👍 and no, not a big issue. |
AFAICT, this is ready? |
@benjaoming yes; I'll do some QA on production in a moment before merging. If everything works as expected, I'll merge and deploy it today. |
I QAed this PR with 15 builds (different scenarios) on production and it did work. I'm merging and moving forward here. |
Another solution is to first get the current PATH, and then append the new ones to that. |
This reverts commit 331e474.
This reverts commit 331e474.
This is a quick fix for a hotfix.
RTD_DOCKER_USER
isdocs:docs
so we can't use it inside the path.Closes #10171