Repository navigation
Conversation
- asyncio_job_request: drop the Windows-only event loop policy that raised AttributeError on macOS and Linux; pass an explicit timeout to job.output() - create_endpoint: replace a base image tag that does not exist with runpod/mock-worker:latest; refresh the create_template base image - replace the removed `runpod config` command with `rp login` - run_sync: also catch requests.exceptions.Timeout - logger: document local text output and deployed JSON output - concurrent_handler: use a real async handler and modifier - rest_wrapper: keep the pod id from create_pod; describe what it does - use YOUR_ENDPOINT_ID placeholders; note the mock-worker input SLS-1000
- examples/README.md: prerequisites, which folder to start with, running handlers locally, getting an endpoint id, cost and cleanup - point the top-level README Examples link at the index - api examples: unique names, cleanup commands, placeholder registry credentials; get_endpoints prints ids and names only instead of every endpoint's env - endpoints/run.py: wait with a timeout instead of printing None - rest_wrapper.py: terminate the pod in a finally block SLS-1000
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the examples under
examples/api,examples/endpoints,examples/serverless, andexamples/rest_wrapper.py.examples/appsis unchanged: it matches the current SDK, and #557 already touches it.endpoints/asyncio_job_request.pyasyncio.WindowsSelectorEventLoopPolicy()raisesAttributeErroron macOS and Linux.await job.output()with the default timeout raisesTimeoutErrorimmediately on current releases (SDK fix in #662).timeout=tojob.output().api/create_endpoint.pyrunpod/base:0.4.4does not exist on Docker Hub.runpod/mock-worker:latest, a real serverless worker.api/create_template.pyrunpod/base:0.1.0.runpod/base:2.0.0-ubuntu2404.api/*,endpoints/*runpod config, which no longer exists.rp login.endpoints/run_sync.pyexcept TimeoutErrormissesrequests.exceptions.Timeout, which is raised when the HTTP wait exceedstimeout.serverless/logger.pyRUNPOD_ENDPOINT_IDis set.serverless/concurrent_handler.pyasync_generator_handlerwas not a generator; the modifier was a no-op.rest_wrapper.pystop_pod's response for the pod id.create_pod. Describe what the script does.endpoints/health.py,run.py,run_sync.py,streaming.pystreaming.pysent mock-worker-only input without saying so.YOUR_ENDPOINT_IDplaceholders; note which worker the streaming input targets.Second commit: new-user pass
examples/README.md(new): prerequisites, which folder to start with, running handlers locally, getting an endpoint id, cost and cleanup. The top-level README's Examples link now points here instead ofexamples/apps.api/*: unique names (re-running no longer collides on template names), cleanup commands, placeholder registry credentials.get_endpoints.pyprints ids and names instead of every endpoint's full config, includingenv.endpoints/run.py: waits with a timeout. The bareoutput()call printedNonewhile the job was queued.rest_wrapper.py: terminates the pod infinally, so a failed resume doesn't leave a billable pod running.Why
None of these files run in CI, so they had drifted from the SDK. Running examples in CI is tracked separately.
Test plan
make quality-check(2773 passed)serverless/logger.py: output matches the comments, both locally and withRUNPOD_ENDPOINT_IDsetserverless/concurrent_handler.pyandsimple_handler.pywith--test_inputendpoints/asyncio_job_request.py,run.py,run_sync.py,health.py,streaming.pyagainst a local fake API (RUNPOD_ENDPOINT_BASE_URL), with jobs going from IN_PROGRESS to COMPLETEDendpoints/run.py(second commit) against the fake API: prints the status, then the outputapi/*andrest_wrapper.pynot run: they create billable resources. Only the signatures and the image tags were checked.