Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion callbacks/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from beam import function


@function(callback_url="https://www.beam.cloud/")
@function(app="examples", callback_url="https://www.beam.cloud/")
def handler(x):
return {"result": x}

Expand Down
2 changes: 1 addition & 1 deletion custom_images/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)


@endpoint(image=image)
@endpoint(app="examples", image=image)
def handler():
import torch

Expand Down
1 change: 1 addition & 0 deletions endpoints/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


@endpoint(
app="examples",
cpu=1.0,
memory=128,
)
Expand Down
2 changes: 1 addition & 1 deletion functions/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from beam import function


@function(cpu="100m", memory="100Mi") # Each function runs on 100 millicores of CPU
@function(app="examples", cpu="100m", memory="100Mi") # Each function runs on 100 millicores of CPU
def square(x):
sum = 0

Expand Down
2 changes: 1 addition & 1 deletion gpu_acceleration/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from beam import endpoint


@endpoint(gpu="T4")
@endpoint(app="examples", gpu="T4")
def handler():
print(subprocess.check_output(["nvidia-smi"]))
return "This container has a GPU attached 📡!"
Expand Down
2 changes: 1 addition & 1 deletion keep_warm/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


# Each container will stay up for 5 min before shutting down automatically
@endpoint(keep_warm_seconds=300)
@endpoint(app="examples", keep_warm_seconds=300)
def handler():
return "warm"
2 changes: 1 addition & 1 deletion outputs/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from beam import Image, Output, function

@function(image=Image().add_python_packages(["pillow"]))
@function(app="examples", image=Image().add_python_packages(["pillow"]))
def save_image():
from PIL import Image as PILImage

Expand Down
1 change: 1 addition & 0 deletions preload_models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def download_models():


@endpoint(
app="examples",
on_start=download_models,
volumes=[Volume(name="weights", mount_path=CACHE_PATH)],
cpu=1,
Expand Down
1 change: 1 addition & 0 deletions quickstart/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


@endpoint(
app="examples",
name="quickstart",
cpu=1,
memory="1Gi",
Expand Down
2 changes: 1 addition & 1 deletion scaling_out/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from beam import function


@function(cpu=0.1)
@function(app="examples", cpu=0.1)
def square(i: int):
return i**2

Expand Down
2 changes: 1 addition & 1 deletion secrets/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
os.environ["FOO"] = "bar"


@function(secrets=["FOO"])
@function(app="examples", secrets=["FOO"])
def handler():
import os

Expand Down
2 changes: 1 addition & 1 deletion sharing_state/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from beam import Queue, function


@function(cpu=0.1)
@function(app="examples", cpu=0.1)
def access_queue():
q = Queue(name="myqueue")
return q.pop()
Expand Down
1 change: 1 addition & 0 deletions task_queues/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


@task_queue(
app="examples",
cpu=1.0,
memory=128,
gpu="T4",
Expand Down
1 change: 1 addition & 0 deletions tests/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _create_beta9_script():

@schedule(
"0 2,14,19 * * 1-5",
app="examples",
secrets=[
"BEAM_WORKSPACE_ID",
"BEAM_AUTH_TOKEN",
Expand Down
1 change: 1 addition & 0 deletions volumes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


@function(
app="examples",
volumes=[Volume(name="example-volume", mount_path=VOLUME_PATH)],
)
def access_files():
Expand Down