alipay / ant-ray

A high-performance distributed execution engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goworker compiling issue

valiantljk opened this issue · comments

What is the problem?

I tried to test the go worker, and followed the readme, got the following error:

go build -o worker pkg/worker/main.go
# github.com/ray-project/ray-go-worker/pkg/ray
pkg/ray/global_state_accessor.go:7:13: fatal error: 'go_worker.h' file not found

Ray version and other system information (Python version, TensorFlow version, OS):
Ray version: 1.5.2
Python version: 3.8.3
Go version: go1.15.3 darwin/amd64

Reproduction (REQUIRED)

Please provide a short code snippet (less than 50 lines if possible) that can be copy-pasted to reproduce the issue. The snippet should have no external library dependencies (i.e., use fake or mock data / environments):

If the code snippet cannot be run by itself, the issue will be closed with "needs-repro-script".

  • I have verified my script runs in a clean environment and reproduces the issue.
  • I have verified the issue also occurs with the latest wheels.

There are some hard-code directory path, I will fix it.

Thanks @chenk008 , I followed the steps, but failed during pip install -e . --verbose

    ERROR: /private/var/tmp/_bazel_dr6jl/465edb648d644af8f99f4cdaa0878e4b/external/com_github_facebook_zstd/BUILD.bazel:14:11: Compiling lib/compress/zstd_compress.c failed: (Exit 1): cc_wrapper.sh failed: error executing command
      (cd /private/var/tmp/_bazel_dr6jl/465edb648d644af8f99f4cdaa0878e4b/sandbox/darwin-sandbox/648/execroot/com_github_ray_project_ray && \
      exec env - \
        LANG=en_US.UTF-8 \
        PATH='/usr/local/opt/gnu-getopt/bin:/usr/local/opt/gnu-getopt/bin:/Users/dr6jl/Downloads/google-cloud-sdk/bin:/Users/dr6jl/anaconda3/condabin:/Users/dr6jl/Downloads/apache-maven-3.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/puppetlabs/bin:/usr/local/munki:/Users/dr6jl/anaconda3/bin://Applications/Sublime Text.app/Contents/SharedSupport/bin:/Users/dr6jl/Documents/oap-raydp/dist/spark/bin:/Users/dr6jl/.local/bin' \
        PWD=/proc/self/cwd \
      external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer -MD -MF bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd/_objs/compress/zstd_compress.pic.d '-frandom-seed=bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd/_objs/compress/zstd_compress.pic.o' -fPIC -DZSTD_MULTITHREAD '-DXXH_NAMESPACE=ZSTD_' -iquote external/com_github_facebook_zstd -iquote bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd -isystem external/com_github_facebook_zstd/lib/common -isystem bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd/lib/common -isystem external/com_github_facebook_zstd/lib -isystem bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd/lib -Werror -w -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/com_github_facebook_zstd/lib/compress/zstd_compress.c -o bazel-out/darwin-fastbuild/bin/external/com_github_facebook_zstd/_objs/compress/zstd_compress.pic.o)
    Execution platform: @local_config_platform//:host

    Use --sandbox_debug to see verbose messages from the sandbox
    external/com_github_facebook_zstd/lib/compress/zstd_compress.c:704:8: error: conflicting types for 'ZSTD_CCtx_getParameter'
    size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value)
           ^
    /usr/local/include/zstd.h:1914:20: note: previous declaration is here
    ZSTDLIB_API size_t ZSTD_CCtx_getParameter(const ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value);
                       ^
    external/com_github_facebook_zstd/lib/compress/zstd_compress.c:709:8: error: conflicting types for 'ZSTD_CCtxParams_getParameter'
    size_t ZSTD_CCtxParams_getParameter(
           ^
    /usr/local/include/zstd.h:1969:20: note: previous declaration is here
    ZSTDLIB_API size_t ZSTD_CCtxParams_getParameter(const ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);
                       ^
    external/com_github_facebook_zstd/lib/compress/zstd_compress.c:2129:1: error: static declaration of 'ZSTD_compressSequences' follows non-static declaration
    ZSTD_compressSequences(seqStore_t* seqStorePtr,
    ^
    /usr/local/include/zstd.h:1423:20: note: previous declaration is here
    ZSTDLIB_API size_t ZSTD_compressSequences(ZSTD_CCtx* const cctx, void* dst, size_t dstSize,
                       ^
    external/com_github_facebook_zstd/lib/compress/zstd_compress.c:2337:20: error: no member named 'matchPos' in 'ZSTD_Sequence'
            outSeqs[i].matchPos = (unsigned int)position;
            ~~~~~~~~~~ ^
    external/com_github_facebook_zstd/lib/compress/zstd_compress.c:2405:13: error: too many arguments to function call, expected 7, have 10
                zc->entropyWorkspace, HUF_WORKSPACE_SIZE /* statically allocated in resetCCtx */,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/zstd.h:1423:1: note: 'ZSTD_compressSequences' declared here
    ZSTDLIB_API size_t ZSTD_compressSequences(ZSTD_CCtx* const cctx, void* dst, size_t dstSize,
    ^
    /usr/local/include/zstd.h:35:23: note: expanded from macro 'ZSTDLIB_API'
    #  define ZSTDLIB_API ZSTDLIB_VISIBILITY
                          ^
    /usr/local/include/zstd.h:25:32: note: expanded from macro 'ZSTDLIB_VISIBILITY'
    #    define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default")))
                                   ^
    5 errors generated.

I was able to run the two cmds:

pip install -e . --verbose
bazel build //:libcore_worker_library_go.so

and

export LD_LIBRARY_PATH=${PWD}/bazel-bin/:$LD_LIBRARY_PATH

but when I run ray start --head --port=6379, I got the following error:

dr6jl$ ray start --head --port==6379
<frozen importlib._bootstrap>:219: RuntimeWarning: compiletime version 3.6 of module 'ray._raylet' does not match runtime version 3.8
<frozen importlib._bootstrap>:219: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 864 from C header, got 880 from PyObject
Traceback (most recent call last):
  File "/Users/dr6jl/anaconda3/bin/ray", line 33, in <module>
    sys.exit(load_entry_point('ray', 'console_scripts', 'ray')())
  File "/Users/dr6jl/anaconda3/bin/ray", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/Users/dr6jl/anaconda3/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/Users/dr6jl/anaconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/dr6jl/Documents/ray/python/ray/__init__.py", line 77, in <module>
    import ray._raylet  # noqa: E402
  File "python/ray/_raylet.pyx", line 103, in init ray._raylet
  File "/Users/dr6jl/Documents/ray/python/ray/_private/gcs_utils.py", line 1, in <module>
    from ray.core.generated.common_pb2 import ErrorType
ModuleNotFoundError: No module named 'ray.core.generated.common_pb2'

Hi @valiantljk , golang worker has not been supported yet.