Construct a new GraphScope session. Args: config (dict or str, optional): The configuration dict or file about how to launch the GraphScope instance. For str, it will identify it as a path and read the configuration file to build a session if file
(
self,
config: Union[Config, str] = None,
api_client: kube_client.ApiClient = None,
**kw,
)
| 273 | """ |
| 274 | |
| 275 | def __init__( |
| 276 | self, |
| 277 | config: Union[Config, str] = None, |
| 278 | api_client: kube_client.ApiClient = None, |
| 279 | **kw, |
| 280 | ): |
| 281 | """Construct a new GraphScope session. |
| 282 | |
| 283 | Args: |
| 284 | config (dict or str, optional): The configuration dict or file about how to launch the GraphScope instance. |
| 285 | For str, it will identify it as a path and read the configuration file to build a |
| 286 | session if file exist. If not specified, the global default configuration will be used |
| 287 | Note that it will overwrite explicit parameters. Defaults to None. |
| 288 | api_client: The kube api client used in kubernetes cluster |
| 289 | |
| 290 | kw: Configurable keys. For backward compatibility. For more details, see `Config` class in `config.py` |
| 291 | addr (str, optional): The endpoint of a pre-launched GraphScope instance with '<ip>:<port>' format. |
| 292 | A new session id will be generated for each session connection. |
| 293 | |
| 294 | mode (str, optional): optional values are eager and lazy. Defaults to eager. |
| 295 | Eager execution is a flexible platform for research and experimentation, it provides: |
| 296 | An intuitive interface: Quickly test on small data. |
| 297 | Easier debugging: Call ops directly to inspect running models and test changes. |
| 298 | Lazy execution means GraphScope does not process the data till it has to. |
| 299 | It just gathers all the information to a DAG that we feed into it, |
| 300 | and processes only when we execute :code:`sess.run(fetches)` |
| 301 | |
| 302 | cluster_type (str, optional): Deploy GraphScope instance on hosts or k8s cluster. Defaults to k8s. |
| 303 | Available options: "k8s" and "hosts". Note that only support deployed on localhost with hosts mode. |
| 304 | |
| 305 | num_workers (int, optional): The number of workers to launch GraphScope engine. Defaults to 2. |
| 306 | |
| 307 | preemptive (bool, optional): If True, GraphScope instance will treat resource params |
| 308 | (e.g. k8s_coordinator_cpu) as limits and provide the minimum available value as requests, |
| 309 | but this will make pod has a `Burstable` QOS, which can be preempted by other pods with high QOS. |
| 310 | Otherwise, it will set both requests and limits with the same value. |
| 311 | |
| 312 | k8s_namespace (str, optional): Contains the namespace to create all resource inside. |
| 313 | If param missing, it will try to read namespace from kubernetes context, or |
| 314 | a random namespace will be created and deleted if namespace not exist. |
| 315 | Defaults to None. |
| 316 | |
| 317 | k8s_service_type (str, optional): Type determines how the GraphScope service is exposed. |
| 318 | Valid options are NodePort, and LoadBalancer. Defaults to NodePort. |
| 319 | |
| 320 | k8s_image_registry (str, optional): The GraphScope image registry. |
| 321 | |
| 322 | k8s_image_repository (str, optional): The GraphScope image repository. |
| 323 | |
| 324 | k8s_image_tag (str, optional): The GraphScope image tag. |
| 325 | |
| 326 | k8s_image_pull_policy (str, optional): Kubernetes image pull policy. Defaults to "IfNotPresent". |
| 327 | |
| 328 | k8s_image_pull_secrets (List[str], optional): A list of secret name used to authorize pull image. |
| 329 | |
| 330 | k8s_vineyard_image (str, optional): The image of vineyard. |
| 331 | |
| 332 | k8s_vineyard_deployment (str, optional): The name of vineyard deployment to use. GraphScope will try to |
no test coverage detected