To provide easy access to artifacts generated during remote runs, BuildBuddy supports a special
directory called the artifacts directory. If you write files
to this directory, BuildBuddy will automatically upload those files and
show them in the UI for the remote run. You can get the path to the
artifacts directory using the environment variable
$BUILDBUDDY_ARTIFACTS_DIRECTORY.
For example, Bazel supports several flags such as --remote_grpc_log that allow
writing additional debug logs and metadata files associated with an
invocation. To automatically upload these to our UI, you could run a command like:
bazel test //... --remote_grpc_log=$BUILDBUDDY_ARTIFACTS_DIRECTORY/grpc.log
BuildBuddy creates a new artifacts directory for each step executed on the remote
runner, and recursively uploads all files in the directory after the step exits.
Upload Bazel’s gRPC logs, execution logs, or custom debug output for troubleshooting.
Test Reports
Generate and upload test coverage reports, JUnit XML files, or custom test analytics.
Build Artifacts
Store compiled binaries, packages, or other build outputs for later download.
Performance Data
Upload profiling data, timing reports, or benchmark results.
The $BUILDBUDDY_ARTIFACTS_DIRECTORY environment variable is automatically set by BuildBuddy and points to a directory that’s unique for each step in your workflow or remote bazel command.
If you’d like to fetch artifacts generated during a remote run programmatically,
you can either:
External Storage
BuildBuddy API
Upload the artifacts to a hosted storage site (like S3), where you can later fetch
the files using standard cloud storage APIs.Example:
# Upload to S3aws s3 cp $BUILDBUDDY_ARTIFACTS_DIRECTORY/my-artifact.bin s3://my-bucket/artifacts/
Upload the artifacts to BuildBuddy (using the artifacts directory approach described above)
and then fetch them using BuildBuddy’s APIs.
1
Get the invocation
Use the GetInvocation API
with the include_artifacts field set to fetch the invocation for the remote run.In the response, the artifacts field will include bytestream URLs for artifacts
that were uploaded to BuildBuddy.
2
Download artifacts
Use the GetFile API to fetch the desired artifacts using the bytestream URLs from the previous step.
Artifacts are subject to the same retention policies as other BuildBuddy cache data. Configure your cache retention settings in your organization settings.