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

feat: split js_image_layer into fine grained layers #1712

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "@@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-2065072158
pnpm-lock.yaml=1142601305
pnpm-lock.yaml=-481966245
examples/npm_deps/patches/meaning-of-life@1.0.0-pnpm.patch=-442666336
package.json=-275319675
pnpm-workspace.yaml=-1178830835
Expand All @@ -23,5 +23,5 @@ npm/private/test/vendored/semver-max/package.json=578664053
examples/linked_empty_node_modules/package.json=-1039372825
examples/npm_package/packages/pkg_d/package.json=1110895851
js/private/image/package.json=-1260474848
js/private/test/image/package.json=1286417612
js/private/test/image/package.json=-687546763
js/private/test/js_run_devserver/package.json=-260856079
92 changes: 81 additions & 11 deletions docs/js_image_layer.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 29 additions & 5 deletions e2e/js_image_docker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,25 @@ js_image_layer(
)

filegroup(
name = "app_tar",
name = "node_tar",
srcs = [":layers"],
output_group = "app",
output_group = "node",
)

container_layer(
name = "app_layer",
tars = [":app_tar"],
name = "node_layer",
tars = [":node_tar"],
)

filegroup(
name = "package_store_3p_tar",
srcs = [":layers"],
output_group = "package_store_3p",
)

container_layer(
name = "package_store_3p_layer",
tars = [":package_store_3p_tar"],
)

filegroup(
Expand All @@ -68,6 +79,17 @@ container_layer(
tars = [":node_modules_tar"],
)

filegroup(
name = "app_tar",
srcs = [":layers"],
output_group = "app",
)

container_layer(
name = "app_layer",
tars = [":app_tar"],
)

container_image(
name = "image",
architecture = "amd64", # or arm64
Expand All @@ -77,8 +99,10 @@ container_image(
cmd = ["/app/bin"],
entrypoint = ["bash"],
layers = [
":app_layer",
":node_layer",
":package_store_3p_layer",
":node_modules_layer",
":app_layer",
],
# This is `cmd` + `.runfiles/[workspace name]`
workdir = select({
Expand Down
Loading
Loading