Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
chage git email
Browse files Browse the repository at this point in the history
  • Loading branch information
631068264 committed Jan 26, 2022
1 parent 42cbd71 commit b969990
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
3 changes: 1 addition & 2 deletions kubeflow/fairing/deployers/tfjob/tfjob.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import copy
import logging

from kubernetes import client as k8s_client

from kubeflow.fairing.constants import constants
from kubeflow.fairing.deployers.job.job import Job
from kubeflow.training import V1ReplicaSpec, V1RunPolicy
from kubeflow.training import V1TFJob
from kubeflow.training import V1TFJobSpec
from kubernetes import client as k8s_client

logger = logging.getLogger(__name__)

Expand Down
29 changes: 12 additions & 17 deletions kubeflow/fairing/kubernetes/manager.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import logging

import retrying
import yaml

from kubernetes import client, config, watch
from kfserving import KFServingClient

from kubeflow.training import TFJobClient
from kubeflow.training import PyTorchJobClient

from kubeflow.fairing.utils import is_running_in_k8s, camel_to_snake
from kubeflow.fairing.constants import constants
from kubeflow.fairing import utils
from kubeflow.fairing.constants import constants
from kubeflow.fairing.utils import is_running_in_k8s, camel_to_snake
from kubeflow.training import PyTorchJobClient
from kubeflow.training import TFJobClient
from kubernetes import client, config, watch

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -92,7 +90,6 @@ def delete_tf_job(self, name, namespace):
persist_config=self.persist_config)
return tfjob_client.delete(name, namespace=namespace)


def create_pytorch_job(self, namespace, pytorchjob):
"""Create the provided PyTorchJob in the specified namespace.
The PyTorchJob version is defined in PYTORCH_JOB_VERSION in kubeflow.pytorch.constants.
Expand Down Expand Up @@ -163,8 +160,8 @@ def create_isvc(self, namespace, isvc):
return created_isvc
except client.rest.ApiException:
raise RuntimeError("Failed to create InferenceService. Perhaps the CRD "
"InferenceService version {} is not installed? "\
.format(constants.KFSERVING_VERSION))
"InferenceService version {} is not installed? " \
.format(constants.KFSERVING_VERSION))

def delete_isvc(self, name, namespace):
"""Delete the provided InferenceService in the specified namespace.
Expand Down Expand Up @@ -232,7 +229,7 @@ def create_secret(self, namespace, secret):
api_instance = client.CoreV1Api()
return api_instance.create_namespaced_secret(namespace, secret)

def get_service_external_endpoint(self, name, namespace, selectors=None): #pylint:disable=inconsistent-return-statements
def get_service_external_endpoint(self, name, namespace, selectors=None): # pylint:disable=inconsistent-return-statements
"""Get the service external endpoint as http://ip_or_hostname:5000/predict.
:param name: The sevice name
Expand All @@ -255,10 +252,10 @@ def get_service_external_endpoint(self, name, namespace, selectors=None): #pylin
event['type'],
event['object'])
ing = svc.status.load_balancer.ingress
if ing is not None and len(ing) > 0: #pylint:disable=len-as-condition
if ing is not None and len(ing) > 0: # pylint:disable=len-as-condition
# temporarily disable hostname. It's causing CI to fail when
# run through papermill
#url = "http://{}:5000/predict".format(ing[0].ip or ing[0].hostname)
# url = "http://{}:5000/predict".format(ing[0].ip or ing[0].hostname)
url = "http://{}:5000/predict".format(ing[0].ip)
return url
except ValueError as v:
Expand Down Expand Up @@ -334,8 +331,7 @@ def log(self, name, namespace, selectors=None, container='', follow=True):
finally:
tail.release_conn()


def apply_namespaced_object(self, spec, mode='create'): #pylint:disable=too-many-branches
def apply_namespaced_object(self, spec, mode='create'): # pylint:disable=too-many-branches
"""Run apply on the provided Kubernetes specs.
:param specs: The YAML specs to apply.
Expand Down Expand Up @@ -403,7 +399,6 @@ def apply_namespaced_object(self, spec, mode='create'): #pylint:disable=too-many

return result


def apply_namespaced_objects(self, specs, mode='create'):
"""Run apply on the provided Kubernetes specs.
Expand Down

0 comments on commit b969990

Please sign in to comment.