-
Notifications
You must be signed in to change notification settings - Fork 712
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
fix(make): run UI build container as current user to avoid yarn build fail after make. #3635
Conversation
a37f8c6
to
d010313
Compare
Hi @imazik Thanks for the PR. I have triggered build for this. |
Integration tests are still failing.
|
The integration tests are not supposed to run for external pull requests - they would gain access to credentials which could then be used for botnets, etc. The fact that something does run which then fails in an odd way is accidental. |
Makefile
Outdated
if test "true" != "$(SCOPE_SKIP_UI_ASSETS)"; then \ | ||
rm -rf client/build; \ |
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 seems to be deleting the cache on every build?
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 @bboreham .
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 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.
Thanks for your PR @imazik and for capturing the issue!
I suggested we keep things simple and omit introducing new build folders if possible, let us know what you think :)
.gitignore
Outdated
@@ -59,7 +59,7 @@ extras/copyreport/copyreport | |||
app/static.go | |||
vendor/github.com/ugorji/go/codec/codecgen/bin/* | |||
*.codecgen.go | |||
client/build-external/* | |||
client/build* |
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.
👍
Makefile
Outdated
$(SCOPE_UI_BUILD_IMAGE) yarn run build-external; \ | ||
$(SCOPE_UI_BUILD_IMAGE) yarn run build-external-docker; \ | ||
mkdir client/build-external; \ | ||
cp -r client/build-docker-external/* client/build-external; \ |
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.
Hmm, I think having 4 different build output dirs might be a bit of an overkill, especially given the docker ones are just temporary in a sense :)
Would your commands with rm -rf
above be enough to fix #3612? If yes, maybe we can just keep things as simple as possible and only keep those lines, wdyt @imazik?
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 I can clean build directory created by root
user so that we will have 2 different build dirs only. It will be simple then. 👍
Makefile
Outdated
if test "true" != "$(SCOPE_SKIP_UI_ASSETS)"; then \ | ||
rm -rf client/build; \ |
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.
Makefile
Outdated
if test "true" != "$(SCOPE_SKIP_UI_ASSETS)"; then \ | ||
rm -rf client/build-external; \ |
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 nice to re-use yarn clean-build-external
here if possible..
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.
Yup I was thinking like that. Will add. Thanks.
Makefile
Outdated
$(SCOPE_UI_BUILD_IMAGE) yarn run build; \ | ||
$(SCOPE_UI_BUILD_IMAGE) yarn run build-docker; \ | ||
mkdir -p client/build; \ | ||
cp -r client/build-docker/* client/build; \ |
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.
See my comment below
652588a
to
258305d
Compare
I feel this is very complicated. Is it possible to run as the current user? (mentioned at #3612 (comment)) |
258305d
to
86cb318
Compare
pass user and group id in docker run command to run it as current user Signed-off-by: Shovan Maity <shovan.cse91@gmail.com>
86cb318
to
95b2317
Compare
Please check it. |
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.
Great improvement @imazik, LGTM! 👍
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.
Nice improvement
Thanks @imazik for fixing it.
LGTM 🎉
We are building ui-dist in make using docker image of nodejs after building dist it put those dist in build or build-external folder. These folders are created by docker run under root user. After make if we try to build it locally by yarn build it tries to delete build folder from
$USER
user thats why we are getting permission error.Fixes #3612
Signed-off-by: Shovan Maity shovan.cse91@gmail.com