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

bazel failed to build tensorflow serving #7943

Closed
srikanthjoshi opened this issue Apr 4, 2019 · 9 comments
Closed

bazel failed to build tensorflow serving #7943

srikanthjoshi opened this issue Apr 4, 2019 · 9 comments
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) team-Rules-Java Issues for Java rules

Comments

@srikanthjoshi
Copy link

ATTENTION! Please read and follow:

Description of the problem / feature request:

Failing to build tensorflow serving with below error:

[root@brazossrik01 serving]# bazel --server_javabase=$JAVA_HOME build tensorflow_serving/...
WARNING: Running Bazel server needs to be killed, because the startup options are different.
Starting local Bazel server and connecting to it...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/util:any_ptr_test' failed; build aborted:

/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 9.330s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (58 packages loaded, 592 targets configured)
currently loading: @protobuf_archive// ... (4 packages)
Fetching @local_jdk; fetching
[root@brazossrik01 serving]#

I have JAVA_HOME set already.

[root@brazossrik01 serving]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk
[root@brazossrik01 serving]#

bazel installation was successful with --host_javabase=@local_jdk//:jdk.

When building tensorflow serving, I am asked to put host_javabase , but bazel build doesn't have that argument itself.

[root@brazossrik01 serving]# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bazel build tensorflow_serving/...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/core:aspired_version_policy_test' failed; build aborted:

/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 2.204s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 6 targets configured)
currently loading: @org_tensorflow//tensorflow/core ... (5 packages)
[root@brazossrik01 serving]#

Feature requests: what underlying problem are you trying to solve with this feature?

Unable to build tensorflow serving using bazel

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Install bazel 0.24
  2. Get git clone using git clone https://github.com/tensorflow/serving.git
  3. cd serving
  4. Run bazel build tensorflow_serving/...

What operating system are you running Bazel on?

RHEL 8.0 PPC64 LE

What's the output of bazel info release?

[root@brazossrik01 serving]# bazel info release
release 0.24.0- (@non-git)
[root@brazossrik01 serving]#

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

Replace this line with your answer.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

[root@brazossrik01 serving]# git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
https://github.com/tensorflow/serving.git
dd2f22b59632b08e2d5341eeed902b72ab50a4b1
dd2f22b59632b08e2d5341eeed902b72ab50a4b1
[root@brazossrik01 serving]#

Have you found anything relevant by searching the web?

Nothing useful found.

Replace these lines with your answer.

Places to look:

Any other information, logs, or outputs that you want to share?

[root@brazossrik01 serving]# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bazel build tensorflow_serving/...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/core:aspired_version_policy_test' failed; build aborted:

/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 2.204s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 6 targets configured)
currently loading: @org_tensorflow//tensorflow/core ... (5 packages)
[root@brazossrik01 serving]#

@irengrig irengrig added team-Rules-Java Issues for Java rules untriaged labels Apr 8, 2019
@srikanthjoshi
Copy link
Author

Hi - Any updates I can get ? I am kind of blocked here as tensorflow serving build is getting failed. Please let me know if there is any workaround available. Thanks !

@sethbruder
Copy link

Try building with JDK 10.
I had a very similar error message: it seems that despite the docs (https://docs.bazel.build/versions/master/install-compile-source.html) -- which, as of today say only JDK 8 is supported -- JDK 8 is no longer well supported (see https://blog.bazel.build/2018/09/14/bazel-0.17.html for some hints about this, but I did not find those workarounds worked for later releases).
I'm sure Bazel is a great piece of software, but building Bazel, and working around it's many interwoven and often hard-coded or deeply embedded expectations, continues to be the hardest part of building Tensorflow.

@iirina
Copy link
Contributor

iirina commented May 29, 2019

Hi @srikanthjoshi, sorry for the late reply! Do you still have this problem?

@iirina
Copy link
Contributor

iirina commented May 29, 2019

Does bazel build tensorflow_serving/... --host_javabase=@local_jdk//:jdk work for you?

@srikanthjoshi
Copy link
Author

Hi - I tried with --host_javabase=@local_jdk//:jdk, it didn't work either. I got pre-built package. So, I am proceeding further with pre-built package. However, we might need to address this.

@iirina
Copy link
Contributor

iirina commented Jun 24, 2019

What error are you getting with bazel build tensorflow_serving/... --host_javabase=@local_jdk//:jdk?

@psyhtest
Copy link

I'm sure Bazel is a great piece of software, but building Bazel, and working around it's many interwoven and often hard-coded or deeply embedded expectations, continues to be the hardest part of building Tensorflow.

So true.

@Flamefire
Copy link
Contributor

it seems that despite the docs (https://docs.bazel.build/versions/master/install-compile-source.html) -- which, as of today say only JDK 8 is supported -- JDK 8 is no longer well supported (see https://blog.bazel.build/2018/09/14/bazel-0.17.html for some hints about this, but I did not find those workarounds worked for later releases).

Very nice indeed. Having docs stating only JDK8 is supported but failing to work with JDK8 without jumping through hoops (if it works at all). I don't get why a build system would be build on top of Java which is proprietary and a real nightmare to install, especially on e.g. Power9

@wookayin
Copy link

I ran into this error. After quite a bit of troubleshoothing, I had to specify JAVA_BASE manually as follows:

#13573 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) team-Rules-Java Issues for Java rules
Projects
None yet
Development

No branches or pull requests

8 participants