Loading
docs(specs): specify Debian hosted (S36)
Summary
- Problem: Artifact Registry has no Debian format. Teams that ship
.debpackages must stay on the monolith's Debian registry, which is an experiment with known gaps, or on JFrog or Nexus. - Impact: Debian and Ubuntu engineers cannot publish or install packages through Artifact Registry. Platform engineers cannot bring Debian under the same access model and audit trail.
- Change: this adds spec S36 for Debian hosted repositories and its index row. It also adds the Debian rows to S08 (Basic auth), S09 (route permissions, the Debian denial renderer with its denial-table row and criterion, and the key routes on ADR-021's namespace permissions, each with its criterion) and S23 (usage events). S17 has no net growth, because it is over the doc-size limit: its read set,
settingscolumn,PATCHsentence and strict-body rules no longer exclude a Debian hostedsettingsobject, its create refusal names a non-hosteddebian, and three criteria change: the create refusal, theGETdetailsettingskey and thesettings400. S36 carries the Debian management routes, statistics, delete rule,settingsbranch and create refusal, as S37 does for Go. A package delete tombstones the package and each of its versions.dputand a single-filePUTpublish binary.debpackages. A background job rebuilds and signs each suite's indexes, andapt updateshows a new package within 60 seconds at the 99th percentile, when the package indexes a rebuild changes hold up to 50 MB in all. Every client read follows the namespace delivery mode, and S36 lists no ADR-005 metadata document, becauseaptnever checks a response's media type. TheValid-Untilre-sign is asign_onlybuild that reads no pending pair, so it keeps signing a suite the backoff waits on or has stopped, and a suite in a namespace that does not serve writes, where S33 holds the upload rebuild and the recovery job. A stopped suite leaves the unpublished-age gauge, and a stopped-suites gauge counts it. The management API accepts adebiancreate only once the OpenAPI management contract, the monolith and the Snowplow context support it. A Deferred table records key import, private-key export, a KMS or HSM backend, anonymous reads and an upload rate limit. S36 also defines the Debian signing-key resource from ADR-030: thedebian_signing_keystable, its routes under/debian/signing_keysand its cap. Namespace re-enable refuses while the namespace holds a Debian repository, because a selected key's row cannot be deleted. A suspended, limit-blocked, disabled or blocked namespace answers a Debian write with S33's reason code and message, and a disabled or blocked one answers a read403the same way. A rebuild takes one gate unit per blob session, one at a time, and rebuilds clamp to half the gate, as S38's do. A206moves no counter and emits no pull event. A single-file upload accepts any.debfile name, such as GoReleaser's. A commit that adds anallpackage gives its suitedebian.default_architectures. The.changescommit takes its blob rows first, locks the staged rows it matched again, and counts its caps after the locked identity read. A rebuild takesDatefrom the database clock and fails withkeys_changedwhen the repository's keys change under it. A download stamps every live version that holds the digest. Every control-file refusal answers422 invalid_package. An out-of-rangevalid_until_daysanswers400withbad_request. The periodic-job indexes end innamespace_id, id, purge indexes cover tombstoned packages and versions, the Index table lists the unique keys the prose relies on and a non-partial index for eachNO ACTIONforeign key, and only the Debian repository, suite and changed-pair rows cascade, the S04-A key reference takesRESTRICT, and every other foreign key takesNO ACTION. Theadmission_sourceset gainsdebian_uploadanddebian_rebuild, which !3798 (merged)'s Steps 37 and 52 add to the cardinality lists indocs/dev/storage.mdanddocs/dev/observability.md. Metrics and thedebian.*limits are in S36's Metrics and Configuration, and the two alerts are in its Failure, limits and recovery table. RPM gets its own table in its own spec. - Downsides: binary packages only: a source upload and a
.udebanswer422, and a.ddebis staged and discarded, so an upload needs a binary-only build (-b). Suites appear on first upload and cannot be deleted.aptneeds a token from the token exchange inauth.conf, and that token expires within 12 hours. No key import and no private-key export at GA. The setup snippet is fordput-ng: classicdputcannot authenticate an upload whose first file is over 256 KiB (review thread). With no process cache forInRelease, each ephemeral CI job costs one index-file read per suite. The index is served asPackages.gzonly: the Go xz encoder saved 5% of the bytes for about 13 times the CPU and 100 times the memory, measured on Debian 12'smainamd64 index. A rebuild whose changed pairs hold over 50 MB publishes later than 60 seconds, and never once it needs more thandebian.rebuild_timeout(10 minutes) (Open question 2). A deploy that kills an in-flight rebuild delays that suite's publish by up to 11 minutes 25 seconds after a first failure, and longer after repeated failures, which the 60-second target excludes. Two uploads of one name, version and architecture with different bytes answer409, even across suites, so a per-distribution build needs its own version. An xz or zstd.debtakes 2 gate units in one acquire before its session opens, one for the session and one for a compressed copy of the control member, then takesceil(charge / unit)more without waiting once the member has arrived, so it never holds a unit while it waits. The charge is the dictionary or window the control member declares, and a unit is1.2 × chunk_size + 1 MiB, 7 MiB at the default. A declared xz dictionary over 64 MiB or zstd window over 128 MiB answers422 invalid_packagebefore anything is allocated. It releases the decoder's units and the copy's when the decode ends, so a slow sender holds at most 2 units for up todebian.upload_read_timeout. When the decoder's units aren't free at that moment, the upload answers503at once, so a 128 MiB zstd upload sheds whenever 19 units aren't free. A200or409removes its staged files, and a staged file waits at mostdebian.staged_file_max_age(24 hours), so adputthat runs longer answers422 staged_file_mismatch. A multi-unit acquire queues every later acquire of every format behind it, for at moststorage.upload_session_wait_timeout(5 seconds by default). A request for more units than the whole gate answers413at once, as S38's oversized header does, books no shed, logs aWARNwith the namespace, repository, units asked and gate capacity, and no retry clears it. An xz control member is one stream with one block and at most 32 LZMA2 chunks at the default, and a zstd member is one frame with no skippable frame; anything else answers422 invalid_package. A.debwhose first twoarmembers are notdebian-binaryandcontrol.tar, or whose control member's compression header lies beyond the first 2 KiB of the body, answers422 invalid_package. No spec says how a namespace removes its Debian or RPM repositories before it re-enables, so Open question 3 records the gap for S04-A and S20-A, and the rollout gate does not wait for it.
Checklist
- Gaps: remote and virtual Debian repositories get their own specs. An unknown suite answers
404, soapt updatefails until the first upload to that suite. Audit events wait for S21. Anonymous reads wait for public visibility. None of these blocks the work item's hosted acceptance criteria. Passages in S01, S04-B, S09, S17, S20-A and S23 anddocs/dev/column-encryption.mdthat already lag RPM or Go now lag Debian too; #1930 carries them, with the S04-A namespace re-enable refusal. S33's list of passages that lack its reason codes does not name S36, and S38, S37 and S30 still answer a suspended writeforbidden; #1823 carries that. S36 follows S33's write-serving rule: the upload rebuild and the recovery job wait while a namespace does not serve writes, and the re-sign, which completes no client write, keeps signing. The staged-file sweep skips such a namespace, as S20-A's purger does. Two points differ from the work item's text: it says re-publishing an existing name, version and architecture is rejected, where S36 answers200for byte-identical bytes and409for different bytes or for anallbuild that meets another architecture's build of the same name and version; and it says "version-level deletes only", where S36 adds package delete and package bulk delete. - Least sure: a
settingsPATCHthat nullssigning_key_id, or sets it to the current secondary, and a repository create in a namespace with no key, answer422 invalid_signing_key. The error code is my choice, not a spec precedent. A create never generates a key, as in S38. The other doubt is the rotation's overlap step. It signsInReleasewith two keys, and ADR-030 Open question 1 asks whetheraptaccepts that when it trusts one key. The Debian archive signs with several keys, so I expect yes. If one supported release rejects it, Debian rotates as RPM does, as ADR-030 decides. The one-block and one-frame rule forcontrol.tarassumesdpkg-debwrites one block for a tiny control file, which is unconfirmed (xz --list -vvon a-z9package should readBlocks: 1). - Compatibility: nothing breaks. Debian is a new format. Monolith users move through a new repository URL and add its key.
- Agreement: ADR-030 (https://gitlab.com/gitlab-org/ops/artifact-registry/-/blob/main/docs/adr/030_repository_signing_keys.md) gives each format its own key table, and is amended there so key selection is a repository setting authorized on the namespace, as S36 and S38 have it. ADR-004, ADR-007, ADR-009 and ADR-021 hold rules only, so S36 states the Debian format value
6, tables, limits and routes itself, and no handbook amendment is pending (handbook!21653 is closed). AppSec accepted the opt-inValid-Untilon three conditions that the spec records: a scheduled re-sign, an expiry alert and user documentation. The monolith UI and the Snowplow context schema need adebianvalue before launch, and the UI's repository create must handleinvalid_signing_key: the S36 plan (!3798 (merged)) opens the monolith issue at Step 61 and gates creation on both at Step 76. !3863 (merged) (RPM key routes) merged first, and this branch's merge ofmainresolves its conflicts in S09's namespace binding row, per-endpoint permission sentence and namespace-scope criterion, and in S17's read set; S36 now matches S38's key create, key-generation bound, key-delete race, key-fieldPATCHdenial andsettingsfingerprints. The release that adds format6to the repository read path ships before the release that accepts adebiancreate. - Simplicity: I rejected operator-managed distributions, a synchronous rebuild and source uploads. Suites created on upload need no settings form, Debian keys sit in their own table as ADR-030 sets, and an async rebuild keeps uploads fast.
Depends on !3768 (merged) (ADR-030), merged.
Related to gitlab-org/gitlab#605698
Edited by Radamanthus Batnag