vast-ai / vast-python

Vast.ai python and cli api client
MIT License
122 stars 48 forks source link

reproducing console default create instance in CLI #101

Open enpassanty opened 8 months ago

enpassanty commented 8 months ago

i've been trying to automate instance creation in python Jupyter with no success. the CLI command below creates an instance if the bid is right but it doesnt have a jupyter launch button, only SSH:

command = f"""vastai create instance {id} --image pytorch/pytorch:2.2.0-cuda12.1-cudnn8-devel --env '-e DATA_DIRECTORY=/workspace/ -e JUPYTERDIR=/' --onstart-cmd "env | grep >> /etc/environment;" --disk 100--price 0.5 --ssh --jupyter --direct"""

result = subprocess.run(command, capture_output=True, text=True, check=True, shell=True)

any idea what im doing worng?