Publish-redirect#
Description#
The publish-redirect command creates redirect packages in a redirect repository for all packages found in one or more source repositories. Redirect packages contain only .wrapp files (no data files) with source_path entries pointing to the original source locations. This enables CloudFront/CDN URL redirection while preserving data access to the original storage locations.
Basic usage:
wrapp publish-redirect --source-repo omniverse://dev.nvidia.com --redirect-repo omniverse://cdn.nvidia.com
For CLI options, run wrapp publish-redirect --help.
External URL#
When hosting packages on a CDN, use the --external-url option to specify the external base URL. This rewrites source_path entries to use the CDN URL:
wrapp publish-redirect --source-repo omniverse://dev.nvidia.com --redirect-repo omniverse://cdn.nvidia.com --external-url https://cdn.example.com
Multiple Source Repositories#
You can consolidate packages from multiple source repositories into a single redirect repository by specifying --source-repo multiple times:
wrapp publish-redirect --source-repo omniverse://dev.nvidia.com --source-repo omniverse://staging.nvidia.com --redirect-repo omniverse://cdn.nvidia.com
The command verifies there are no conflicting package versions (same name/version with different content) across source repositories before creating the redirects. Identical duplicates are handled automatically.
Python API Reference#
- async wrapp.publish_redirect(
- source_repos: str | List[str],
- redirect_repo: str,
- external_url: str | None = None,
- *,
- context: CommandParameters | None = None,
- scheduler: SchedulerContext | None = None,
Create redirect packages in the redirect repository for all packages in the source repositories.
Redirect packages contain only .wrapp files (no data files) with source_path entries pointing to the original source locations (or external URLs if specified). This enables CloudFront/CDN URL redirection while preserving data access to the original storage locations.
Multiple source repositories can be specified to consolidate packages from different sources into a single redirect repository.
- Parameters:
source_repos – URL(s) of the source repository/repositories containing packages to create redirects for. Can be a single URL string or a list of URL strings.
redirect_repo – URL of the redirect repository where redirect packages will be created
external_url – External base URL for source_path entries (e.g., https://cdn.example.com). If specified, source_path URLs will use this base instead of the source repo URL.
context – Global configuration parameters
scheduler – Optionally pre-constructed SchedulerContext
- Returns:
List of URLs of created redirect wrapp files
- Raises:
FailedCommand – When prerequisites not matched
StorageOperationError – Raised when network or file operations fail