示例#1
0
    def get_store(self, store_uri=None, artifact_uri=None):
        """Get a store from the registry based on the scheme of store_uri

        :param store_uri: The store URI. If None, it will be inferred from the environment. This URI
                          is used to select which tracking store implementation to instantiate and
                          is passed to the constructor of the implementation.
        :param artifact_uri: Artifact repository URI. Passed through to the tracking store
                             implementation.

        :return: An instance of `mlflow.store.AbstractStore` that fulfills the store URI
                 requirements.
        """
        from mlflow.tracking import utils
        store_uri = store_uri if store_uri is not None else utils.get_tracking_uri(
        )
        scheme = store_uri if store_uri == "databricks" else get_uri_scheme(
            store_uri)

        try:
            store_builder = self._registry[scheme]
        except KeyError:
            raise MlflowException(
                "Unexpected URI scheme '{}' for tracking store. "
                "Valid schemes are: {}".format(store_uri,
                                               list(self._registry.keys())))
        return store_builder(store_uri=store_uri, artifact_uri=artifact_uri)
示例#2
0
文件: client.py 项目: zahraa1/mlflow
 def __init__(self, tracking_uri=None):
     """
     :param tracking_uri: Address of local or remote tracking server. If not provided, defaults
                          to the service set by ``mlflow.tracking.set_tracking_uri``. See
                          `Where Runs Get Recorded <../tracking.html#where-runs-get-recorded>`_
                          for more info.
     """
     self.tracking_uri = tracking_uri or utils.get_tracking_uri()
     self.store = utils._get_store(self.tracking_uri)
示例#3
0
 def __init__(self, tracking_uri=None, user=None):
     """
     :param tracking_uri: Address of local or remote tracking server. If not provided, defaults
                          to the service set by ``mlflow.tracking.set_tracking_uri``. See
                          `Where Runs Get Recorded <../tracking.html#where-runs-get-recorded>`_
                          for more info.
     """
     self.tracking_uri = tracking_uri or utils.get_tracking_uri()
     self.user = user or os.environ.get('MLFLOW_RANGER_USER', 'mlflow')
     os.environ['MLFLOW_RANGER_USER'] = self.user
     self.store = utils._get_store(self.tracking_uri)