EP-FXT Science Data Center / Users Guide v2.0 · 2026-11-04

FXTSoft v2.0 documentation

fxtcaldb-update help

Command help for fxtcaldb-update in the FXTSoft v2.0 release.

← Back to Command Reference

Synchronize, inspect, and verify the public EP/FXT CALDB through anonymous HTTPS, without an IHEP account, access token, or interactive login.

Usage

fxtcaldb-update [install_root=DIR] [state_dir=DIR]
                 [validate=yes] [dry_run=no] [allow_downgrade=no]
                 [verbose=0|1|2]
fxtcaldb-update status [state_dir=DIR]
  fxtcaldb-update check [source=HTTPS_BASE_URL] [ref=latest]
                     [install_root=DIR] [state_dir=DIR]
                     [allow_downgrade=yes|no]
fxtcaldb-update install [source=HTTPS_BASE_URL] [ref=latest] [install_root=DIR]
                         [state_dir=DIR] [validate=yes] [dry_run=no]
                         [allow_downgrade=yes|no] [verbose=0|1|2]
fxtcaldb-update verify [install_root=DIR] [state_dir=DIR]
fxtcaldb-update rollback [install_root=DIR] [state_dir=DIR]

Running fxtcaldb-update with no command performs an install or update. It does nothing to the installed tree when the public revision has not changed.

The verbose parameter controls diagnostics on standard error: verbose=0 keeps only warnings and errors, verbose=1 reports concise operations and results, and verbose=2 adds diagnostic paths. Machine-readable key=value results remain on standard output.

Release and transaction model

The default source is https://epfxt.ihep.ac.cn/downloads/caldb. It does not require Git or Git LFS. latest selects the immutable release named by current/RELEASE; an explicit stable release ID in the form caldb-vX.Y-YYYYMMDD[-rN] may also be supplied.

The first installation downloads the complete CALDB payload. Later runs compare SHA-256 checksums and download only files that are new, changed, missing, or locally damaged. Before creating a candidate, the updater checks that the target filesystem has enough free space for the published payload plus a safety margin. The updater materializes the complete candidate in private staging, verifies VERSION, SHA256SUMS, and FITS structure (including complete data blocks for plain and gzip-compressed files), then atomically replaces the target. Repository-only files such as .git, .gitattributes, and README.md are not installed. The previous CALDB is retained below state_dir/backups. A failed exchange, validation, or state write automatically restores the previous target when that rollback can be completed safely.

rollback restores the previous registered CALDB retained in state_dir/backups. Before exchanging directories, it validates the backup state and the complete backup payload, including file checksums and FITS structure. Installation into a previously absent target has no rollback target. The current release is retained as the new backup after a successful rollback. If a directory exchange or state write fails, the updater restores the original installation, backup, and state when recovery can complete; otherwise it retains the recovery files and reports the failure.

First takeover of an existing complete CALDB archive validates the original archive and registers its backup even when no updater state exists. Rollback restores the original SHA256SUMS and all listed archive files, including archive-only provenance files omitted from the HTTP runtime profile. The archive snapshot uses versioned metadata with origin=archive; its unknown commit and original installation time remain empty in command output. Its verified local version and manifest remain recorded, and normal release ordering and downgrade checks still apply after restoration. Repeated install of an unchanged HTTP release preserves the registered backup.

Use this updater version to read archive-snapshot state after rollback; older clients do not understand that state format. Previously unregistered backup directories are not automatically adopted or assigned a guessed commit. This command does not infer an old archive's identity from the new HTTP release or from the backup directory name.

Before any payload download, check, dry-run planning, and install compare the requested dated release and numeric -rN revision with the installed state and the target VERSION. A release older than the installed or paired FXTSoft floor is rejected, including when the state file is absent. If both state and an explicit two-line VERSION carry a revision, they must agree. An intentional downgrade requires a fixed ref, an explicit install_root, and allow_downgrade=yes on check or install; latest/current cannot bypass the floor. The explicit rollback command remains the supported recovery path.

status and verify do not access the network. check reads remote release metadata only. Use dry_run=yes to resolve and plan an installation without downloading the payload or changing the target.

An existing CALDB installed from an archive does not need private updater state for version detection. status, check, and dry-run output use its local VERSION and optional Subversion as installed_version. When that exact release matches the remote release, update_available=false; a date without a revision does not establish equality with a numbered release. installed_commit remains empty when no local state records it. A version match is not a file integrity check: use verify for local validation; an actual install still validates and repairs changed or missing payload files.

An install reports downloaded_files, downloaded_bytes, reused_files, and reused_bytes. These values are zero for a dry run or when the installed release is already current.

Target preflight

For install and install dry_run=yes, the target is checked before any CALDB payload is downloaded. An existing target must be an actual CALDB directory with the required VERSION, caldb.config, data/ep/fxt/caldb.indx, software/tools/alias_config.fits, and SHA256SUMS markers on the target filesystem. An empty or otherwise unrecognized target is rejected before the transfer starts. This preflight checks layout and identity; complete checksums and FITS validation still occur later. The same preflight applies to a dry run, so an invalid target does not produce a successful-looking plan. The metadata-only check command does not install or validate a target.

Network, proxy, and retry behavior

HTTPS requests use the standard HTTPS proxy settings. Set HTTPS_PROXY (or https_proxy) when the release site is reachable only through a proxy; use NO_PROXY (or no_proxy) to bypass the proxy for selected hosts. Leave these variables unset for a direct connection.

The default minimum interval between request starts is 1.25 seconds. A configured slower interval is preserved. For the known release endpoint https://epfxt.ihep.ac.cn/downloads/ (HTTPS on port 443, whether omitted or explicit, with paths under /downloads/), HTTP 404 is treated as a possible rate-limit response. It retries within the existing maximum attempt count with backoff; after such a response, this updater's subsequent requests use an adaptive interval starting at 2.5 seconds, doubling up to 10 seconds, without lowering an explicitly slower configured interval. HTTP 404 from other origins remains a permanent missing-resource error.

Other transient failures, including HTTP 408, 429, 500, 502, 503, and 504, are retried with exponential backoff and jitter. A server Retry-After value is honored for at most 60 seconds. A final 404 from this endpoint reports the actual sanitized URL and status; the client cannot distinguish a missing resource from server throttling there. Multiple updater processes or hosts using the same egress IP may share the server's rate limit, so avoid running updates concurrently; the client does not provide cross-process or cross-host global coordination. Failure diagnostics retain the sanitized request URL and HTTP status, plus TLS or DNS causes; credentials and proxy authorization values are redacted. Local insufficient-space and other filesystem causes remain separate from payload validation errors.

Verification profiles

fxtcaldb-update verify is offline and automatically recognizes one of the two supported CALDB layouts; no profile command-line parameter is added. A target whose SHA256SUMS lists RELEASE.json uses the formal complete-archive profile. A target without that manifest entry uses the strict HTTP-runtime profile.

In the formal archive profile, VERSION must contain exactly CALDB_v2.0 YYYY-MM-DD, optionally followed by Subversion YYYYMMDD-rN on a second line, with matching dates. RELEASE.json must be valid UTF-8 JSON with unique keys and matching schema, package_name, caldb_version, release_date, and release_id fields that match the VERSION date and revision; the exact values are schema=fxt-caldb-release-v1, package_name=CALDB_v2.0, and caldb_version=2.0, with a caldb-v2.0-YYYYMMDD[-rN] release ID. If its subversion field is present, it must match VERSION; an optional SOURCE_VERSION must carry the canonical release ID matching RELEASE.json.release_id. Archive provenance is an explicit allowlist containing only C8B1026_VARIANT.json, C8_PROVENANCE.json, README.html, RELEASE.json, SOURCE_VERSION, software/tools/provenance/m87_a1795_joint_gradefraction_20261102.json, software/tools/provenance/vignetting_v20_fit_parameters_20260907.csv, software/tools/provenance/vignetting_v20_release_20260907.json, and software/tools/provenance/vignetting_v20_validation_20260907.json. Arbitrary JSON, CSV, or other unlisted metadata is rejected.

HTTP runtime releases remain strict: VERSION is the single-line CALDB_v2.0 YYYY-MM-DD record, the required runtime files must be present, and calibration payload paths must stay within the runtime surface. Archive provenance files are not accepted by the HTTP check or install path. In both profiles, SHA256SUMS must cover every payload file, listed bytes are checked before use, FITS files retain their structure and complete-data-block checks, and symlinks, hard links, reparse points, and other non-regular payload entries are rejected.

PARAMETER SUMMARY

This table is synchronized with the installed HEASoft parameter file. Mode letters follow the standard PFILES convention.

ParameterTypeModeDefault / rangePurpose
commandsqinstallCALDB updater command: install, status, check, verify, or rollback
sourceshhttps://epfxt.ihep.ac.cn/downloads/caldbAnonymous HTTPS base URL containing CALDB releases
refshlatestlatest/current or stable CALDB release ID caldb-vX.Y-YYYYMMDD[-rN]
install_rootshoptional / environment-derivedTarget CALDB_v2.0 installation root
state_dirshderivedPrivate updater state, staging, and backup directory
validatebhyesValidate checksums and FITS files before installation
dry_runbhnoResolve and plan the installation without changing files
allow_downgradebhnoAllow an explicitly pinned older release with an explicit install root
verboseih1; range 0 .. 2Logging verbosity
modeshqlQuery/learn mode

Environment

If install_root is omitted, the target is taken from FXTSOFTV2_CALDB and then CALDB. When state_dir is omitted, it is placed beside the target as .<target-name>.fxtcaldb-update. The state directory must be private to the current user and on the same filesystem as the target.