Skip to content

Fix nodejs_image layering - #487

Closed
Globegitter wants to merge 9 commits into
bazelbuild:masterfrom
Globegitter:nodejs-layering
Closed

Globegitter wants to merge 9 commits into
bazelbuild:masterfrom
Globegitter:nodejs-layering

Conversation

@Globegitter

@Globegitter Globegitter commented Aug 14, 2018 •

Copy link
Copy Markdown

This builds upon #342 and fixes the layering for the nodejs_image making it work with the latest rules. This is dependent on bazel-contrib/rules_nodejs#283 being merged into rules_nodejs.

The top layer of the example nodejs_image goes down from 64MB to ~60KB. From one of our own apps it reduces it from ~223MB to ~28MB

@nlopezgi nlopezgi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this PR. Mostly looks good. Some, mostly documentation, nits. Will kick off tests. Please make sure to run buildifier on all your files. Thanks again!

Comment thread lang/image.bzl Resolved
Comment thread nodejs/image.bzl Resolved
Comment thread nodejs/image.bzl
"//lang:image.bzl",
"app_layer",
"app_layer_attrs",
"app_layer_impl",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you alias these with lang_ so that they are visibly distinct from the ones declared here

Comment thread nodejs/image.bzl Outdated
)

def _app_layer_impl(ctx):
empty_dirs = ["/".join(["/app", ctx.workspace_name])]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you document here briefly why the empty dirs need to be added (and anything else specific about this impl that makes it different from the one in lang/image.bzl, e.g., what you are doing with the runfiles)

Comment thread nodejs/image.bzl Resolved
Comment thread nodejs/image.bzl Resolved
Comment thread container/image_test.py Resolved
@Globegitter

Copy link
Copy Markdown
Author

Just as a note, I am waiting to get feedback on the rules_nodejs PR first before updating here, to make sure I don't have to update this PR multiple times.

@nlopezgi

nlopezgi commented Oct 1, 2018

Copy link
Copy Markdown
Contributor

Hi @Globegitter any updates on this PR. We're close to accepting a PR that touches a lot of the same code as this PR (#324) and also affects nodejs layering (please comment on that PR if you have any thoughts). Thanks

@Globegitter

Copy link
Copy Markdown
Author

@nlopezgi Thanks for pinging me, unfortuantely review on the rules_nodejs has been slow, let me ping the maintainer again and I will check that other PR.

@Globegitter

Copy link
Copy Markdown
Author

@nlopezgi It should be fine merging the other PR and I will just deal with any conflicts once I get back to this.

@nlopezgi

nlopezgi commented Jan 8, 2019

Copy link
Copy Markdown
Contributor

hi @Globegitter
is this PR still something you want plan on working on or can we close it otherwise?

@Toxicable

Copy link
Copy Markdown

We're still very much interested in this change.
It looks like the rules_nodejs PR is pretty much ready to go, just needs some additional tests and docs.

@Globegitter

Copy link
Copy Markdown
Author

@nlopezgi I am sorry I dropped the ball on this I just have not had the time to give this any priority in the past months. Thanks for reminding me about this, I will put it on my todo again.

@k8s-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Globegitter
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

If they are not already assigned, you can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Globegitter

Globegitter commented Feb 14, 2019 •

Copy link
Copy Markdown
Author

@nlopezgi googlecloud is failing - is that remote execution? Has that ever worked with the nodejs images? If it is something I broke is it possible to see the logs?

Other than that there are still a few minor things left to clean up but I already tried to address as many of your comments as possible.

@Globegitter

Globegitter commented Feb 15, 2019 •

Copy link
Copy Markdown
Author

So cleaned everything up, seems we do not need the emptydirs logic anymore so that is nice. Tested it with our node app and all looking good.

@nlopezgi nlopezgi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change looks good overall to me. We have some test failing due to this change. We recently added tests that validate passing an empty arg list for nodejs_image behaves as expected (e29affb#diff-29b5d4a8ad7be4e7ac5bb87e28af4619) and for some reason that I could not figure out with a quick inspection of this code the tests are now failing. Could you please check them out and try to figure out why they fail. You probably need to merge the change above into your branch.

@nlopezgi

Copy link
Copy Markdown
Contributor

hi @Globegitter ,
any progress on this or should I close?

@Globegitter

Copy link
Copy Markdown
Author

@nlopezgi It has been a long process but it is still alive. There was a blocking bug uncovered last minute in bazel-contrib/rules_nodejs#283 which has been resolved recently so now I just need to update that PR and then I can fix this up here. So sorry for the long delay on this but it has not been entirely my fault.

@nlopezgi

Copy link
Copy Markdown
Contributor

@Globegitter thanks for the update
no problem, no hurry on our end, just wanted to make sure this is still relevant to keep open.

@nlopezgi

nlopezgi commented Jul 3, 2019

Copy link
Copy Markdown
Contributor

any updates on this PR, still relevant or should we close?

@Globegitter

Copy link
Copy Markdown
Author

Yeah let's close it for now - I now have a new proposal to solve this: bazel-contrib/rules_nodejs#863 but still waiting for it to get merged. So once that i done I will create a new PR.

@Globegitter Globegitter closed this Jul 4, 2019
@Globegitter
Globegitter deleted the nodejs-layering branch July 4, 2019 09:03
@Globegitter
Globegitter restored the nodejs-layering branch July 4, 2019 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants