Skip to main content

A globally distributed container runtime

Project description

nebulous-py

A declarative python library for the Nebulous runtime

Installation

pip install nebulous-sh

Usage

Create a pytorch container on runpod with 1 A100 GPU

from nebulous import Container, V1EnvVar

container = Container(
    name="pytorch-example",
    namespace="test",
    image="pytorch/pytorch:latest",
    platform="runpod",
    env=[V1EnvVar(name="MY_ENV_VAR", value="my-value")],
    command="nvidia-smi",
    accelerators=["1:A100_SXM"],
    proxy_port=8080,
)

while container.status.status.lower() != "running":
    print(f"Container '{container.metadata.name}' is not running, it is '{container.status.status}', waiting...")
    time.sleep(1)

print(f"Container '{container.metadata.name}' is running")

print(f"You can access the container at {container.status.tailnet_url}")

Processors

Run a python function as a stream processor.

from nebulous import Message, processor
from pydantic import BaseModel

class MyInput(BaseModel):
    a: str
    b: int

@processor(image="python:3.10-slim", accelerators=["1:A100_SXM"])
def my_function(msg: Message[MyInput]):
    return msg

msg = MyInput(a="foo", b=1)
result = my_function(msg)
print(result)

Contributing

Please open an issue or a PR to contribute to the project.

Development

make test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nebulous_sh-0.1.149.tar.gz (85.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nebulous_sh-0.1.149-py3-none-any.whl (91.6 kB view details)

Uploaded Python 3

File details

Details for the file nebulous_sh-0.1.149.tar.gz.

File metadata

  • Download URL: nebulous_sh-0.1.149.tar.gz
  • Upload date:
  • Size: 85.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for nebulous_sh-0.1.149.tar.gz
Algorithm Hash digest
SHA256 0d4ee50a7b42daa6d177e37221d8963289fccedfa5b1f45173ff48e7ea72acc6
MD5 203ce820677dffffcbb65ae06f6e798a
BLAKE2b-256 a34ea371e6b33bb48386c422cbe17177cf709fe8976cab3cf795f2028bda3faf

See more details on using hashes here.

File details

Details for the file nebulous_sh-0.1.149-py3-none-any.whl.

File metadata

File hashes

Hashes for nebulous_sh-0.1.149-py3-none-any.whl
Algorithm Hash digest
SHA256 10bc2ddb5721953635bcda224079e02d49532f9fbceaa9db6b478854d1c917f4
MD5 cc3852ccad5e165dc158d8520eadd9bd
BLAKE2b-256 45abb1d095baa6eb39cc1342446f98d9d0dab0d09100d5182817d4872814bfb5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page