[Jobs] Add sync_job_volume helper and local paths in hf jobs -v (#4346)
* [Jobs] Add sync_job_volume helper and local paths in hf jobs -v
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* [Jobs] Warn when jobs-artifacts bucket already exists and is public
sync_job_volume creates the jobs-artifacts bucket as private, but cannot
change the visibility of a pre-existing bucket. Verify the bucket is private
and warn the user otherwise, instead of silently uploading data to a public
bucket while the docs claim it is always private.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [Jobs] Test the public-bucket warning in sync_job_volume
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [Buckets] Preserve endpoint when rebuilding HfApi with explicit token in sync_bucket
sync_bucket_internal rebuilt the HfApi as HfApi(token=token) when an explicit
token was passed, silently dropping the caller's custom endpoint (and headers,
user_agent, library identity). An HfApi pointing at a non-default endpoint would
then sync files against the default Hub while the bucket was created elsewhere.
Carry the caller's config over to the rebuilt instance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [Buckets] Do not auto-create destination bucket in sync_bucket
Auto-creating the destination bucket was out of scope for the default
`hf buckets sync` / `sync_bucket` path. Uploading to a missing bucket now
fails; users must create it first with `create_bucket`. `sync_job_volume`
is unaffected since it creates the jobs-artifacts bucket explicitly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* useless
* better
* no ''
* remove comment
* beter
* no need
* no print
* useless
* review tests
* rename to _parse_and_sync_job_volumes
* style
* no need
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>