Skip to content
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

Promote js_image_layer to Public API #304

Closed
thesayyn opened this issue Jul 25, 2022 · 3 comments · Fixed by #771
Closed

Promote js_image_layer to Public API #304

thesayyn opened this issue Jul 25, 2022 · 3 comments · Fixed by #771
Assignees
Labels
enhancement New feature or request

Comments

@thesayyn
Copy link
Member

js_image_layer should be promoted to public API before 1.0

@thesayyn thesayyn added this to the 1.0 milestone Jul 25, 2022
@gregmagolan gregmagolan added the enhancement New feature or request label Aug 3, 2022
@gregmagolan gregmagolan modified the milestones: 1.0, 1.1 Aug 4, 2022
@gregmagolan
Copy link
Member

Not landing this for 1.0 since there are transitive deps on rules_py and rules_pkg that we have to reason about first

@bazaglia
Copy link
Contributor

As spoken with @thesayyn on Slack, I tested the js_image_layer following the example on the e2e folder and noticed something additional had to be done when importing files. It can be either improved or be part of the docs.

When running the image built using js_image_layer, my Node.js runtime at first wasn't able to find some .proto files that I import. It all works great when using js_binary directly though. But to get the files to be found with this Starlark code I'm importing from the e2e folder, I had to:

  • Set the workdir attribute in the container_image to /app/my_package/start.sh.runfiles/my_workspace_name (/app is the root in js_image_layer). It also works if I set the environment variable JS_BINARY__CHDIR to that same string.
  • After setting the workdir as mentioned above, I still need to prefix the file I import with process.cwd(). When I call the js_binary target directly without Docker, I don't need to prefix it.

@thesayyn
Copy link
Member Author

bazel-contrib/rules_oci#31 (comment) we'll move the python bit to its own file if we can't address #381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants