Giter Club home page Giter Club logo

fiber's Introduction

build

drawing

Project Home   Blog   Documents   Paper   Media Coverage

Join Fiber users email list [email protected]

Fiber

Distributed Computing for AI Made Simple

This project is experimental and the APIs are not considered stable.

Fiber is a Python distributed computing library for modern computer clusters.

  • It is easy to use. Fiber allows you to write programs that run on a computer cluster level without the need to dive into the details of computer cluster.
  • It is easy to learn. Fiber provides the same API as Python's standard multiprocessing library that you are familiar with. If you know how to use multiprocessing, you can program a computer cluster with Fiber.
  • It is fast. Fiber's communication backbone is built on top of Nanomsg which is a high-performance asynchronous messaging library to allow fast and reliable communication.
  • It doesn't need deployment. You run it as the same way as running a normal application on a computer cluster and Fiber handles the rest for you.
  • It it reliable. Fiber has built-in error handling when you are running a pool of workers. Users can focus on writing the actual application code instead of dealing with crashed workers.

Originally, it was developed to power large scale parallel scientific computation projects like POET and it has been used to power similar projects within Uber.

Installation

pip install fiber

Check here for details.

Quick Start

Hello Fiber

To use Fiber, simply import it in your code and it works very similar to multiprocessing.

import fiber

if __name__ == '__main__':
    fiber.Process(target=print, args=('Hello, Fiber!',)).start()

Note that if __name__ == '__main__': is necessary because Fiber uses spawn method to start new processes. Check here for details.

Let's take look at another more complex example:

Estimating Pi

import fiber
import random

@fiber.meta(cpu=1)
def inside(p):
    x, y = random.random(), random.random()
    return x * x + y * y < 1

def main():
    NUM_SAMPLES = int(1e6)
    pool = fiber.Pool(processes=4)
    count = sum(pool.map(inside, range(0, NUM_SAMPLES)))
    print("Pi is roughly {}".format(4.0 * count / NUM_SAMPLES))

if __name__ == '__main__':
    main()

Fiber implements most of multiprocessing's API including Process, SimpleQueue, Pool, Pipe, Manager and it has its own extension to the multiprocessing's API to make it easy to compose large scale distributed applications. For the detailed API guild, check out here.

Running on a Kubernetes cluster

Fiber also has native support for computer clusters. To run the above example on Kubernetes, fiber provided a convenient command line tool to manage the workflow.

Assume you have a working docker environment locally and have finished configuring Google Cloud SDK. Both gcloud and kubectl are available locally. Then you can start by writing a Dockerfile which describes the running environment. An example Dockerfile looks like this:

# example.docker
FROM python:3.6-buster
ADD examples/pi_estimation.py /root/pi_estimation.py
RUN pip install fiber

Build an image and launch your job

fiber run -a python3 /root/pi_estimation.py

This command will look for local Dockerfile and build a docker image and push it to your Google Container Registry . It then launches the main job which contains your code and runs the command python3 /root/pi_estimation.py inside your job. Once the main job is running, it will start 4 subsequent jobs on the cluster and each of them is a Pool worker.

Supported platforms

  • Operating system: Linux
  • Python: 3.6+
  • Supported cluster management systems:
    • Kubernetes (Tested with Google Kubernetes Engine on Google cloud)

We are interested in supporting other cluster management systems like Slurm, if you want to contribute to it please let us know.

Check here for details.

Documentation

The documentation, including method/API references, can be found here.

Testing

Install test dependencies. You'll also need to make sure docker is available on the testing machine.

$ pip install -e .[test]

Run tests

$ make test

Contributing

Please read our code of conduct before you contribute! You can find details for submitting pull requests in the CONTRIBUTING.md file. Issue template.

Versioning

We document versions and changes in our changelog - see the CHANGELOG.md file for details.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Cite Fiber

@misc{zhi2020fiber,
    title={Fiber: A Platform for Efficient Development and Distributed Training for Reinforcement Learning and Population-Based Methods},
    author={Jiale Zhi and Rui Wang and Jeff Clune and Kenneth O. Stanley},
    year={2020},
    eprint={2003.11164},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

Acknowledgments

  • Special thanks to Piero Molino for designing the logo for Fiber

fiber's People

Contributors

agrimrules avatar calio avatar danilopeixoto avatar jimjag avatar rongou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fiber's Issues

test failure on AArch64, Fedora 33

Looks like all works, except for a single test error:

[jw@cn06 fiber]$ ./test_local.sh
...
tests/test_queue.py::TestQueue::test_queue_balance FAILED [100%]

======================================================= FAILURES =======================================================
_____________________________________________ TestQueue.test_queue_balance _____________________________________________

self = <tests.test_queue.TestQueue object at 0xffff9b951e80>

def test_queue_balance(self):
    # We only test SimpleQueuePush because SimpleQueuePull doesn't gurantee
    # balance.
    inqueue = fiber.queues.SimpleQueuePush()
    outqueue = fiber.queues.SimpleQueuePush()
    num_workers = 4
    multiplier = 600
    workers = []
    results = []
    for i in range(num_workers):
        print("create worker", i)
        p = fiber.Process(target=worker, args=(inqueue, outqueue, i), daemon=True)
        workers.append(p)
    for i in range(num_workers):
        workers[i].start()

    # wait for all workers to connect
    time.sleep(1)
    for i in range(num_workers * multiplier):
        inqueue.put("work")
    for i in range(num_workers * multiplier):
        results.append(outqueue.get())
    stats = collections.Counter(results)
    total = num_workers * multiplier
    # send singals to all workers
    for i in range(num_workers * multiplier):
        inqueue.put("quit")
    for i in range(num_workers):
        workers[i].join()
    for i in range(num_workers):
        #print("{}: {} {:.2f}".format(i, stats[i], stats[i] / float(total)))
        # data should be fairly queued
      assert stats[i] == 600

E assert 988 == 600
E +988
E -600

tests/test_queue.py:250: AssertionError
------------------------------------------------- Captured stdout call -------------------------------------------------
create worker 0
create worker 1
create worker 2
create worker 3
=============================================== short test summary info ================================================
FAILED tests/test_queue.py::TestQueue::test_queue_balance - assert 988 == 600
================================= 1 failed, 61 passed, 10 skipped in 242.24s (0:04:02) =================================
[jw@cn06 fiber]$

Is it possible to run fiber on OpenPai ?

We have an AI cluster built on top of OpenPai from Microsoft, Is there an avaiable backend for OpenPai? Thanks.

We use OpenPai 0.14.0 which based on kubernetes v1.9.9, v1.9.9 have no device plugin support.

AWS Support

I want to start using Fiber to make my ES experiments management workflow easier.
All my compute credits are on AWS so using GCP is not a good alternative 😢
I am ready to work on a PR to make the CLI work with AWS as well,
can someone guide me to the right place to put a new abstraction for the different cloud services?
What functions do I need to change?
Is fiber using some K8s features that are only available on GCP?

Passing multiple arguments to a method is failing

I am using starmap method in ZPool for passing multiple arguments, which is the same method we would be using in the multiprocessing library, but here when I pass the values as mentioned, it is failing and running infinitely!

A simple example code I am using is,

import fiber
from fiber.pool import Pool


@fiber.meta(cpu=1)
def add(a, b):
    return a + b


if __name__ == "__main__":
    pool = Pool(processes=4)
    ans = pool.starmap(add, [(1, 2), (4, 5)])

The exception I am getting is,

Exception in Process(PoolWorker-4, 24266)>:
Traceback (most recent call last):
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/process.py", line 289, in _bootstrap
self.run()
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/process.py", line 185, in run
return super().run()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/pool.py", line 858, in zpool_worker
wrap_exception, 0, req=req)
File "/Users/arjun/environments/fibertest/lib/python3.6/site-packages/fiber/pool.py", line 801, in zpool_worker_core
res = func(*args, **kwds)
TypeError: add() argument after ** must be a mapping, not tuple

And it is being printed indefinitely!

I am doing something wrong here ? Or is this an issue ?

Value Error (not enough values to unpack) in pool.py

ip, _, _ = backend.get_listen_addr()

I am getting the following error: ValueError: not enough values to unpack (expected 3, got 2) on line 908 in pool.py.

The error is being raised when I am calling fiber using docker as the backend.

This the command I am using to call the script: FIBER_BACKEND=docker FIBER_IMAGE=docker-test:latest python test_fiber_docker.py

Install Mac OS 11.3

Hi trying to install onto my python project on my local machine running MacOS BigSur 11.3 on Intel x86 hardware.

Using the usual pip install fiber seems to download the first PyPi commit 0.0.1, with essentially no code. The output is shown in the first block.

It appears to try and install the latest 0.2.1 release but then fails thereafter, does fiber only support OSX and not 11.3 on Mac?

When trying to run with sudo pip install fiber==0.2.1 I get a similar problem that appears related to either cmake or nnpy-bundle versioning and make -j8.

Not sure where the issue is coming from I also tried directly cloning the repo on the master branch on GitHub and running sudo python setup.py install but get the same results with a subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 126 error.

Not sure if I have missed something obvious do you have any ideas or is it better to just run from inside a docker container on 11.3, thanks!

pip install fiber                                                                                                                                                                                                                       Thu Jun 10 14:09:00 2021
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
Requirement already satisfied: fiber in /Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/fiber-0.2.1-py3.8.egg (0.2.1)
Collecting nnpy-bundle
  Using cached nnpy-bundle-1.4.2.post1.tar.gz (6.3 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/base_camp/Documents/Dev/flyer/flyervenv/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/setup.py'"'"'; __file__='"'"'/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-pip-egg-info-gbwm6a3d
         cwd: /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/
    Complete output (112 lines):
    Cloning into 'nanomsg'...
    Note: switching to '1.1.5'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at 1749fd7b Bump version to 1.1.5.
    -- The C compiler identification is AppleClang 12.0.5.12050022
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detected nanomsg ABI v5 (v5.1.0)
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE
    -- OS System is Darwin
    -- OS Version is 20.4.0
    -- Looking for gethrtime
    -- Looking for gethrtime - not found
    -- Looking for socketpair
    -- Looking for socketpair - found
    -- Looking for eventfd
    -- Looking for eventfd - not found
    -- Looking for pipe
    -- Looking for pipe - found
    -- Looking for pipe2
    -- Looking for pipe2 - not found
    -- Looking for accept4
    -- Looking for accept4 - not found
    -- Looking for epoll_create
    -- Looking for epoll_create - not found
    -- Looking for kqueue
    -- Looking for kqueue - found
    -- Looking for poll
    -- Looking for poll - found
    -- Looking for getaddrinfo_a in anl
    -- Looking for getaddrinfo_a in anl - not found
    -- Looking for clock_gettime in rt
    -- Looking for clock_gettime in rt - not found
    -- Looking for sem_wait in rt
    -- Looking for sem_wait in rt - not found
    -- Looking for sem_wait in pthread
    -- Looking for sem_wait in pthread - found
    -- Looking for gethostbyname in nsl
    -- Looking for gethostbyname in nsl - not found
    -- Looking for socket in socket
    -- Looking for socket in socket - not found
    -- Looking for CLOCK_MONOTONIC
    -- Looking for CLOCK_MONOTONIC - found
    -- Looking for atomic_cas_32
    -- Looking for atomic_cas_32 - not found
    -- Looking for AF_UNIX
    -- Looking for AF_UNIX - found
    -- Looking for backtrace_symbols_fd
    -- Looking for backtrace_symbols_fd - found
    -- Performing Test NN_HAVE_MSG_CONTROL
    -- Performing Test NN_HAVE_MSG_CONTROL - Success
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS - Success
    CMake Warning at CMakeLists.txt:294 (message):
      Could not find asciidoctor: skipping docs
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/nanomsg/build
    /bin/sh: /usr/local/CrossPack-AVR/bin/make: Bad CPU type in executable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/setup.py", line 22, in <module>
        setup(
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 445, in __init__
        _Distribution.__init__(self, {
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 734, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_ea29c03e13a1427189ff4ba9708fcc3a/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 199, in <module>
        ffi = create_module()
      File "generate.py", line 142, in create_module
        build_nanomsg_static_lib(cwd)
      File "generate.py", line 67, in build_nanomsg_static_lib
        check_call("make -j8", shell=True, cwd=build_dir)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 126.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/98/16/9adb120a225363bc86b97b805bfdfae60ee000f969f97777a416dfef95e4/nnpy-bundle-1.4.2.post1.tar.gz#sha256=319cc6115930f12d1abb3bca039743e6ff22fbe892565bbf6ce0c2eb66b04f90 (from https://pypi.org/simple/nnpy-bundle/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached nnpy-bundle-1.4.2.post0.tar.gz (6.3 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/base_camp/Documents/Dev/flyer/flyervenv/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/setup.py'"'"'; __file__='"'"'/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-pip-egg-info-h84_9ith
         cwd: /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/
    Complete output (112 lines):
    Cloning into 'nanomsg'...
    Note: switching to '1.1.5'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at 1749fd7b Bump version to 1.1.5.
    -- The C compiler identification is AppleClang 12.0.5.12050022
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detected nanomsg ABI v5 (v5.1.0)
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE
    -- OS System is Darwin
    -- OS Version is 20.4.0
    -- Looking for gethrtime
    -- Looking for gethrtime - not found
    -- Looking for socketpair
    -- Looking for socketpair - found
    -- Looking for eventfd
    -- Looking for eventfd - not found
    -- Looking for pipe
    -- Looking for pipe - found
    -- Looking for pipe2
    -- Looking for pipe2 - not found
    -- Looking for accept4
    -- Looking for accept4 - not found
    -- Looking for epoll_create
    -- Looking for epoll_create - not found
    -- Looking for kqueue
    -- Looking for kqueue - found
    -- Looking for poll
    -- Looking for poll - found
    -- Looking for getaddrinfo_a in anl
    -- Looking for getaddrinfo_a in anl - not found
    -- Looking for clock_gettime in rt
    -- Looking for clock_gettime in rt - not found
    -- Looking for sem_wait in rt
    -- Looking for sem_wait in rt - not found
    -- Looking for sem_wait in pthread
    -- Looking for sem_wait in pthread - found
    -- Looking for gethostbyname in nsl
    -- Looking for gethostbyname in nsl - not found
    -- Looking for socket in socket
    -- Looking for socket in socket - not found
    -- Looking for CLOCK_MONOTONIC
    -- Looking for CLOCK_MONOTONIC - found
    -- Looking for atomic_cas_32
    -- Looking for atomic_cas_32 - not found
    -- Looking for AF_UNIX
    -- Looking for AF_UNIX - found
    -- Looking for backtrace_symbols_fd
    -- Looking for backtrace_symbols_fd - found
    -- Performing Test NN_HAVE_MSG_CONTROL
    -- Performing Test NN_HAVE_MSG_CONTROL - Success
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS - Success
    CMake Warning at CMakeLists.txt:294 (message):
      Could not find asciidoctor: skipping docs
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/nanomsg/build
    /bin/sh: /usr/local/CrossPack-AVR/bin/make: Bad CPU type in executable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/setup.py", line 22, in <module>
        setup(
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 445, in __init__
        _Distribution.__init__(self, {
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 734, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/var/folders/sw/gcbsb7hn34v8c82rd01y87cc0000gn/T/pip-install-a1fhn_ty/nnpy-bundle_bc4319081cc24e128dbe1d1d64f0fca5/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 192, in <module>
        ffi = create_module()
      File "generate.py", line 138, in create_module
        build_nanomsg_static_lib(cwd)
      File "generate.py", line 63, in build_nanomsg_static_lib
        check_call("make -j8", shell=True, cwd=build_dir)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 126.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/f7/87/c2f42803980be039253d5f751e6da9cbc45a8a4e100aed66947bb9857a2a/nnpy-bundle-1.4.2.post0.tar.gz#sha256=16749ee6faa5bafa12e3562ff34610cd95200e9351acd2e9ef6c6e3c2572e3a7 (from https://pypi.org/simple/nnpy-bundle/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Collecting fiber
  Using cached fiber-0.2.0.tar.gz (58 kB)
  Using cached fiber-0.0.1-py3-none-any.whl
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
Installing collected packages: fiber
  Attempting uninstall: fiber
    WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
    Found existing installation: fiber 0.2.1
    Uninstalling fiber-0.2.1:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/fiber-0.2.1-py3.8.egg/tests/test_backend.py'
Check the permissions.

WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
(flyervenv) sudo pip install fiber==0.2.1 
WARNING: The directory '/Users/base_camp/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
Requirement already satisfied: fiber==0.2.1 in /Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/fiber-0.2.1-py3.8.egg (0.2.1)
Collecting nnpy-bundle
  Downloading nnpy-bundle-1.4.2.post1.tar.gz (6.3 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/base_camp/Documents/Dev/flyer/flyervenv/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-v__0m96j
         cwd: /private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/
    Complete output (112 lines):
    Cloning into 'nanomsg'...
    Note: switching to '1.1.5'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at 1749fd7b Bump version to 1.1.5.
    -- The C compiler identification is AppleClang 12.0.5.12050022
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detected nanomsg ABI v5 (v5.1.0)
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE
    -- OS System is Darwin
    -- OS Version is 20.4.0
    -- Looking for gethrtime
    -- Looking for gethrtime - not found
    -- Looking for socketpair
    -- Looking for socketpair - found
    -- Looking for eventfd
    -- Looking for eventfd - not found
    -- Looking for pipe
    -- Looking for pipe - found
    -- Looking for pipe2
    -- Looking for pipe2 - not found
    -- Looking for accept4
    -- Looking for accept4 - not found
    -- Looking for epoll_create
    -- Looking for epoll_create - not found
    -- Looking for kqueue
    -- Looking for kqueue - found
    -- Looking for poll
    -- Looking for poll - found
    -- Looking for getaddrinfo_a in anl
    -- Looking for getaddrinfo_a in anl - not found
    -- Looking for clock_gettime in rt
    -- Looking for clock_gettime in rt - not found
    -- Looking for sem_wait in rt
    -- Looking for sem_wait in rt - not found
    -- Looking for sem_wait in pthread
    -- Looking for sem_wait in pthread - found
    -- Looking for gethostbyname in nsl
    -- Looking for gethostbyname in nsl - not found
    -- Looking for socket in socket
    -- Looking for socket in socket - not found
    -- Looking for CLOCK_MONOTONIC
    -- Looking for CLOCK_MONOTONIC - found
    -- Looking for atomic_cas_32
    -- Looking for atomic_cas_32 - not found
    -- Looking for AF_UNIX
    -- Looking for AF_UNIX - found
    -- Looking for backtrace_symbols_fd
    -- Looking for backtrace_symbols_fd - found
    -- Performing Test NN_HAVE_MSG_CONTROL
    -- Performing Test NN_HAVE_MSG_CONTROL - Success
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS - Success
    CMake Warning at CMakeLists.txt:294 (message):
      Could not find asciidoctor: skipping docs
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/nanomsg/build
    /bin/sh: /usr/local/CrossPack-AVR/bin/make: Bad CPU type in executable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/setup.py", line 22, in <module>
        setup(
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 445, in __init__
        _Distribution.__init__(self, {
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 734, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_76cd094ea38d4c44b45c09af26b18768/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 199, in <module>
        ffi = create_module()
      File "generate.py", line 142, in create_module
        build_nanomsg_static_lib(cwd)
      File "generate.py", line 67, in build_nanomsg_static_lib
        check_call("make -j8", shell=True, cwd=build_dir)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 126.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/98/16/9adb120a225363bc86b97b805bfdfae60ee000f969f97777a416dfef95e4/nnpy-bundle-1.4.2.post1.tar.gz#sha256=319cc6115930f12d1abb3bca039743e6ff22fbe892565bbf6ce0c2eb66b04f90 (from https://pypi.org/simple/nnpy-bundle/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading nnpy-bundle-1.4.2.post0.tar.gz (6.3 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/base_camp/Documents/Dev/flyer/flyervenv/bin/python3.8 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-v8gh311h
         cwd: /private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/
    Complete output (112 lines):
    Cloning into 'nanomsg'...
    Note: switching to '1.1.5'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:
    
      git switch -c <new-branch-name>
    
    Or undo this operation with:
    
      git switch -
    
    Turn off this advice by setting config variable advice.detachedHead to false
    
    HEAD is now at 1749fd7b Bump version to 1.1.5.
    -- The C compiler identification is AppleClang 12.0.5.12050022
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detected nanomsg ABI v5 (v5.1.0)
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
    -- Found Threads: TRUE
    -- OS System is Darwin
    -- OS Version is 20.4.0
    -- Looking for gethrtime
    -- Looking for gethrtime - not found
    -- Looking for socketpair
    -- Looking for socketpair - found
    -- Looking for eventfd
    -- Looking for eventfd - not found
    -- Looking for pipe
    -- Looking for pipe - found
    -- Looking for pipe2
    -- Looking for pipe2 - not found
    -- Looking for accept4
    -- Looking for accept4 - not found
    -- Looking for epoll_create
    -- Looking for epoll_create - not found
    -- Looking for kqueue
    -- Looking for kqueue - found
    -- Looking for poll
    -- Looking for poll - found
    -- Looking for getaddrinfo_a in anl
    -- Looking for getaddrinfo_a in anl - not found
    -- Looking for clock_gettime in rt
    -- Looking for clock_gettime in rt - not found
    -- Looking for sem_wait in rt
    -- Looking for sem_wait in rt - not found
    -- Looking for sem_wait in pthread
    -- Looking for sem_wait in pthread - found
    -- Looking for gethostbyname in nsl
    -- Looking for gethostbyname in nsl - not found
    -- Looking for socket in socket
    -- Looking for socket in socket - not found
    -- Looking for CLOCK_MONOTONIC
    -- Looking for CLOCK_MONOTONIC - found
    -- Looking for atomic_cas_32
    -- Looking for atomic_cas_32 - not found
    -- Looking for AF_UNIX
    -- Looking for AF_UNIX - found
    -- Looking for backtrace_symbols_fd
    -- Looking for backtrace_symbols_fd - found
    -- Performing Test NN_HAVE_MSG_CONTROL
    -- Performing Test NN_HAVE_MSG_CONTROL - Success
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS - Success
    CMake Warning at CMakeLists.txt:294 (message):
      Could not find asciidoctor: skipping docs
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/nanomsg/build
    /bin/sh: /usr/local/CrossPack-AVR/bin/make: Bad CPU type in executable
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/setup.py", line 22, in <module>
        setup(
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 445, in __init__
        _Distribution.__init__(self, {
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages/setuptools/dist.py", line 734, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 219, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "/private/tmp/pip-install-sek10g5b/nnpy-bundle_2495e86fbf3a49c58724e11d4c6c5b61/.eggs/cffi-1.14.5-py3.8-macosx-10.9-x86_64.egg/cffi/setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 192, in <module>
        ffi = create_module()
      File "generate.py", line 138, in create_module
        build_nanomsg_static_lib(cwd)
      File "generate.py", line 63, in build_nanomsg_static_lib
        check_call("make -j8", shell=True, cwd=build_dir)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 126.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/f7/87/c2f42803980be039253d5f751e6da9cbc45a8a4e100aed66947bb9857a2a/nnpy-bundle-1.4.2.post0.tar.gz#sha256=16749ee6faa5bafa12e3562ff34610cd95200e9351acd2e9ef6c6e3c2572e3a7 (from https://pypi.org/simple/nnpy-bundle/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement nnpy-bundle (from fiber) (from versions: 1.4.2.post0, 1.4.2.post1)
ERROR: No matching distribution found for nnpy-bundle
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)
WARNING: Ignoring invalid distribution -iber (/Users/base_camp/Documents/Dev/flyer/flyervenv/lib/python3.8/site-packages)```


Installation issue with pip install fiber on Windows 10, Python 3.8, via conda

Hi all,

I am getting an error when running pip install fiber in my conda (v4.8.3) environment. It seems to do with a make -j8 command failing and saying at the top that no makefile was found. Was it perhaps not generated via nnpy-bundle? Or should I install first a previous version of nanomsg?

Any help would be greatly appreciated!

Make installed and in path:

$ make -version
GNU Make 4.3
Built for Windows32
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Input in command prompt:

$ pip install fiber

Output: (I've replaced my user directory with ~)

Collecting fiber
  Using cached fiber-0.2.1.tar.gz (61 kB)
Collecting nnpy-bundle
  Using cached nnpy-bundle-1.4.2.post1.tar.gz (6.3 kB)
    ERROR: Command errored out with exit status 1:
     command: '~\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'~\\AppData\\Local\\Temp\\pip-install-4ws65jt4\\nnpy-bundle\\setup.py'"'"'; __file__='"'"'~\\AppData\\Local\\Temp\\pip-install-4ws65jt4\\nnpy-bundle\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base '~\AppData\Local\Temp\pip-install-4ws65jt4\nnpy-bundle\pip-egg-info'
         cwd: ~\AppData\Local\Temp\pip-install-4ws65jt4\nnpy-bundle\
    Complete output (77 lines):
    Cloning into 'nanomsg'...
    Note: switching to '1.1.5'.

    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by switching back to a branch.

    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -c with the switch command. Example:

      git switch -c <new-branch-name>

    Or undo this operation with:

      git switch -

    Turn off this advice by setting config variable advice.detachedHead to false

    HEAD is now at 1749fd7b Bump version to 1.1.5.
    -- Building for: Visual Studio 16 2019
    -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19041.
    -- The C compiler identification is MSVC 19.24.28314.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe - works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detected nanomsg ABI v5 (v5.1.0)
    -- Looking for pthread.h
    -- Looking for pthread.h - not found
    -- Found Threads: TRUE
    -- OS System is Windows
    -- OS Version is 10.0.19041
    -- Looking for InitializeConditionVariable
    -- Looking for InitializeConditionVariable - found
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS
    -- Performing Test NN_HAVE_GCC_ATOMIC_BUILTINS - Failed
    CMake Warning at CMakeLists.txt:294 (message):
      Could not find asciidoctor: skipping docs


    -- Configuring done
    -- Generating done
    -- Build files have been written to: ~/AppData/Local/Temp/pip-install-4ws65jt4/nnpy-bundle/nanomsg/build
    make: *** No targets specified and no makefile found.  Stop.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "~\AppData\Local\Temp\pip-install-4ws65jt4\nnpy-bundle\setup.py", line 47, in <module>
        install_requires=['cffi'],
      File "~\Anaconda3\lib\site-packages\setuptools\__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "~\Anaconda3\lib\distutils\core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "~\Anaconda3\lib\site-packages\setuptools\dist.py", line 425, in __init__
        k: v for k, v in attrs.items()
      File "~\Anaconda3\lib\distutils\dist.py", line 292, in __init__
        self.finalize_options()
      File "~\Anaconda3\lib\site-packages\setuptools\dist.py", line 706, in finalize_options
        ep.load()(self)
      File "~\Anaconda3\lib\site-packages\setuptools\dist.py", line 713, in _finalize_setup_keywords
        ep.load()(self, ep.name, value)
      File "~\Anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 217, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "~\Anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "~\Anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "generate.py", line 199, in <module>
        ffi = create_module()
      File "generate.py", line 142, in create_module
        build_nanomsg_static_lib(cwd)
      File "generate.py", line 67, in build_nanomsg_static_lib
        check_call("make -j8", shell=True, cwd=build_dir)
      File "~\Anaconda3\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'make -j8' returned non-zero exit status 2.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

fiber.Pool runs tasks in serial in local mode

Hi,

I am trying fiber v0.2.1 on local machine. the experiment runs the same task on 4 processes. the task takes approx. 68 secs. while
multiprocessing lib works as expected, fiber looks like to be running in serial.

.fiberconfig
[default]
log_level=info
log_file=stdout
backend=local

def process(mplib, problem, num_tasks):
pool = mplib.Pool(processes=4)
futs = [
pool.apply_async(simple_solve, kwds={"problem": problem})
for _ in range(num_tasks)
]
return [fut.get() for fut in futs]

res, elapsed = timeit(process, mp, problem, num_tasks)
res2, elapsed2 = timeit(process, fiber, problem, num_tasks)

print("multiprocessing takes {} secs, results = {}".format(elapsed, res))
print("fiber takes {} secs, results = {}".format(elapsed2, res2))

multiprocessing takes 92.11180663108826 secs, results = [{'pid': 27242, }, {'pid': 27240, }, {'pid': 27241, }, {'pid': 27243, }]
fiber takes 255.9156596660614 secs, results = [{'pid': 27265, }, {'pid': 27265, }, {'pid': 27265, }, {'pid': 27265, }]

fiber is always using the same process pid 27265 either push or pull queue, while the multiprocessing lib is distributing the works to 4 worker processes.
but fiber's parzen_estimation example is working as expected on local machine.

Package still maintained? Alternatives?

Hi Uber / Fiber team,

We really like your minimalist approach to distribute Python workloads using K8s / Multiprocessing API. However the package's last commit is from 2021. I assume fiber is not maintained / used in production anymore?

Curious if anybody in the community is still using this and if not, what alternatives they found.

Thank you!

Add network to docker containers

I am testing/trying out fiber from my local machine. I am looking to use fiber processes to do a side-effect job (put data into databases) and use docker as the fiber backend. For testing, i have elasticsearch and postgress running in docker containers in a docker network called test.
I would like to pass network name as a parameter (just like the docker image) to the process running the docker container.
I tried it out locally and it works for me. This is the modification i made to the docker_backend.py file:

     81         try:
     82             container = self.client.containers.run(
     83                 image,
     84                 job_spec.command,
     85                 name=job_spec.name + '-' + str(uuid.uuid4()),
     86                 volumes=volumes,
     87                 cap_add=["SYS_PTRACE"],
     88                 tty=tty,
     89                 stdin_open=stdin_open,
     **90                 network="test",**
     91                 detach=True

I am not sure how to pass the network in as a parameter. Possibly via job_spec ?

Questions:

  1. Is it recommend to use Fiber process to do side-effect jobs, specifically use it and insert data into database?
    If i have 5 places i want to put the data in (elasticsearch, redis-stream, postgress, other-places), is it recommend to use 5 fiber processes to insert data into the respective "databases"

Page not found at docs

In the platform and backends session after the kubernetes topic we have:
image

But after click in the "here" link we get 404 error :
image

A Few Issues found on Kubernetes

I am following k8s part on https://uber.github.io/fiber/getting-started/ and realized the following issues:

  1. seems like k8s 'Job' only works in 'default' namespace ?
    when I try on different namespace, the master pod keep failing and recreate.

  2. poolwork pods terminate with 'Failed' status, while master pod returns 'Success'. Any way to address that ?

  3. It looks like the k8s 'Job' must have explicit 'name' instead of 'generateName', otherwise master pod throws 'Pod not found' error. Is it known issue ?

Thanks

connections error issue

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f547978c6d0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/test_harness_flows.py", line 121, in
sys.exit(main())
File "/test_harness_flows.py", line 113, in main
test_case.setup_method()
File "/test_harness_flows.py", line 26, in setup_method
self.driver = webdriver.Remote(
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 277, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 370, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 433, in execute
response = self.command_executor.execute(driver_command, params)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/remote_connection.py", line 344, in execute
return self._request(command_info[0], url, body=data)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/remote_connection.py", line 366, in _request
response = self._conn.request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/site-packages/urllib3/request.py", line 78, in request
return self.request_encode_body(
File "/usr/local/lib/python3.8/site-packages/urllib3/request.py", line 170, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/poolmanager.py", line 376, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 815, in urlopen
return self.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 815, in urlopen
return self.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 815, in urlopen
return self.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=4444): Max retries exceeded with url: /wd/hub/session (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f547978c6d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Having problem with ZPool.map_async() as it runs function sequentially.

Hello, I'm trying to use fiber in my Distributed Deep RL project and wanted to understand the basics of the fiber (and python multiprocessing). I am not sure why, but the code below does not run in parallel. Can anyone explain to me what am I doing wrong?
I'm using Anaconda Python 3.7.7 on Ubuntu Linux 18.04 LTS.

import fiber
import time


def do_something(sleep_time):
    time.sleep(sleep_time)
    return 'func id: {}, sleep time: {}'.format(sleep_time, sleep_time)


def main():
    s = time.perf_counter()
    pool = fiber.Pool(processes=4)
    times_list = [3, 1, 2, 4]

    handle = pool.map_async(do_something, times_list)
    results = handle.get()
    for i in results:
        print(i)

    dt = time.perf_counter() - s
    print(dt)


if __name__ == '__main__':
    main()

image

pip install fiber error with Python 3.8 on macOS

I get this error with pip install fiber:

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

To get this far I first did these:
pip install wheel
brew install nanomsg
installed nanomsg 1.1.5
pip install nnpy

I appreciate any help getting past this. I can provide more of the error log if needed.

Is there any plan to extend fiber beyond aws/gcp Kubernetes clusters?

So far it seems fiber only supports aws and gcp clusters, which might not be available to users for various reasons.

I believe the kubernetes_backend.py is generic enough to launch fiber 'Process' on customized Kubernetes clusters. However, it seems the fiber cli.py does not include options other than aws and gcp. I suggest we can extend fiber cli to generic Kubernetes clusters.

Number of pending pool workers

I am trying to run the example pi estimation job on Azure AKS. Everything works fine except when I launch the job with 20 processes on a 4 node AKS cluster, only 4 pool workers are Running at any given time while rest are Pending. Why is fiber Running only one pool worker on a node. How to make all poolworker containers to run.

something@something:~/something$ kubectl get po
NAME READY STATUS RESTARTS AGE
fiber-pi-estimation-55jvn 1/1 Running 0 10m
poolworker-1-b9bebeb5 1/1 Running 0 10m
poolworker-10-28cbe01d 0/1 Pending 0 10m
poolworker-11-f8719d87 0/1 Pending 0 10m
poolworker-12-3e3f1b36 0/1 Pending 0 10m
poolworker-13-1aa26fa0 0/1 Pending 0 10m
poolworker-14-6beaac80 0/1 Pending 0 10m
poolworker-15-09cde185 1/1 Running 0 10m
poolworker-16-3cdce425 0/1 Pending 0 10m
poolworker-17-298e0b8e 0/1 Pending 0 10m
poolworker-18-183c14b9 0/1 Pending 0 10m
poolworker-19-c5f2bac8 0/1 Pending 0 10m
poolworker-2-0d8b15ce 1/1 Running 0 10m
poolworker-20-49439e6d 0/1 Pending 0 10m
poolworker-3-2cada42b 0/1 Pending 0 10m
poolworker-4-55c718cc 0/1 Pending 0 10m
poolworker-5-7f76632b 0/1 Pending 0 10m
poolworker-6-35c68bd8 0/1 Pending 0 10m
poolworker-7-84171445 1/1 Running 0 10m
poolworker-8-c6d6d9ac 0/1 Pending 0 10m
poolworker-9-81ac471d 0/1 Pending 0 10m

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded (Caused by NewConnectionErr or('<urllib3.connection.HTTPConnection object at 0x7fb3be7bca58>: Failed to establish a new connection: [Errno 111] Connection refused',))

Getting this error when executing any fiber function call. Tried giving all permissions and double checked network configuration but everything seems right. As this is the broad error and this is relatively new library couldn't find solution anywhere else. I'm new to this so please point me in the right direction.

Logs look like this:

Feb 22 18:48:03 test1-797b9fdffb-jz225: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPCon
nection object at 0x7fb3be7bc710>: Failed to establish a new connection: [Errno 111] Connection refused',)': /api/v1/namespaces/default/pods/test1-797b9fdffb-jz225
Feb 22 18:48:03 test1-797b9fdffb-jz225: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPCon
nection object at 0x7fb3be7bc860>: Failed to establish a new connection: [Errno 111] Connection refused',)': /api/v1/namespaces/default/pods/test1-797b9fdffb-jz225
Feb 22 18:48:03 test1-797b9fdffb-jz225: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPCon
nection object at 0x7fb3be7bc940>: Failed to establish a new connection: [Errno 111] Connection refused',)': /api/v1/namespaces/default/pods/test1-797b9fdffb-jz225
something started
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 170, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 706, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.6/http/client.py", line 1287, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1333, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1282, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
 File "/usr/local/lib/python3.6/http/client.py", line 1042, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 980, in send
    self.connect()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 182, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fb3be7bca58>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/main.py", line 55, in <module>
    sharedQue = SimpleQueue()
  File "/usr/local/lib/python3.6/site-packages/fiber/queues.py", line 295, in __init__
    backend = get_backend()
  File "/usr/local/lib/python3.6/site-packages/fiber/backend.py", line 74, in get_backend
    name)).Backend(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/fiber/kubernetes_backend.py", line 64, in __init__
    self.default_namespace)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api/core_v1_api.py", line 22785, in read_namespaced_pod
    return self.read_namespaced_pod_with_http_info(name, namespace, **kwargs)  # noqa: E501
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api/core_v1_api.py", line 22894, in read_namespaced_pod_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 353, in call_api
    _preload_content, _request_timeout, _host)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 184, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/api_client.py", line 377, in request
    headers=headers)
File "/usr/local/lib/python3.6/site-packages/kubernetes/client/rest.py", line 243, in GET
    query_params=query_params)
  File "/usr/local/lib/python3.6/site-packages/kubernetes/client/rest.py", line 216, in request
    headers=headers)
  File "/usr/local/lib/python3.6/site-packages/urllib3/request.py", line 75, in request
    method, url, fields=fields, headers=headers, **urlopen_kw
  File "/usr/local/lib/python3.6/site-packages/urllib3/request.py", line 96, in request_encode_url
    return self.urlopen(method, url, **extra_kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/poolmanager.py", line 375, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
    **response_kw
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
    **response_kw
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 796, in urlopen
    **response_kw
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 756, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /api/v1/namespaces/default/pods/test1-797b9fdffb-jz225 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb3be7bca58>: Failed to establish a new connection: [Errno 111] Connection refused',))

Also I was getting POST method not supported (501) error when trying to run with fiber cli. It also fails. Don't know whether it's a bug.

Docker Swarm support

I want to use Fiber to execute a job queue on a Docker Swarm cluster. Fiber already has a Docker backend that spawns processes as containers. What about spawning processes as Docker Swarm services?

Swarm would be a new backend, right?

Add Python type hints to Fiber code base

Python type hints (PEP 484) is useful in improving code base readability and providing additional static type checking to find bugs related with typing.

Type hints needs to be added to all files under fiber/ directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.