Coder Social home page Coder Social logo

Comments (6)

justinmerrell avatar justinmerrell commented on June 18, 2024

Is this the functionality you are looking for? Worker | Local API Server Introduced with runpod-python 0.10.0

from runpod-python.

holwech avatar holwech commented on June 18, 2024

Yes, this is what I was looking for. I did give it a try but got an error message that made me assume that this required a test file. If that's not the case, I'm not sure exactly why this is happening. When I run python your_handler.py --test_input '{"input": { ... some input }} it works fine, but with the --rp_serve_api, I get the following error outputted in a infinite loop:

python runpod_handler.py --rp_serve_api

...
ERROR  | Error while getting job: 'NoneType' object has no attribute 'get'
WARN   | RUNPOD_WEBHOOK_GET_JOB not set, switching to get_local
WARN   | test_input.json not found, skipping local testing
ERROR  | Error while getting job: 'NoneType' object has no attribute 'get'
WARN   | RUNPOD_WEBHOOK_GET_JOB not set, switching to get_local
WARN   | test_input.json not found, skipping local testing
ERROR  | Error while getting job: 'NoneType' object has no attribute 'get'
...

Stack trace:

Traceback (most recent call last):
  File "/home/user/runpod_handler.py", line 13, in <module>
    runpod.serverless.start({"handler": handler})
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/__init__.py", line 75, in start
    asyncio.run(work_loop.start_worker(config))
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
    self.run_forever()
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
    self._run_once()
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
    handle._run()
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/work_loop.py", line 50, in start_worker
    job: Optional[Dict[str, Any]] = await get_job(session, config)
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/modules/job.py", line 48, in get_job
    next_job = _get_local()
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/modules/job.py", line 22, in _get_local
    log.warn("test_input.json not found, skipping local testing")
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/modules/logging.py", line 59, in warn
    log(message, 'WARN')
  File "/home/user/mambaforge/envs/tensorml/lib/python3.9/site-packages/runpod/serverless/modules/logging.py", line 29, in log
    print(f'{level}| {message}', flush=True)
KeyboardInterrupt

from runpod-python.

justinmerrell avatar justinmerrell commented on June 18, 2024

What version of the SDK are you using?

from runpod-python.

holwech avatar holwech commented on June 18, 2024

I'm currently on 0.9.12, which is what pip installed by default. Not sure if that's something on my side or not, as I see there are newer versions out. Does it install the newest version for you?

from runpod-python.

justinmerrell avatar justinmerrell commented on June 18, 2024

For the new versions, you will need python 3.10+. We are working on expanding backward compatibility.

from runpod-python.

holwech avatar holwech commented on June 18, 2024

Thanks, that was it. Definitely a little pain to upgrade the default python version on VMs, so supporting older versions would be useful!

from runpod-python.

Related Issues (20)

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.