snowflake.ml.jobs.submit_directory

snowflake.ml.jobs.submit_directory(dir_path: str, compute_pool: str, *, entrypoint: str, stage_name: str, args: Optional[list[str]] = None, target_instances: int = 1, pip_requirements: Optional[list[str]] = None, external_access_integrations: Optional[list[str]] = None, session: Optional[Session] = None, **kwargs: Any) MLJob[None]

Submit a directory containing Python script(s) as a job to the compute pool.

Parameters:
  • dir_path – The path to the directory containing the job payload.

  • compute_pool – The compute pool to use for the job.

  • entrypoint – The relative path to the entry point script inside the source directory.

  • stage_name – The name of the stage where the job payload will be uploaded.

  • args – A list of arguments to pass to the job.

  • target_instances – The number of nodes in the job. If none specified, create a single node job.

  • pip_requirements – A list of pip requirements for the job.

  • external_access_integrations – A list of external access integrations.

  • session – The Snowpark session to use. If none specified, uses active session.

  • kwargs

    Additional keyword arguments. Supported arguments: database (str): The database to use for the job. schema (str): The schema to use for the job. min_instances (int): The minimum number of nodes required to start the job.

    If none specified, defaults to target_instances. If set, the job will not start until the minimum number of nodes is available.

    env_vars (dict): Environment variables to set in container. enable_metrics (bool): Whether to enable metrics publishing for the job. query_warehouse (str): The query warehouse to use. Defaults to session warehouse. spec_overrides (dict): A dictionary of overrides for the service spec.

Returns:

An object representing the submitted job.