Skip to content

fix(docs): use the step argument in the local execution log examples - #4356

Open
fjvbn2003 wants to merge 1 commit into
kubeflow:masterfrom
fjvbn2003:docs/local-execution-get-job-logs-step
Open

fjvbn2003 wants to merge 1 commit into
kubeflow:masterfrom
fjvbn2003:docs/local-execution-get-job-logs-step

Conversation

@fjvbn2003

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

The "Viewing Logs" example in docs/user-guides/local-execution/overview.md calls client.get_job_logs(job_name, node_index=0, follow=True). TrainerClient.get_job_logs() has no node_index parameter; its signature is (name, step="node-0", follow=False). With kubeflow==0.5.0 (the latest release on PyPI) the example fails:

TypeError: TrainerClient.get_job_logs() got an unexpected keyword argument 'node_index'

This PR drops node_index=0 from the first call (the default step is node-0) and uses step=f"node-{node_index}" in the per-node loop, as docs/user-guides/pytorch.md already does.

Local checks (Docker, python:3.12-slim, master a5ea455):

  • python -m sphinx -W --keep-going -b html . _build/html in docs/ with docs/requirements.txt: build succeeded., no warnings.
  • With kubeflow==0.5.0 installed, binding the documented arguments to inspect.signature(TrainerClient.get_job_logs): the old node_index=0, follow=True and node_index=1 calls raise TypeError: got an unexpected keyword argument 'node_index'; the new follow=True and step="node-1" calls bind. No TrainJob was run with the local backends for this change.

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
None. No existing issue or pull request for this was found.

Checklist:

  • Docs included if any changes are user facing

Prepared with help from Claude (AI), including the local checks described above.

The "Viewing Logs" example in the local execution overview passes
node_index= to TrainerClient.get_job_logs(). That method has no
node_index parameter; its signature is (name, step="node-0",
follow=False), so copying the example raises:

  TypeError: TrainerClient.get_job_logs() got an unexpected keyword
  argument 'node_index'

Drop node_index=0 from the first call, since node-0 is the default
step, and pass step=f"node-{node_index}" in the per-node loop, as
docs/user-guides/pytorch.md already does.

Assisted-by: Claude <[email protected]>
Signed-off-by: YoungjuKim <[email protected]>
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jeffwan for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant