Skip to content

Commit

Permalink
Merge pull request #81 from DeepAI-Research/antbaez/fixing_issues
Browse files Browse the repository at this point in the history
Antbaez/fixing issues
  • Loading branch information
antbaez9 authored Jul 11, 2024
2 parents 5983928 + 11ed376 commit d080e5a
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit d080e5a

Please sign in to comment.