@@ -3,12 +3,18 @@ Run Code from Git Repo
33
44The :py:class: `~ads.jobs.GitPythonRuntime ` allows you to run source code from a Git repository as a job.
55
6+ .. include :: ../jobs/toc_local.rst
7+
8+ PyTorch Example
9+ ===============
10+
611The following example shows how to run a
712`PyTorch Neural Network Example to train third order polynomial predicting y=sin(x)
813<https://github.com/pytorch/tutorials/blob/master/beginner_source/examples_nn/polynomial_nn.py> `_.
914
1015.. include :: ../jobs/tabs/git_runtime.rst
1116
17+
1218Git Repository
1319==============
1420
@@ -38,7 +44,7 @@ Entrypoint
3844The entrypoint specifies how the source code is invoked.
3945The :py:meth: `~ads.jobs.GitPythonRuntime.with_entrypoint ` supports the following arguments:
4046
41- * ``path ``: Required. The relative path for the script, module, or file to start the job .
47+ * ``path ``: Required. The relative path of the script/ module from the root of the Git repository .
4248* ``func ``: Optional. The function in the script specified by ``path `` to call.
4349 If you don't specify it, then the script specified by ``path `` is run as a Python script in a subprocess.
4450
@@ -60,6 +66,18 @@ The arguments can be strings, ``list`` of strings or ``dict`` containing only st
6066Arguments are not used when the entrypoint is a notebook.
6167
6268
69+ Working Directory
70+ =================
71+
72+ By default, the working directory is the root of the git repository.
73+ This can be configured by can be configured by :py:meth: `~ads.jobs.GitPythonRuntime.with_working_dir `
74+ using a relative path from the root of the Git repository.
75+
76+ Note that the entrypoint should always specified as a relative path from the root of the Git repository,
77+ regardless of the working directory.
78+ The python paths and output directory should be specified relative to the working directory.
79+
80+
6381Python Paths
6482============
6583
@@ -68,17 +86,19 @@ The working directory is added to the Python paths automatically.
6886You can call :py:meth: `~ads.jobs.GitPythonRuntime.with_python_path ` to add additional python paths as needed.
6987The paths should be relative paths from the working directory.
7088
89+
7190Outputs
7291=======
7392
74- The :py:meth: `~ads.jobs.GitPythonRuntime.with_output ` method allows you to specify the output path ``output_path ``
93+ The :py:meth: `~ads.jobs.GitPythonRuntime.with_output ` method allows you to specify the output path ``output_dir ``
7594in the job run and a remote URI (``output_uri ``).
76- Files in the ``output_path `` are copied to the remote output URI after the job run finishes successfully.
77- Note that the ``output_path `` should be a path relative to the working directory.
95+ Files in the ``output_dir `` are copied to the remote output URI after the job run finishes successfully.
96+ Note that the ``output_dir `` should be a path relative to the working directory.
7897
7998OCI object storage location can be specified in the format of ``oci://bucket_name@namespace/path/to/dir ``.
8099Please make sure you configure the I AM policy to allow the job run dynamic group to use object storage.
81100
101+
82102Metadata
83103========
84104The :py:class: `~ads.jobs.GitPythonRuntime ` updates metadata as free-form tags of the job run
@@ -93,6 +113,6 @@ after the job run finishes. The following tags are added automatically:
93113The new values overwrite any existing tags.
94114If you want to skip the metadata update, set ``skip_metadata_update `` to ``True `` when initializing the runtime:
95115
96- .. code-block :: python3
116+ .. code-block :: python
97117
98118 runtime = GitPythonRuntime(skip_metadata_update = True )
0 commit comments