Bazel Build Failing in Docker Image Build

Hi there,

Following my other question on integrating PyAlice in other Python application, I wanted to create a Docker Image with a prebuilt Bazel app from Isaac SDK - I’m basing the image off the one created from the Docker setup instruction. However when I try to do bazel build within the Docker image build, I encounter this error in the build process:

INFO: Repository org_tuxfamily_eigen instantiated at:
no stack (–record_rule_instantiation_callstack not enabled)
Repository rule new_git_repository defined at:
/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl:182:22: in
ERROR: An error occurred during the fetch of repository ‘org_tuxfamily_eigen’:
Traceback (most recent call last):
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 170
_clone_or_update(ctx)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 36, in _clone_or_update
git_repo(ctx, directory)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 91, in git_repo
_update(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 103, in _update
fetch(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 129, in fetch
_git_maybe_shallow(ctx, <5 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 171, in _git_maybe_shallow
_error(ctx.name, <2 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 181, in _error
fail(<1 more arguments>)
error running ‘git fetch origin refs/heads/:refs/remotes/origin/ refs/tags/:refs/tags/’ while working with @org_tuxfamily_eigen:
ERROR: /root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/com_nvidia_isaac_engine/engine/core/math/BUILD:13:1: @com_nvidia_isaac_engine//engine/core/math:math depends on @org_tuxfamily_eigen//:eigen in repository @org_tuxfamily_eigen which failed to fetch. no such package ‘@org_tuxfamily_eigen//’: Traceback (most recent call last):
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 170
_clone_or_update(ctx)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 36, in _clone_or_update
git_repo(ctx, directory)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 91, in git_repo
_update(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 103, in _update
fetch(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 129, in fetch
_git_maybe_shallow(ctx, <5 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 171, in _git_maybe_shallow
_error(ctx.name, <2 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 181, in _error
fail(<1 more arguments>)
error running ‘git fetch origin refs/heads/:refs/remotes/origin/ refs/tags/:refs/tags/’ while working with @org_tuxfamily_eigen:
ERROR: /root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/com_nvidia_isaac_engine/engine/gems/math/BUILD:13:1: @com_nvidia_isaac_engine//engine/gems/math:math depends on @org_tuxfamily_eigen//:eigen in repository @org_tuxfamily_eigen which failed to fetch. no such package ‘@org_tuxfamily_eigen//’: Traceback (most recent call last):
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 170
_clone_or_update(ctx)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git.bzl”, line 36, in _clone_or_update
git_repo(ctx, directory)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 91, in git_repo
_update(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 103, in _update
fetch(ctx, git_repo)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 129, in fetch
_git_maybe_shallow(ctx, <5 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 171, in _git_maybe_shallow
_error(ctx.name, <2 more arguments>)
File “/root/.cache/bazel/_bazel_root/48afafb3b65f1ef54e81b9fa47fcdf43/external/bazel_tools/tools/build_defs/repo/git_worker.bzl”, line 181, in _error
fail(<1 more arguments>)
error running ‘git fetch origin refs/heads/:refs/remotes/origin/ refs/tags/:refs/tags/’ while working with @org_tuxfamily_eigen:

This seems to only occur when I try to do the Bazel build within the Docker image build, but I did not have this issue in a local Bazel install and Isaac SDK. Here is my Dockerfile for reference: isaac-sdk-dockerfile (679 Bytes)

If I understood, you want to build an Isaac SDK app in an image, then create an image with the built app so that it can run? The instructions you referenced are to build the image for the container in which you would build your Isaac SDK apps (“development” container. The output of a isaac_pkg target should contain all of the libraries and dependencies to run the result. This is what you would want to include as a layer in your “runtime” Docker image container along with base dependencies (less than what is needed for the “development” container).

Hi, when you say “the output of a isaac_pkg target”, do you mean what is generated inside bazel_out after a bazel build for a build target (with the sample apps or a custom Python package).

For my separate Python application, all I really need at the moment is the PyAlice library to communicate joint commands/states to Isaac Omniverse over REB. Whether that’s by installing the SDK and building the package directly within the Docker image, or copying a pre-built package from the outside into the image layer, doesn’t matter much for me.

My current approach is doing an os.chdir() into isaac-sdk/sdk/bazel-out/k8-opt/bin/apps/samples/manipulation/simple_joint_control.runfiles/com_nvidia_isaac_sdk, which allows me to import PyAlice and load the communication subgraph without issues.

However, I did eventually get the bazel build working inside a Docker image build and figure out that error - a slow wifi connection causes it to timeout while fetching Eigen. Switching to a better wifi dongle and connection worked!