ERROR: redis-examples failed

43 views
Skip to first unread message

Bao Bao

unread,
Jul 1, 2020, 12:15:50 PM7/1/20
to Asylo Users
Hello,

I am following the instruction from https://github.com/google/asylo-examples/tree/master/redis to run Redis inside Enclaves and got the below errors.

qinkun@sgx8:~/examples/asylo-examples/redis$ cd ~/examples/asylo-examples/redis/
qinkun@sgx8:~/examples/asylo-examples/redis$ docker run -it --rm     -v ${PWD}:/opt/my-project     --tmpfs /root/.cache/bazel:exec     -w /opt/my-project     --network host     gcr.io/asylo-framework/asylo:buildenv-v0.5.2
root@sgx8:/opt/my-project# ls -al
total 52
drwxrwxr-x 2 1004 1004  4096 Jul  1 16:00 .
drwxr-xr-x 1 root root  4096 Jul  1 16:10 ..
-rw-rw-r-- 1 1004 1004  1387 Jul  1 15:59 .bazelrc
-rw-rw-r-- 1 1004 1004  3158 Jul  1 15:50 BUILD
-rw-rw-r-- 1 1004 1004  9125 Jul  1 15:50 README.md
-rw-rw-r-- 1 1004 1004   824 Jul  1 15:52 WORKSPACE
-rw-rw-r-- 1 1004 1004  1666 Jul  1 15:50 redis_enclave_config.cc
-rw-rw-r-- 1 1004 1004 13162 Jul  1 15:50 redis_test.cc
root@sgx8:/opt/my-project# bazel build --config=sgx-sim :asylo_redis
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Call stack for the definition of repository 'boringssl' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_asylo/asylo/bazel/asylo_deps.bzl:166:9
 - /opt/my-project/WORKSPACE:23:1
INFO: Call stack for the definition of repository 'com_github_grpc_grpc' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_asylo/asylo/bazel/asylo_deps.bzl:257:9
 - /opt/my-project/WORKSPACE:23:1
INFO: Call stack for the definition of repository 'sgx_dcap' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_asylo/asylo/bazel/sgx_deps.bzl:58:9
 - /opt/my-project/WORKSPACE:26:1
INFO: Call stack for the definition of repository 'com_google_protobuf' which is a http_archive (rule definition at /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
 - /root/.cache/bazel/_bazel_root/b6bc0828d5b43c7085b650e0698bf388/external/com_google_asylo/asylo/bazel/asylo_deps.bzl:248:9
 - /opt/my-project/WORKSPACE:23:1
ERROR: /opt/my-project/BUILD:52:1: error loading package '@com_github_antirez_redis//': Label '@com_github_antirez_redis//third_party/bazel_rules/rules_cc/cc:defs.bzl' is invalid because 'third_party/bazel_rules/rules_cc/cc' is not a package; perhaps you meant to put the colon here: '@com_github_antirez_redis//:third_party/bazel_rules/rules_cc/cc/defs.bzl'? and referenced by '//:asylo_redis_application_library'
ERROR: Analysis of target '//:asylo_redis' failed; build aborted: Analysis failed
INFO: Elapsed time: 7.775s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (57 packages loaded, 2435 targets configured)
    currently loading: @com_google_asylo//asylo/identity/sgx ... (3 packages)
    Fetching @rules_python; fetching
WORKSPACE:
workspace(name = "asylo_redis_example")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Asylo
http_archive(
    name = "com_google_asylo",
    sha256 = "7a32cb64b3f5cb2f2716eef063db0caccf7bafd9c771183b3e0146df2bc1697d",
    strip_prefix = "asylo-0.5.2",
)

# Redis
http_archive(
    name = "com_github_antirez_redis",
    build_file = "@com_google_asylo//asylo/distrib:redis.BUILD",
    sha256 = "2761422599f8969559e66797cd7f606c16e907bf82d962345a7d366c5d1278df",
    strip_prefix = "redis-5.0.7",
)

load("@com_google_asylo//asylo/bazel:asylo_deps.bzl", "asylo_deps")
asylo_deps()

load("@com_google_asylo//asylo/bazel:sgx_deps.bzl", "sgx_deps")
sgx_deps()

BUILD FILE:
copy from

OS: 4.15.0-64-generic #73-Ubuntu 18.04 LTS
CPU: Intel(R) Xeon(R) E-2186G CPU @ 3.80GHz


I once use the same machine to test other examples in https://github.com/google/asylo-examples. They all work as expected. Any kind of help would be appreciated. Thanks.

Bao

Dionna (Asylo Team)

unread,
Jul 1, 2020, 12:38:37 PM7/1/20
to Asylo Users
This error appears to be due to the example repo update to release 0.5.3 but the instructions still stating 0.5.2. If you change WORKSPACE to have

http_archive(
    name = "com_google_asylo",
    sha256 = "012e786e9b691093b5e2c42b255986bcab1cadf9e25f9d024eab7adee25124b0",
    strip_prefix = "asylo-0.5.3",
)

instead for Asylo, the build will succeed. You should probably use the 0.5.3 buildenv as well.

Bao Bao

unread,
Jul 1, 2020, 1:10:07 PM7/1/20
to Asylo Users
It works! Thanks for the help. I created a PR to the instructions:

Reply all
Reply to author
Forward
0 new messages