Skip to content

Commit e04b251

Browse files
committed
fix(wkg): enable network access for OCI registry operations in CI
Add execution_requirements to all OCI push/pull operations to allow network access outside Bazel's sandbox. This fixes CI failures when publishing to or pulling from OCI registries. The issue was that Bazel's sandbox blocks network access by default for hermetic builds, but OCI operations require network connectivity. Adding execution_requirements with "local": "1" and "no-sandbox": "1" allows these operations to run with network access. Fixed operations: - wasm_component_publish (push) - wasm_component_from_oci (pull) - wac_compose_with_oci (pull for composition)
1 parent 7ece0ea commit e04b251

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

wkg/defs.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,10 @@ def _wkg_push_impl(ctx):
805805
mnemonic = "WkgOciPush",
806806
progress_message = "Pushing WebAssembly component to OCI registry: {}".format(image_ref),
807807
use_default_shell_env = True, # Needed for registry authentication
808+
execution_requirements = {
809+
"local": "1", # Requires network access to push to OCI registry
810+
"no-sandbox": "1", # Disable sandboxing for network access
811+
},
808812
)
809813

810814
# Create status script that reports the push result
@@ -968,6 +972,10 @@ def _wkg_pull_impl(ctx):
968972
mnemonic = "WkgPull",
969973
progress_message = "Pulling WASM component {}".format(image_ref),
970974
use_default_shell_env = True, # Needed for registry authentication
975+
execution_requirements = {
976+
"local": "1", # Requires network access to pull from OCI registry
977+
"no-sandbox": "1", # Disable sandboxing for network access
978+
},
971979
)
972980

973981
# Create OCI info provider
@@ -1498,6 +1506,10 @@ def _wasm_component_publish_impl(ctx):
14981506
mnemonic = "WkgOciPush",
14991507
progress_message = "Publishing WebAssembly component to OCI registry: {}".format(image_ref),
15001508
use_default_shell_env = True, # Needed for registry authentication
1509+
execution_requirements = {
1510+
"local": "1", # Requires network access to push to OCI registry
1511+
"no-sandbox": "1", # Disable sandboxing for network access
1512+
},
15011513
)
15021514

15031515
# Create executable marker file separately (depends on successful push)
@@ -3138,6 +3150,10 @@ def _wasm_component_from_oci_impl(ctx):
31383150
outputs = [component_file],
31393151
mnemonic = "WkgPullOCI",
31403152
progress_message = "Pulling WebAssembly component from OCI registry: {}".format(image_ref),
3153+
execution_requirements = {
3154+
"local": "1", # Requires network access to pull from OCI registry
3155+
"no-sandbox": "1", # Disable sandboxing for network access
3156+
},
31413157
)
31423158

31433159
# Post-pull signature verification if requested
@@ -3301,6 +3317,10 @@ def _wac_compose_with_oci_impl(ctx):
33013317
outputs = [oci_component_file],
33023318
mnemonic = "WkgPullOCIForComposition",
33033319
progress_message = "Pulling OCI component {} for composition".format(comp_name),
3320+
execution_requirements = {
3321+
"local": "1", # Requires network access to pull from OCI registry
3322+
"no-sandbox": "1", # Disable sandboxing for network access
3323+
},
33043324
)
33053325

33063326
# Infer WIT package name from OCI spec (simple heuristic)

0 commit comments

Comments
 (0)