Skip to content

Commit

Permalink
fix: Removed dupped job creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniochavesgarcia committed Sep 18, 2024
1 parent 44252b1 commit e1f3c30
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions backend/automl/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
# Generate random string of 5 characters
federated_string_id = ''.join(random.choices(string.digits + string.ascii_lowercase, k=8))
Expand Down Expand Up @@ -622,8 +622,8 @@ def post(self, request, format=None):
job_manifest['spec']['template']['spec']['containers'][0]['env'].append({'name': 'ETH_WALLET_KEY', 'value': str(os.environ.get('FEDML_BLOCKCHAIN_WALLET_KEY'))})
job_manifest['spec']['template']['spec']['containers'][0]['env'].append({'name': 'ETH_BLOCKSCOUT_URL', 'value': str(os.environ.get('FEDML_BLOCKCHAIN_BLOCKSCOUT_URL'))})

resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
if not deployment.federated:
job_manifest = {
Expand Down Expand Up @@ -666,8 +666,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
# Generate random string of 5 characters
federated_string_id = ''.join(random.choices(string.digits + string.ascii_lowercase, k=8))
Expand Down Expand Up @@ -719,8 +719,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))

elif result.model.distributed and result.model.father == None:
"""Obteins all the distributed models from a deployment and creates a job for each group of them"""
Expand Down Expand Up @@ -784,8 +784,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
# Generate random string of 5 characters
federated_string_id = ''.join(random.choices(string.digits + string.ascii_lowercase, k=8))
Expand Down Expand Up @@ -837,8 +837,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
if not deployment.federated:
job_manifest = {
Expand Down Expand Up @@ -884,8 +884,8 @@ def post(self, request, format=None):
}
}
}
resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
logging.info("Job created. status='%s'" % str(resp.status))
# resp = api_instance.create_namespaced_job(body=job_manifest, namespace=settings.KUBE_NAMESPACE)
# logging.info("Job created. status='%s'" % str(resp.status))
else:
# Generate random string of 5 characters
federated_string_id = ''.join(random.choices(string.digits + string.ascii_lowercase, k=8))
Expand Down

0 comments on commit e1f3c30

Please sign in to comment.