Skip to content

docs: add local (non-pip) modules example for SLS-360 - #47

Open
deanq wants to merge 3 commits into
mainfrom
deanquinanola/sls-360-local-modules-example
Open

docs: add local (non-pip) modules example for SLS-360#47
deanq wants to merge 3 commits into
mainfrom
deanquinanola/sls-360-local-modules-example

Conversation

@deanq

@deanq deanq commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Adds 01_getting_started/05_local_modules/ — a CPU example that factors a Flash endpoint across local (non-pip) Python files: a sibling module (text_utils.py) and a package (greetings/, whose __init__ re-exports from a submodule). This is the capability delivered by SLS-360.

Depends on the SDK/worker change:

What it demonstrates

  • Importing a local sibling module and a local package (with __init__ + submodule) from an endpoint.
  • In-function imports — required on the live path (only the function source + its local-module closure ship to the worker) and unchanged for flash deploy.

Verification (see the example README for commands)

  • Build path (local): flash build bundles the sibling + package; a module dropped by the ignore filter (e.g. test_*.py) is force-included when an endpoint imports it; an unresolved endpoint import fails the build loudly.
  • Deploy path (real endpoint): verified end-to-end — deployed to a real CPU endpoint, the worker imported the local modules and returned {"greeting": "HOLA, ADA!"}, then torn down.
  • Live path (flash dev): works once the worker image from feat: SLS-360 import shipped local modules before executing user code runpod-workers/flash#100 is published (stock workers don't yet materialize inline modules); testable now via a locally-built worker image.

Notes

  • .flash/ build artifacts are gitignored.
  • Endpoint uses typed params (name, lang) so the queue handler's greet(**job_input) call binds {"input": {"name": ..., "lang": ...}} correctly.

@capy-ai

capy-ai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@deanq
deanq force-pushed the deanquinanola/sls-360-local-modules-example branch from 7a16b20 to f6041cc Compare July 24, 2026 19:58
deanq added 2 commits July 26, 2026 23:59
The category and root READMEs listed only 01-04, so the new
05_local_modules example was unreachable from any index.

- Add 05_local_modules to the root README example table
- Add a full section and learning-path step to the
  01_getting_started index
- Document the runpod-flash>=1.19.0 requirement; the bundling
  code is absent before 1.19.0, so every tier fails, not just
  the live path
- Pin the example to runpod-flash>=1.19.0
- Replace the vague "current published image" wording with the
  concrete stock-worker dates

Refs SLS-360

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “local (non-pip) modules” getting-started example demonstrating how Flash endpoints can import and ship sibling modules and local packages (including transitive imports via __init__.py) to workers, aligning with the SLS-360 capability.

Changes:

  • Added 01_getting_started/05_local_modules/ example with a CPU endpoint that imports a sibling module and a local package.
  • Expanded top-level and getting-started READMEs to link and describe the new example.
  • Pinned Ruff dev dependency to <0.16 to avoid Markdown code block reformatting during format checks.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Adds the new getting-started example to the main examples list.
pyproject.toml Caps Ruff version in dev dependencies to prevent Markdown reflow.
01_getting_started/README.md Documents and links the new 05_local_modules example in the learning path.
01_getting_started/05_local_modules/README.md New walkthrough explaining local-module bundling, build/deploy/live verification tiers, and usage.
01_getting_started/05_local_modules/cpu_worker.py New CPU endpoint demonstrating in-function imports of local sibling module + local package.
01_getting_started/05_local_modules/text_utils.py New sibling module used by the endpoint.
01_getting_started/05_local_modules/greetings/init.py New local package __init__ re-export to exercise transitive import bundling.
01_getting_started/05_local_modules/greetings/messages.py New package submodule providing greeting templates and render().
01_getting_started/05_local_modules/pyproject.toml Defines a per-example project with runpod-flash>=1.19.0 requirement.
01_getting_started/05_local_modules/.gitignore Ignores per-example build artifacts and local environment files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +30 to +32
# Live dev server (see the live-path note below re: worker image)
flash dev
# then: curl -s localhost:8888/cpu_worker/runsync -d '{"input": {"name": "Ada", "lang": "es"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants