You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: rough personal idea of mine. Many rough edges.
Today, repositories that use Bazel often have difficulty determining "when" to release an artifact.
Many of these rely on bazel {,c}query to recreate Bazel's internal dependency graph and combine it with the change diff to determine the list of deployable targets.
I think to make this simpler to end users, we can consider adding a new Bazel subcommand bazel release <targets>. Similar to bazel test <targets>, this new subcommand should build all the <targets> provided by the user and then run executable binaries that are marked as "is_release".
To help with that, we can extend rule() to add a new boolean attribute called is_release. Alternatively, we can also consider deprecating the test attribute in favor of something like executable_type, which takes one of none, test, release values. "release" rules must return ExecutionInfo to define how the binary should be executed at the "release phase"
The release actions can be called ReleaseRunner, similar to the current TestRunner actions. ReleaseRunner actions are special in that they should be cached solely by their release binary digest. The execution environment (i.e. environment variables) should not be part of the cache key so secrets/credentials could be provided at runtime.
Additionally, the ExecutionInfo provider could be used by the rule author to customize:
Sandboxing options (using no-sandboxing or a persistent worker might allow the binary to access secrets/credentials value. Persistent worker might help control the concurrency as well.). Worth noting that this is not mandatory since you can mount the credential files into Bazel's sandbox today.
Networking options
Caching enabled/disabled
This should also enable these release workflows to benefit from RBE where these release actions could be run parallelly on a remote compute environment and (hopefully) deduplicated by the RBE scheduler.
Ps: I know that we have bazel mobile-install but that's not generalizable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Disclaimer: rough personal idea of mine. Many rough edges.
Today, repositories that use Bazel often have difficulty determining "when" to release an artifact.
Many of these rely on
bazel {,c}query
to recreate Bazel's internal dependency graph and combine it with the change diff to determine the list of deployable targets.I think to make this simpler to end users, we can consider adding a new Bazel subcommand
bazel release <targets>
. Similar tobazel test <targets>
, this new subcommand should build all the<targets>
provided by the user and then run executable binaries that are marked as "is_release".To help with that, we can extend
rule()
to add a new boolean attribute calledis_release
. Alternatively, we can also consider deprecating thetest
attribute in favor of something likeexecutable_type
, which takes one ofnone, test, release
values. "release" rules must returnExecutionInfo
to define how the binary should be executed at the "release phase"The release actions can be called
ReleaseRunner
, similar to the currentTestRunner
actions. ReleaseRunner actions are special in that they should be cached solely by their release binary digest. The execution environment (i.e. environment variables) should not be part of the cache key so secrets/credentials could be provided at runtime.Additionally, the
ExecutionInfo
provider could be used by the rule author to customize:This should also enable these release workflows to benefit from RBE where these release actions could be run parallelly on a remote compute environment and (hopefully) deduplicated by the RBE scheduler.
Ps: I know that we have
bazel mobile-install
but that's not generalizable.Beta Was this translation helpful? Give feedback.
All reactions