Skip to content

Operations, Cleanup & arkactl CLI Reference ​

arkactl shares Arka's generated Go SDK (pkg/client) and covers 100% of non-browser /api/v1/* management operations. Use an administrator profile for platform operations and scoped arkat_* tokens for CI/CD.


1. arkactl Authentication & Command Cheatsheet ​

bash
# Authenticate and save to ~/.config/arka/config.json under profile "prod"
arkactl --url https://registry.example.com --profile prod login \
  --username admin --password "$ARKA_ADMIN_PASSWORD"

arkactl --profile prod auth whoami --json
arkactl --profile prod ready --json

Precedence order: --url / --token flags → ARKA_URL / ARKA_TOKEN environment variables → selected profile in ~/.config/arka/config.json → http://localhost:8080. Always pass --json in CI scripts and check the exit code. Generate shell completions with arkactl completion bash|zsh|fish|powershell.

AreaCommands
Health, Identity & Versionhealth, ready, auth whoami, auth logout, auth change-password, version, overview, observability
Formats & Repositoriesformats list, repo list, repo get <id>, repo create, repo update <id>, repo delete <id>, repo snippets <id>, repo promote <id>
Assets, Properties & Search`asset list
Builds & Promotion`builds list
Users, Teams & Workload OIDCusers, teams, grants, tokens create --scope read --expires-in-days 30, tokens revoke <id>, auth workload-providers, auth exchange-oidc, ldap, oidc
Supply Chain & Licensessecurity scanner status, `security policy get
Governance, Audits & Webhooks`outbound-proxy get
Storage Pools & Jobspools list, pools usage <id>, pools test <id>, `pools create
Retention, GC & Migration`retention get

Call any operation from the embedded OpenAPI 3.1 catalog directly:

bash
arkactl api list --json
arkactl api call getStoragePoolUsage --param "id=$POOL_ID" --json

Artifactory and Harbor imports ​

Use arkactl migration sources add --driver artifactory or --driver harbor with a source name and base URL. Use --username and --password for Basic authentication, including Harbor robot accounts, or --bearer-token for a bearer credential. For an Artifactory API key, supply the key as --password with no username. Authenticated requests require HTTPS outside loopback. Harbor's OCI token realm must use the source URL's origin.

Run migration preflight and migration discover to check source access and inventory. Artifactory supports migration provision --mode preserve_topology for LOCAL, REMOTE and VIRTUAL repositories. Harbor provisions one Hosted OCI repository per project and keeps the registry's nested image names. Private Harbor projects and Artifactory repositories discovered with credentials require private targets. Provisioning rejects --anonymous-read when creating a target for either of these sources. Public Harbor projects can use that flag to enable anonymous access.

Start a full import with arkactl migration start --source-id ID --source-repo NAME --target-repo-id ID, then run migration verify to check parity. Record a UTC timestamp before starting each successful pass and supply it to the next import with --since RFC3339_TIMESTAMP. Artifactory uses file modification time. Harbor uses artifact and tag push time and includes the dependencies of changed manifests. Timestamp ties and inventory entries without a timestamp are included. A partial import with checksum failures is marked failed. Use migration resume JOB_ID to retry with the same watermark and skip assets that already match. Imports copy source content and updates. Review removed source files or tags with parity verification.

2. Storage Pool Usage & Quotas ​

Inspect deduplicated physical usage, reclaimable bytes, and per-repository logical usage:

bash
arkactl pools list --json
arkactl pools usage "$POOL_ID" --json
arkactl repo get "$REPO_ID" --json

Repository quotas (quotaBytes, quotaWarnPercent) count logical bytes per repository; uploading past a hard quota fails atomically with HTTP 507 quota_exceeded. Unreferenced physical bytes are freed by generation-isolated Blob GC. Each pool returned by arkactl pools list --json also reports its capabilities (uploadStaging, generationCleanup, presignedDownload) so operators can verify resumable upload staging, orphan sweep, and redirect support per backend.


3. Retention Policies, Hosted Directory Deletion & Blob GC ​

Always dry-run retention and GC first and archive the preview output:

bash
# Configure and dry-run retention
arkactl retention set "$REPO_ID" --enabled --keep-last-versions 5 --max-age-days 30 \
  --path-prefix org/example/ --exclude-regex 'keep/' --json
arkactl retention run "$REPO_ID" --dry-run --json

# Execute retention once the preview matches expectations
arkactl retention run "$REPO_ID" --dry-run=false --json

# Preview and run Blob GC (note: job kind is a positional argument)
arkactl gc run --dry-run --json
arkactl jobs enqueue blob_gc --dry-run --json
  • Maven: keepLastVersions groups timestamped SNAPSHOT builds (maven_snapshot_build) and regenerates maven-metadata.xml on Hosted repos.
  • OCI: keepLastVersions counts distinct tagged manifest digests (oci_manifest_digest) and protects all layers still reachable by retained manifests/indexes.
  • Hosted Directory Deletion (24 of 26 formats; excludes OCI & Git LFS):
    bash
    prefix="old-builds/widgets"
    arkactl repo delete-directory "$REPO_ID" "$prefix" --dry-run --json
    arkactl repo delete-directory "$REPO_ID" "$prefix" --confirm "$prefix" --json

Default background schedules: ARKA_RETENTION_SCHEDULE_INTERVAL=1h, ARKA_GC_SCHEDULE_INTERVAL=6h. Blob GC protects active uploads with PostgreSQL write-intent leases, sweeps unreferenced blob generations with per-object retry backoff, and checks credential-free backend_identity before reclaiming objects across pools that might share a physical bucket, container, or filesystem mount.

Arka v1.0.0 storage reliability pipeline: upload and out-of-lock staging under write-intent leases, atomic PostgreSQL commit with blob generation key and webhook outbox, and generation-isolated orphan GC with backend identity checks.Arka v1.0.0 storage reliability pipeline: upload and out-of-lock staging under write-intent leases, atomic PostgreSQL commit with blob generation key and webhook outbox, and generation-isolated orphan GC with backend identity checks.

4. Prometheus Metrics & Health Probes ​

  • Arka Server: Liveness GET /api/v1/health/live (and GET /api/v1/health), Readiness GET /api/v1/ready, Prometheus GET /metrics (dedicated port :9090 in Helm/Kustomize prod, or :8080 with ARKA_METRICS_AUTH_TOKEN; set ARKA_METRICS_REQUIRE_AUTH=true to fail closed if the token is missing). Grafana dashboard: deploy/grafana/arka-dashboard.json.
  • Arka Scanner: Liveness GET :8091/healthz, Readiness GET :8091/readyz, Prometheus GET :8091/metrics (always HTTP 200, even when /readyz returns 503).
  • Ephemeral /tmp & Webhook Outbox: Keep at least 2 GiB of writable /tmp ephemeral storage for out-of-lock upload staging. Webhook deliveries are recorded atomically in PostgreSQL's transactional outbox (event_id + per-attempt ID) and drained during bounded phased shutdown.
SignalPrometheus Metrics
HTTP Traffic & Latencyarka_http_requests_total, arka_http_request_duration_seconds
Proxy Cache & Upstreamarka_proxy_cache_requests_total, arka_proxy_upstream_duration_seconds
Offload & Blob Storagearka_presign_redirects_total, arka_http_range_requests_total, arka_http_not_modified_total, arka_blobstore_operations_total, arka_blobstore_operation_duration_seconds
License Compliance Gatearka_license_policy_evaluations_total{mode,outcome}
Jobs, GC & Storage Sizearka_async_job_queue_depth, arka_async_job_attempt_duration_seconds, arka_gc_deleted_blobs_total, arka_gc_reclaimed_bytes_total, arka_storage_total_bytes, arka_repository_bytes, arka_repository_assets
Scanner DB Freshnessarka_scanner_db_ready, arka_scanner_db_built_at_timestamp_seconds, arka_scanner_db_age_seconds, arka_scanner_db_max_age_seconds, arka_scanner_db_status{state}

5. Backup & Disaster Recovery ​

PostgreSQL is the consistency anchor; blobs are immutable and content-addressed by SHA-256.

  1. Back up secrets separately: Store ARKA_CREDENTIAL_KEY, ARKA_CREDENTIAL_KEY_ID, ARKA_CREDENTIAL_PREVIOUS_KEYS, and ARKA_AUTH_SIGNING_KEY outside the database dump.
  2. Protect blobs before dumping PostgreSQL: Enable bucket versioning/snapshots or pause Blob GC during cold backup windows so referenced blobs are never deleted ahead of the DB snapshot.
  3. Restore into an isolated PostgreSQL 16 instance:
    bash
    pg_restore --clean --if-exists --no-owner --dbname="$ARKA_DATABASE_URL" arka-backup.dump
    arka migrate
  4. Verify before reopening traffic: Check /api/v1/ready, spot-check artifact SHA-256 downloads, run arkactl gc run --dry-run --json, and rehearse locally with ./scripts/backup-drill.sh. Full DR and secret rotation runbook: Production Operations Handbook.

6. Reproducible Verification Suites ​

Run against isolated environments from a repository checkout:

bash
# 26-format native package manager matrix (four-state JSON report: passed/failed/skipped/missing_tool)
./scripts/cli-matrix-all.sh --wave all --report-dir "$(mktemp -d)"

# Real-world npm/pnpm/Yarn, Go + sumdb, PyPI, and Maven workloads
./scripts/verify-real-projects.sh --ecosystems npm,go,pypi,maven --output "$(mktemp -d)"

# Live Sonatype Nexus OSS 3.76.1 migration & cutover suite
ARKA_NEXUS_LIVE_EVIDENCE="$(mktemp -d)" ./scripts/verify-nexus3-live-migration.sh

# Live PostgreSQL 16 + Azurite / RustFS storage & heavy-load benchmarks
make test-e2e && make test-s3
./scripts/bench.sh --scenario mixed-upload
./scripts/bench.sh --scenario hot-index

Released under the Apache 2.0 License.