Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add decorator for running functions as SkyPilot tasks #3776

Closed
wants to merge 1 commit into from

Conversation

colinjc
Copy link
Contributor

@colinjc colinjc commented Jul 23, 2024

Experimental decorator for wrapping functions and submitting them as SkyPilot tasks.

UX issues:

  • Cloudpickle requires exact matching Python versions to work correctly, but the docker image already includes a Python binary. How can we make matching these as simple as possible?
  • No return value support yet. Possible by pickling and writing out the return value to a folder and syncing it back, but would require some extra work.
name: hello-spot

resources:
  accelerators: L4:1
  use_spot: true
  cloud: kubernetes

workdir: .

setup: |
  pip install uv
  uv pip install -r ./requirements.txt
  echo "Running setup."

run: |
  echo "Hello, SkyPilot!"
from sky.decorators import sky_task

capture_me = "captured"

@sky_task(task="hello_spot.yaml", cluster_name="colin-fixed-test")
def test_remote(a, /, b="c"):
    print(f"hello {a} and {b}. capture: {capture_me}")

test_remote(1)

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: conda deactivate; bash -i tests/backward_compatibility_tests.sh

Copy link
Contributor

This PR is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Nov 21, 2024
Copy link
Contributor

github-actions bot commented Dec 1, 2024

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions bot closed this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant