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

Run with UV package manager #4428

Open
kevinsimper opened this issue Dec 2, 2024 · 8 comments
Open

Run with UV package manager #4428

kevinsimper opened this issue Dec 2, 2024 · 8 comments
Assignees

Comments

@kevinsimper
Copy link

Love skypilot 💝

I was trying to use with UV, but it fails on this command

I guess skypilot is meant to be run within a managed venv, so I get why it fails, but it would be nice if skypilot had uv support.

$ uv run sky launch -c gatx skypilot.yaml
Task from YAML spec: skypilot.yaml
Considered resources (1 node):
---------------------------------------------------------------------------------------------
 CLOUD   INSTANCE       vCPUs   Mem(GB)   ACCELERATORS   REGION/ZONE     COST ($)   CHOSEN
---------------------------------------------------------------------------------------------
 GCP     n1-highmem-4   4       26        T4:1           us-central1-a   0.59          ✔
---------------------------------------------------------------------------------------------
Launching a new cluster 'gatx'. Proceed? [Y/n]: y

Traceback (most recent call last):
  File "/Users/xx/.venv/lib/python3.12/site-packages/sky/backends/wheel_utils.py", line 103, in _build_sky_wheel
    subprocess.run([
  File "/Users/xx/.local/share/uv/python/cpython-3.12.6-macos-aarch64-none/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pip3', 'wheel', '--no-deps', '/var/folders/zy/fgmdfk0123304wg6ck35mcvm0000gn/T/tmpvsinlzlv/', '--wheel-dir', '/var/folders/zy/fgmdfk0123304wg6ck35mcvm0000gn/T/tmpvsinlzlv']' returned non-zero exit status 1.

Version & Commit info:

  • sky -v: skypilot, version 0.7.0
  • sky -c: skypilot, commit 3f62588
@concretevitamin
Copy link
Member

Thanks for the report @kevinsimper 🙌 cc @cg505 who's been looking into using uv in the backend.

@cg505
Copy link
Collaborator

cg505 commented Dec 2, 2024

Hi @kevinsimper! How did you install skypilot? Does uv pip install pip resolve this issue?

@cg505
Copy link
Collaborator

cg505 commented Dec 2, 2024

I think we should add pip as a package dependency to resolve this, since we use it during wheel build. At the moment we are just assuming it's present, but this won't be the case in uv venvs. @Michaelvll any concern with this?

@kesitrifork
Copy link

@cg505 No, you install with uv add skypilot[gcp]

The bigger problem is that uv is not a pip replacement (their words)

So running subcommand to run a pip command will execute the wrong pip executable, and wheel is not a happy command to support because of legacy reasons astral-sh/uv#1681

@cg505
Copy link
Collaborator

cg505 commented Dec 2, 2024

@kevinsimper In my testing, uv add pip (or uv pip install pip if you are just using a venv, outside a project) seems to work. It looks like uv will set up the environment correctly so that we get the right pip executable. (Specifically, it modifies PATH so that the venv bin is the very first element, and sets the VIRTUAL_ENV var as well.)
Ideally this can happen without using a subprocess, but it seems like it works either way.

@cg505
Copy link
Collaborator

cg505 commented Dec 2, 2024

To clarify, I'm NOT asking you to install pip so that you can use it to install skypilot instead of using uv - just asking you to install it so that skypilot can use it correctly during provisioning.

@cg505 cg505 self-assigned this Dec 3, 2024
@kevinsimper
Copy link
Author

@cg505 It does work and I have been using it for the past week without any problems on both a M4 and a Ubuntu machine 👍 Thanks for the suggestion!

@cg505
Copy link
Collaborator

cg505 commented Dec 9, 2024

Thanks for the confirmation! I'll look into adding this as an explicit dependency on the package so that this extra step is not necessary.

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

No branches or pull requests

4 participants