Skip to content
Merged
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
12 changes: 6 additions & 6 deletions distributask/distributask.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def search_offers(self, max_price: float) -> List[Dict]:
raise

def create_instance(
self, offer_id: str, image: str, module_name: str, settings: Dict = None, command: str = None
self, offer_id: str, image: str, module_name: str, env_settings: Dict, command: str
) -> Dict:
"""
Create an instance on the Vast.ai platform.
Expand All @@ -543,13 +543,13 @@ def create_instance(
if command is None:
command = f"celery -A {module_name} worker --loglevel=info --concurrency=1 --without-heartbeat"

if settings is None:
settings = self.settings
if env_settings is None:
env_settings = self.settings

json_blob = {
"client_id": "me",
"image": image,
"env": settings,
"env": env_settings,
"disk": 32, # Set a non-zero value for disk
"onstart": f"export PATH=$PATH:/ && cd ../ && {command}",
"runtype": "ssh ssh_proxy",
Expand Down Expand Up @@ -588,7 +588,7 @@ def rent_nodes(
max_nodes: int,
image: str,
module_name: str,
settings: Dict,
env_settings: Dict = None,
command: str = None,
) -> List[Dict]:
"""
Expand Down Expand Up @@ -629,7 +629,7 @@ def rent_nodes(
break
try:
instance = self.create_instance(
offer["id"], image, module_name, settings, command
offer["id"], image, module_name, env_settings=env_settings, command=command
)
atexit.register(self.destroy_instance, instance["new_contract"])
rented_nodes.append(
Expand Down