A tool for fetching and comparing artifacts from Artifactory builds across different platforms.
This project provides utilities to download latest_commits.txt files from Artifactory build folders for specified builds and platforms, enabling comparison and analysis of artifacts across different environments.
- Download
latest_commits.txtfrom multiple builds and platforms - Support for authentication via Bearer token or Basic auth
- Automatic retry mechanism with exponential backoff
- Metadata tracking with timestamps and source URLs
- Error handling and reporting
- Python 3.x
requestslibrary
Install dependencies:
pip install requestsSet your Artifactory token as an environment variable:
Windows (PowerShell):
$env:ARTIFACTORY_TOKEN = "your-token-here"Linux/macOS:
export ARTIFACTORY_TOKEN="your-token-here"If you can't use a token, you can provide username and password directly via command line arguments (less secure).
python3 scripts/fetch_latest_commits.py \
--base-url "https://xcoartifactory.xilinx.com/native/vai-rt-ipu-prod-local/com/amd/onnx-rt/stx/cp_dev" \
--builds 3025 3026 \
--platforms windows linux arm \
--out data| Argument | Required | Description | Example |
|---|---|---|---|
--base-url |
Yes | Base Artifactory URL | https://xcoartifactory.xilinx.com/... |
--builds |
Yes | Space-separated list of build IDs | 3025 3026 3027 |
--platforms |
Yes | Space-separated list of platforms | windows linux arm |
--out |
No | Output directory (default: data/builds) |
data or artifact-compare/data |
--user |
No | Username for Basic auth | myusername |
--password |
No | Password for Basic auth | mypassword |
--retries |
No | Number of retry attempts (default: 3) | 5 |
python3 scripts/fetch_latest_commits.py \
--base-url "https://xcoartifactory.xilinx.com/native/vai-rt-ipu-prod-local/com/amd/onnx-rt/stx/cp_dev" \
--builds 3025 3026 3027 \
--platforms windows linux arm \
--out artifact-compare/datapython3 scripts/fetch_latest_commits.py \
--base-url "https://xcoartifactory.xilinx.com/native/vai-rt-ipu-prod-local/com/amd/onnx-rt/stx/cp_dev" \
--builds 3025 3026 \
--platforms windows linux \
--user myuser \
--password "mypassword" \
--out data/buildspython3 scripts/fetch_latest_commits.py \
--base-url "https://xcoartifactory.xilinx.com/native/vai-rt-ipu-prod-local/com/amd/onnx-rt/stx/cp_dev" \
--builds 3025 \
--platforms windows linux arm \
--out dataThe script creates the following directory structure:
data/
├── 3025/
│ ├── windows/
│ │ ├── latest_commits.txt
│ │ └── meta.json
│ ├── linux/
│ │ ├── latest_commits.txt
│ │ └── meta.json
│ └── arm/
│ ├── latest_commits.txt
│ └── meta.json
├── 3026/
│ ├── windows/
│ │ ├── latest_commits.txt
│ │ └── meta.json
│ └── ...
└── fetch_errors.json (if any errors occurred)
Each successful download creates a meta.json file containing:
- Build ID
- Platform name
- Fetch timestamp (IST timezone)
- Source URL
Example meta.json:
{
"build": "3025",
"platform": "windows",
"fetched_at": "2025-09-26T14:30:45+05:30",
"source_url": "https://xcoartifactory.xilinx.com/.../3025/windows/latest_commits.txt"
}- Authentication Errors (401/403): Script exits immediately with clear error message
- Network/Server Errors: Automatic retry with exponential backoff
- Partial Failures: Continues processing other builds/platforms, saves errors to
fetch_errors.json
0: Success - all files downloaded successfully2: Partial or complete failure - checkfetch_errors.jsonfor details
artifact-compare/
├── README.md
├── scripts/
│ └── fetch_latest_commits.py
├── config/
└── data/ (created by script)
-
Missing requests library
pip install requests
-
Authentication failures
- Verify your
ARTIFACTORY_TOKENis set correctly - Check token permissions for the specified repository
- Ensure the base URL is accessible
- Verify your
-
Network timeouts
- Increase retry attempts:
--retries 5 - Check network connectivity to Artifactory server
- Increase retry attempts:
-
File not found (404 errors)
- Verify build IDs exist in the repository
- Check platform names are correct
- Ensure the base URL path is accurate
- The script provides verbose output showing each fetch attempt
- Check
fetch_errors.jsonfor detailed error information - Verify URLs manually in a browser when troubleshooting
[Add your license information here]
[Add contribution guidelines here]