@rt-tools/agent-kit 0.24.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agents/business-analyst.md +51 -50
- package/assets/agents/cargo-writer.md +54 -0
- package/assets/agents/conscience.md +37 -35
- package/assets/agents/project-manager.md +49 -48
- package/assets/agents/prose-editor.md +31 -29
- package/assets/agents/qa-engineer.md +50 -48
- package/assets/agents/rules-reviewer.md +63 -58
- package/assets/agents/skill-curator.md +83 -78
- package/assets/agents/spec-critic.md +34 -29
- package/assets/agents/spec-writer.md +35 -32
- package/assets/agents/strict-teacher.md +39 -37
- package/assets/checks/archive-age.mjs +48 -28
- package/assets/checks/archive-prune.mjs +16 -14
- package/assets/checks/board-epic-link.github.mjs +29 -0
- package/assets/checks/board-epics.github.mjs +286 -49
- package/assets/checks/board-folders.mjs +61 -0
- package/assets/checks/board-gh.github.mjs +35 -26
- package/assets/checks/board-long-work.github.mjs +29 -25
- package/assets/checks/board-paths.github.mjs +21 -16
- package/assets/checks/board-pull-state.github.mjs +168 -0
- package/assets/checks/board-runs.github.mjs +45 -43
- package/assets/checks/board-task-dirs.github.mjs +98 -0
- package/assets/checks/board-titles.github.mjs +19 -17
- package/assets/checks/board.github.mjs +133 -194
- package/assets/checks/check-archive-age.mjs +23 -19
- package/assets/checks/check-board.github.mjs +131 -263
- package/assets/checks/check-descriptions.mjs +30 -29
- package/assets/checks/check-doc-paths.mjs +91 -88
- package/assets/checks/check-dupes.mjs +84 -80
- package/assets/checks/check-file-size.mjs +74 -71
- package/assets/checks/check-glossary.mjs +47 -37
- package/assets/checks/check-hook-scope.mjs +30 -27
- package/assets/checks/check-lib-layers.mjs +22 -21
- package/assets/checks/check-profile-drift.mjs +48 -43
- package/assets/checks/check-prose-style.mjs +138 -39
- package/assets/checks/check-push-gate.mjs +53 -50
- package/assets/checks/check-reuse.mjs +50 -40
- package/assets/checks/check-schema-drift.mjs +104 -84
- package/assets/checks/check-specs.mjs +155 -134
- package/assets/checks/check-state-next.mjs +66 -52
- package/assets/checks/check-states.mjs +32 -30
- package/assets/checks/check-styles.mjs +52 -51
- package/assets/checks/check-turn-map.mjs +54 -46
- package/assets/checks/epic-table.github.mjs +268 -0
- package/assets/checks/lib-boundaries.mjs +32 -30
- package/assets/checks/lib-common.mjs +30 -29
- package/assets/checks/lib-domains.mjs +34 -34
- package/assets/checks/lib-manifests.mjs +17 -15
- package/assets/checks/lib-reexports.mjs +18 -18
- package/assets/checks/rt-kit-checks.config.mjs +187 -142
- package/assets/checks/signals.mjs +43 -39
- package/assets/checks/spec-anchors.mjs +114 -87
- package/assets/checks/spec-common.mjs +128 -84
- package/assets/checks/spec-contract.mjs +30 -30
- package/assets/checks/spec-proposed.mjs +27 -24
- package/assets/checks/spec-scenarios.mjs +51 -28
- package/assets/checks/specs-for.mjs +214 -0
- package/assets/checks/task-new.github.mjs +315 -61
- package/assets/commands/feedback.md +65 -59
- package/assets/commands/next-session.md +64 -57
- package/assets/commands/night.md +115 -0
- package/assets/commands/skill-curator.md +83 -79
- package/assets/defaults/gate-map.sh +108 -97
- package/assets/defaults/project.sh +232 -185
- package/assets/defaults/shell.sh +73 -68
- package/assets/defaults/turn-map.md +47 -44
- package/assets/docs/GLOSSARY.md +142 -65
- package/assets/hooks/browser-device-id.sh +16 -12
- package/assets/hooks/browser-guard-device-id.sh +34 -28
- package/assets/hooks/browser-guard-no-asking.sh +5 -4
- package/assets/hooks/browser-guard-no-listing.sh +12 -11
- package/assets/hooks/browser-guard-no-other-drivers.sh +48 -42
- package/assets/hooks/browser-guard-require-select.sh +34 -23
- package/assets/hooks/claim-guard.sh +62 -56
- package/assets/hooks/commit-msg.sh +14 -10
- package/assets/hooks/conscience-guard.sh +91 -45
- package/assets/hooks/constitution-index.sh +16 -16
- package/assets/hooks/deny-tail.sh +28 -26
- package/assets/hooks/dev-server-guard.sh +50 -43
- package/assets/hooks/dispatch.sh +60 -46
- package/assets/hooks/docs-guard.sh +100 -91
- package/assets/hooks/epic-over.sh +49 -0
- package/assets/hooks/epic-stop-guard.sh +108 -0
- package/assets/hooks/exam-guard.sh +105 -93
- package/assets/hooks/git-guard-delivery-conflict.sh +41 -36
- package/assets/hooks/git-guard-delivery-draft.sh +48 -38
- package/assets/hooks/git-guard-delivery-epic.sh +167 -0
- package/assets/hooks/git-guard-delivery-folder.sh +50 -43
- package/assets/hooks/git-guard-delivery-signature.sh +119 -53
- package/assets/hooks/git-guard-delivery.sh +223 -183
- package/assets/hooks/git-guard-main.sh +38 -34
- package/assets/hooks/git-guard-push-tests.sh +99 -87
- package/assets/hooks/glossary-load.sh +23 -22
- package/assets/hooks/grill-gate-ask.sh +12 -11
- package/assets/hooks/grill-gate.sh +94 -87
- package/assets/hooks/guard-note.sh +20 -19
- package/assets/hooks/handoff-entry-guard.sh +45 -25
- package/assets/hooks/handoff-write.sh +74 -67
- package/assets/hooks/hook-input.sh +67 -58
- package/assets/hooks/lint-after-edit.sh +95 -61
- package/assets/hooks/observe.sh +28 -26
- package/assets/hooks/override-write-guard.sh +23 -21
- package/assets/hooks/postmortem-guard.sh +42 -39
- package/assets/hooks/profile-check.sh +22 -20
- package/assets/hooks/proposal-guard.sh +57 -49
- package/assets/hooks/prose-style-guard.sh +49 -24
- package/assets/hooks/qa-dataid-guard.sh +83 -58
- package/assets/hooks/rerun-guard.sh +31 -30
- package/assets/hooks/reuse-first-guard.sh +108 -87
- package/assets/hooks/roles.sh +14 -14
- package/assets/hooks/rule-article.sh +39 -34
- package/assets/hooks/rule-source-guard.sh +47 -42
- package/assets/hooks/skill-gate-layers.sh +63 -57
- package/assets/hooks/skill-gate-rearm.sh +15 -8
- package/assets/hooks/skill-gate.sh +89 -81
- package/assets/hooks/skill-loaded.sh +10 -6
- package/assets/hooks/sql-guard-parse.sh +71 -66
- package/assets/hooks/sql-guard-request.sh +51 -46
- package/assets/hooks/sql-guard-target.sh +60 -51
- package/assets/hooks/sql-guard-write.sh +87 -79
- package/assets/hooks/sql-guard.sh +52 -47
- package/assets/hooks/stand-login-guard.sh +43 -37
- package/assets/hooks/task-context-load.sh +60 -55
- package/assets/hooks/task-flow-context.sh +87 -69
- package/assets/hooks/task-flow-draft-guard.sh +55 -48
- package/assets/hooks/task-flow-guard.sh +67 -64
- package/assets/hooks/turn-entry-load.sh +39 -32
- package/assets/hooks/turn-exit-guard.sh +260 -204
- package/assets/hooks/turn-exit-patterns.sh +63 -0
- package/assets/hooks/utf8.sh +14 -11
- package/assets/hooks/waiting-turn-guard.sh +104 -94
- package/assets/hooks/window-fill-guard.sh +70 -62
- package/assets/hooks/work-start-guard.sh +52 -49
- package/assets/hooks/write-targets.sh +99 -44
- package/assets/laws/autonomous-work.md +29 -27
- package/assets/laws/code-structure.md +31 -30
- package/assets/laws/delivery.md +170 -137
- package/assets/laws/entity-editing.md +52 -50
- package/assets/laws/entity-models.md +14 -13
- package/assets/laws/frontend-application.md +39 -38
- package/assets/laws/lib-imports.md +27 -27
- package/assets/laws/lists.md +31 -29
- package/assets/laws/navigation.md +37 -37
- package/assets/laws/observability.md +41 -40
- package/assets/laws/project-documentation.md +106 -99
- package/assets/laws/reuse-first.md +31 -29
- package/assets/laws/shared-code.md +27 -27
- package/assets/laws/verifiability.md +131 -124
- package/assets/laws/work-conduct.md +250 -244
- package/assets/patterns/admin-lists-screen.md +72 -69
- package/assets/patterns/admin-nav-item.md +51 -46
- package/assets/patterns/angular-patterns-state.md +32 -31
- package/assets/patterns/api-layer-pair.md +33 -31
- package/assets/patterns/autonomous-work-run.md +50 -49
- package/assets/patterns/browser-verification-measure.md +124 -88
- package/assets/patterns/browser-verification-stand.md +169 -157
- package/assets/patterns/component-structure-new.md +51 -42
- package/assets/patterns/dependencies-upgrade.md +55 -39
- package/assets/patterns/doc-style-human.md +55 -37
- package/assets/patterns/doc-style-sweep.md +82 -79
- package/assets/patterns/doc-style-trace.md +87 -81
- package/assets/patterns/doc-style-write.md +130 -122
- package/assets/patterns/entity-aside.md +77 -63
- package/assets/patterns/entity-models-new.md +37 -37
- package/assets/patterns/entity-store.md +33 -33
- package/assets/patterns/git-workflow-commit.azure.md +94 -87
- package/assets/patterns/git-workflow-commit.github.md +160 -142
- package/assets/patterns/git-workflow-commit.gitlab.md +96 -90
- package/assets/patterns/git-workflow-docker.md +165 -147
- package/assets/patterns/git-workflow-freshness.md +45 -45
- package/assets/patterns/git-workflow-merge.md +102 -94
- package/assets/patterns/git-workflow-migration.md +54 -52
- package/assets/patterns/git-workflow-pr-ready.md +57 -56
- package/assets/patterns/git-workflow-pr.azure.md +127 -122
- package/assets/patterns/git-workflow-pr.github.md +186 -177
- package/assets/patterns/git-workflow-pr.gitlab.md +139 -132
- package/assets/patterns/git-workflow-restart.md +35 -31
- package/assets/patterns/git-workflow-secrets.md +80 -73
- package/assets/patterns/git-workflow-stack.md +136 -107
- package/assets/patterns/lib-layers-move.md +62 -53
- package/assets/patterns/lib-layers-new.md +59 -45
- package/assets/patterns/observability-record.md +72 -67
- package/assets/patterns/platform-access-di.md +31 -29
- package/assets/patterns/reuse-first-extend.md +66 -61
- package/assets/patterns/shared-code-new.md +39 -38
- package/assets/patterns/spec-driven-domain.md +161 -151
- package/assets/patterns/spec-driven-rule.md +179 -168
- package/assets/patterns/spec-driven-sweep.md +41 -39
- package/assets/patterns/status-report-table.github.md +48 -36
- package/assets/patterns/styling-bem-component.md +42 -42
- package/assets/patterns/styling-bem-layout.md +39 -34
- package/assets/patterns/styling-bem-sheet.md +59 -58
- package/assets/patterns/task-flow-archive.md +222 -215
- package/assets/patterns/task-flow-close.md +234 -203
- package/assets/patterns/task-flow-handoff.md +154 -145
- package/assets/patterns/task-flow-resume.md +138 -133
- package/assets/patterns/task-flow-start.md +228 -202
- package/assets/patterns/testing-e2e.md +102 -101
- package/assets/patterns/testing-unit.md +77 -70
- package/assets/patterns/ts-procedure.md +32 -29
- package/assets/patterns/turn-entry-map.md +50 -48
- package/assets/pitfalls/agent-kit.md +172 -142
- package/assets/pitfalls/doc-style.md +96 -91
- package/assets/pitfalls/git-workflow.azure.md +49 -46
- package/assets/pitfalls/git-workflow.github.md +270 -234
- package/assets/pitfalls/git-workflow.gitlab.md +49 -45
- package/assets/pitfalls/spec-driven.md +73 -71
- package/assets/pitfalls/styling-bem.md +46 -40
- package/assets/pitfalls/task-flow.md +262 -246
- package/assets/pitfalls/testing.md +99 -92
- package/assets/pitfalls/turn-conduct.md +96 -81
- package/assets/rules/angular-patterns.md +81 -80
- package/assets/rules/api-layer.md +77 -74
- package/assets/rules/autonomous-work.md +87 -74
- package/assets/rules/browser-verification.md +223 -214
- package/assets/rules/component-structure.md +72 -69
- package/assets/rules/dependencies.md +74 -67
- package/assets/rules/deploy-flow.azure.md +118 -108
- package/assets/rules/deploy-flow.github.md +145 -135
- package/assets/rules/deploy-flow.gitlab.md +120 -110
- package/assets/rules/doc-style.md +201 -173
- package/assets/rules/entity-conventions.needs-admin.md +81 -79
- package/assets/rules/entity-models.md +73 -70
- package/assets/rules/git-workflow.azure.md +224 -228
- package/assets/rules/git-workflow.github.md +268 -239
- package/assets/rules/git-workflow.gitlab.md +218 -217
- package/assets/rules/lib-layers.md +85 -86
- package/assets/rules/lists.md +101 -97
- package/assets/rules/navigation.md +78 -78
- package/assets/rules/observability.needs-app.md +165 -153
- package/assets/rules/platform-access.md +76 -75
- package/assets/rules/reuse-first.md +153 -143
- package/assets/rules/shared-code.md +82 -79
- package/assets/rules/spec-driven.md +279 -260
- package/assets/rules/status-report.md +62 -58
- package/assets/rules/styling-bem.md +81 -77
- package/assets/rules/task-flow.md +303 -270
- package/assets/rules/testing.md +224 -209
- package/assets/rules/turn-conduct.md +262 -258
- package/assets/rules/turn-entry.md +92 -87
- package/assets/rules/typescript-conventions.md +94 -88
- package/assets/samples/specs/_template/spec.md +47 -47
- package/assets/samples/tasks/_template/grill.md +20 -20
- package/assets/samples/tasks/_template/plan.md +32 -30
- package/assets/samples/tasks/_template/progress.md +16 -16
- package/assets/skills/agent-kit-extend.md +129 -113
- package/assets/skills/agent-kit.md +259 -233
- package/assets/skills/write-a-skill.md +76 -71
- package/assets/templates/findings.md +19 -19
- package/assets/templates/gate-map.sh +16 -14
- package/assets/templates/implementation.md +28 -27
- package/assets/templates/pattern.md +17 -17
- package/assets/templates/pitfalls.md +6 -6
- package/assets/templates/postmortem.md +24 -23
- package/assets/templates/project.sh +24 -24
- package/assets/templates/proposal.md +62 -60
- package/assets/templates/rule.md +38 -38
- package/assets/workflows/feature.js +46 -46
- package/assets/workflows/plan.js +54 -54
- package/bin/agent-kit.d.ts.map +1 -1
- package/bin/agent-kit.js +8 -1
- package/bin/agent-kit.js.map +1 -1
- package/lib/cargo-prose.d.ts +41 -0
- package/lib/cargo-prose.d.ts.map +1 -0
- package/lib/cargo-prose.js +88 -0
- package/lib/cargo-prose.js.map +1 -0
- package/lib/cargo.d.ts +12 -1
- package/lib/cargo.d.ts.map +1 -1
- package/lib/cargo.js +8 -2
- package/lib/cargo.js.map +1 -1
- package/lib/catalog.d.ts +2 -0
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +4 -3
- package/lib/catalog.js.map +1 -1
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +5 -2
- package/lib/commands.js.map +1 -1
- package/lib/companion.js +3 -2
- package/lib/companion.js.map +1 -1
- package/lib/enroll.d.ts +7 -1
- package/lib/enroll.d.ts.map +1 -1
- package/lib/enroll.js +12 -3
- package/lib/enroll.js.map +1 -1
- package/lib/fate.d.ts +29 -0
- package/lib/fate.d.ts.map +1 -0
- package/lib/fate.js +147 -0
- package/lib/fate.js.map +1 -0
- package/lib/override-marks.d.ts +7 -0
- package/lib/override-marks.d.ts.map +1 -1
- package/lib/override-marks.js +14 -0
- package/lib/override-marks.js.map +1 -1
- package/lib/plan.d.ts +11 -0
- package/lib/plan.d.ts.map +1 -1
- package/lib/plan.js +10 -1
- package/lib/plan.js.map +1 -1
- package/lib/ship.d.ts +29 -9
- package/lib/ship.d.ts.map +1 -1
- package/lib/ship.js +44 -2
- package/lib/ship.js.map +1 -1
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.fixture.d.ts +8 -1
- package/lib/shipment.fixture.d.ts.map +1 -1
- package/lib/shipment.fixture.js +9 -0
- package/lib/shipment.fixture.js.map +1 -1
- package/lib/shipment.js +38 -5
- package/lib/shipment.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +45 -11
- package/lib/sync.js.map +1 -1
- package/package.json +1 -1
- package/rt-tools-agent-kit-0.27.0.tgz +0 -0
- package/rt-tools-agent-kit-0.24.0.tgz +0 -0
|
@@ -2,164 +2,172 @@
|
|
|
2
2
|
name: git-workflow-docker
|
|
3
3
|
kind: pattern
|
|
4
4
|
rule: deploy-flow
|
|
5
|
-
description:
|
|
5
|
+
description: Pattern of rule deploy-flow. Load when working with images on your own machine — starting and restarting the daemon, diagnosing a hanging command, building for the production server platform, registry login from a service. Production server commands — pattern git-workflow-restart.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Images on one's own machine
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Pattern of the rule `deploy-flow`. What must be true meanwhile — the law
|
|
11
11
|
`docs/constitution/delivery.md`.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
The daemon here is someone else's: on the owner's machine it holds their development storage,
|
|
14
|
+
their stand and the containers of their other works. Every command is written so that it can be
|
|
15
|
+
cancelled without asking the owner, and so that it touches nothing except what it created itself.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## When to use
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
19
|
+
- A daemon command does not answer, and the reason must be found.
|
|
20
|
+
- A one-off container is needed next to those already running.
|
|
21
|
+
- An image is being built that will go to the production server.
|
|
22
|
+
- The pipeline runner on this machine cannot log in to the registry.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## What is not yours is not touched
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Before any action that touches the daemon whole, read what lives in it and whether it survives a
|
|
27
|
+
restart:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
docker ps --format '{{.Names}} | {{.Image}} | {{.Status}}'
|
|
31
31
|
docker inspect <контейнер> --format '{{.Name}} restart={{.HostConfig.RestartPolicy.Name}}'
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`unless-stopped`
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
`unless-stopped` comes up by itself, `no` does not, and it is brought back by hand right after the
|
|
35
|
+
daemon comes up. The owner's stand is usually created with `no`: after a restart it stays down,
|
|
36
|
+
and its port answers with nothing — this looks like a broken stand, not like the trace of a
|
|
37
|
+
restart.
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
One's own containers are named with a prefix and removed by name. `docker system prune`,
|
|
40
|
+
`docker rm` by a mask and `docker volume prune` are never written: they take away what is not
|
|
41
|
+
yours silently.
|
|
40
42
|
|
|
41
43
|
```bash
|
|
42
|
-
docker rm -f <приставка>-ci-db >/dev/null 2>&1 || true #
|
|
44
|
+
docker rm -f <приставка>-ci-db >/dev/null 2>&1 || true # remove the previous run
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
The port of one's own container is chosen free: the development storage port is taken, and a
|
|
48
|
+
foreign migration must not land in it.
|
|
47
49
|
|
|
48
50
|
```bash
|
|
49
|
-
lsof -nP -iTCP:<свободный порт> -sTCP:LISTEN #
|
|
51
|
+
lsof -nP -iTCP:<свободный порт> -sTCP:LISTEN # empty — the port is free
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
##
|
|
54
|
+
## Space is asked before the run
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
The virtual machine's disk is separate from the host's disk: the host has room, inside it is
|
|
57
|
+
empty, and this is visible only from inside.
|
|
56
58
|
|
|
57
59
|
```bash
|
|
58
|
-
docker system df #
|
|
59
|
-
docker run --rm alpine:3 df -h / #
|
|
60
|
+
docker system df # images, volumes and build cache with the reusable share
|
|
61
|
+
docker run --rm alpine:3 df -h / # how much the virtual machine itself has left
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
The shortage surfaces wearing someone else's face: a container comes up and goes out at once, the
|
|
65
|
+
schema audit answers about a chain that does not apply, the push gate goes red whole. By these
|
|
66
|
+
signs the repository gets fixed, while the cause is in the machine — so the first thing on any of
|
|
67
|
+
them is `docker system df`.
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
`could not extend file … No space left on device
|
|
68
|
-
|
|
69
|
+
The host disk meanwhile stays free and says "plenty of room": the end-to-end suite fell on
|
|
70
|
+
`could not extend file … No space left on device` with 98 GB free on the host. Space is measured
|
|
71
|
+
at docker, not at the machine.
|
|
69
72
|
|
|
70
|
-
##
|
|
73
|
+
## Garbage is removed by selection, and what is not yours is excluded by label
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
`docker system df`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
Volumes outlive their containers and pile up silently: `docker ps` does not show them, and
|
|
76
|
+
`docker system df` counts them as one line. They pile up differently — a container without `--rm`
|
|
77
|
+
always leaves its volume, while `docker run --rm` removes an anonymous volume together with the
|
|
78
|
+
container itself, and adding `-v` to it is not needed: for `docker run` that flag means a mount
|
|
79
|
+
and without a value breaks the command. Volumes are removed by `-v` of `docker rm`, not of
|
|
80
|
+
`docker run`.
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
`com.docker.compose.project`
|
|
82
|
+
The sign of one's own is the absence of the compose label: a volume created by someone's
|
|
83
|
+
`docker compose` carries `com.docker.compose.project` and belongs to that project, including
|
|
84
|
+
someone else's.
|
|
80
85
|
|
|
81
86
|
```bash
|
|
82
|
-
docker volume ls -q -f dangling=true | wc -l #
|
|
87
|
+
docker volume ls -q -f dangling=true | wc -l # how many unused have piled up
|
|
83
88
|
for v in $(docker volume ls -q -f dangling=true); do
|
|
84
89
|
[ -z "$(docker volume inspect "$v" --format '{{index .Labels "com.docker.compose.project"}}')" ] \
|
|
85
90
|
&& docker volume rm "$v"
|
|
86
91
|
done
|
|
87
|
-
docker builder prune --force --filter until=24h #
|
|
92
|
+
docker builder prune --force --filter until=24h # yesterday's cache is nobody's, the fresh one the build needs
|
|
88
93
|
```
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
A threshold on the cache, not a full cleanup: removed whole, it makes the next build go from
|
|
96
|
+
scratch.
|
|
91
97
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
A pipeline run living on the owner's machine cleans up after itself, and does it in a step that
|
|
99
|
+
runs on failure too: space runs out exactly when the run fails, and a cleanup skipped on failure
|
|
100
|
+
does not happen the one time it was needed.
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
Space is freed by selection, not by a general cleanup: the image cleanup script is first asked
|
|
103
|
+
what it would remove, and only then allowed to remove.
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
**Removing images is refused not by the gate but by the session mode.** In the automatic mode a
|
|
106
|
+
command with an irreversible deletion — removing an image, cleaning layers — is rejected whatever
|
|
107
|
+
the permissions, and an allow rule on the same command does not lift the refusal. A repeated
|
|
108
|
+
call is refused the same way: the refusal does not depend on how the command is typed, so
|
|
109
|
+
rewording is not the way here. Two ways from here — free space by what needs no deletion, or name
|
|
110
|
+
it to the owner: they switch the mode, and they remove the images too. Named at the end of the
|
|
111
|
+
session it costs a whole run: the pipeline stays red all that time for lack of space.
|
|
106
112
|
|
|
107
|
-
##
|
|
113
|
+
## The daemon is brought up by its own CLI
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
Opening the application does not bring up the virtual machine: the application counts as
|
|
116
|
+
running, and the daemon does not answer for hours. Only the client's own command brings it up,
|
|
117
|
+
and readiness is checked by the daemon itself:
|
|
112
118
|
|
|
113
119
|
```bash
|
|
114
120
|
docker desktop restart
|
|
115
121
|
until docker info >/dev/null 2>&1; do sleep 5; done
|
|
116
|
-
docker version --format '
|
|
122
|
+
docker version --format 'daemon: {{.Server.Version}}'
|
|
117
123
|
```
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`docker info`.
|
|
122
|
-
|
|
125
|
+
The state the application prints speaks about the application: it answers "running" even when
|
|
126
|
+
the daemon accepts not a single command. The only sign of a live daemon is the answer of
|
|
127
|
+
`docker info`. For the first half a minute after coming up it answers with an error and writes to
|
|
128
|
+
its log that there is no route to the virtual machine: that is a normal start, not a breakage.
|
|
123
129
|
|
|
124
|
-
##
|
|
130
|
+
## "The command hangs" — first check whether it really hangs
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
Output is not wrapped in `tail`, `head` and not muted by a quiet mode: they hold it in a buffer
|
|
133
|
+
until the command ends, and work in progress looks hung. The direct output is read:
|
|
128
134
|
|
|
129
135
|
```bash
|
|
130
|
-
docker pull alpine:3 #
|
|
136
|
+
docker pull alpine:3 # progress is visible line by line
|
|
131
137
|
```
|
|
132
138
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
Downloads are not started in parallel. Several at once choke the channel for each other: an
|
|
140
|
+
image that pulls in three seconds went for half an hour — and that looked like a broken daemon,
|
|
141
|
+
while it was a queue arranged by the one checking.
|
|
136
142
|
|
|
137
|
-
##
|
|
143
|
+
## Where it breaks: three tiers
|
|
138
144
|
|
|
139
|
-
|
|
145
|
+
The tiers are checked separately, otherwise the wrong thing gets fixed. Each answers in seconds:
|
|
140
146
|
|
|
141
147
|
```bash
|
|
142
|
-
# 1.
|
|
143
|
-
curl -s -m 30 -w '%{http_code}
|
|
148
|
+
# 1. The machine's network: the registry gives out the manifest
|
|
149
|
+
curl -s -m 30 -w '%{http_code} in %{time_total}s\n' -o /dev/null '<адрес токена реестра>'
|
|
144
150
|
|
|
145
|
-
# 2.
|
|
151
|
+
# 2. The containers' network: volume passes inside
|
|
146
152
|
docker run --rm alpine:3 sh -c 'time wget -q -O /dev/null <адрес пробы канала>'
|
|
147
153
|
|
|
148
|
-
# 3.
|
|
154
|
+
# 3. The daemon: does it pull by itself
|
|
149
155
|
docker pull busybox:latest
|
|
150
156
|
```
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
The host pulls fast, the container pulls fast, and the download stands — the daemon is the
|
|
159
|
+
matter, and it is restarted. All three stand — the machine's network is the matter, and the
|
|
160
|
+
daemon has nothing to do with it. What the daemon itself was doing, its logs answer: the calls to
|
|
161
|
+
the registry, the startup and state, the virtual machine console — three different files in the
|
|
162
|
+
client's data directory.
|
|
156
163
|
|
|
157
|
-
##
|
|
164
|
+
## A command from a service: its own settings directory and an explicit daemon address
|
|
158
165
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
166
|
+
The pipeline runner is started as a service, and registry login from it refuses: the password is
|
|
167
|
+
saved by the system keychain helper, and a service has no user session. A settings directory of
|
|
168
|
+
its own with an empty helper does not save it — the client substitutes the helper itself and
|
|
169
|
+
rewrites the empty value silently. So login is not called at all, and the password is written
|
|
170
|
+
into the settings file directly:
|
|
163
171
|
|
|
164
172
|
```bash
|
|
165
173
|
export DOCKER_CONFIG="$(mktemp -d)"
|
|
@@ -169,87 +177,97 @@ printf '{"auths":{"<реестр>":{"auth":"%s"}}}' "${auth}" > "${DOCKER_CONFIG
|
|
|
169
177
|
chmod 600 "${DOCKER_CONFIG}/config.json"
|
|
170
178
|
```
|
|
171
179
|
|
|
172
|
-
`DOCKER_HOST`
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
`DOCKER_HOST` here is not for decoration: a directory of one's own takes the current context with
|
|
181
|
+
it, and without it the client goes to the system-wide socket, which does not exist at all on a
|
|
182
|
+
machine with a desktop client, and answers "no such file" to anything. The connection is checked
|
|
183
|
+
before the build:
|
|
175
184
|
|
|
176
185
|
```bash
|
|
177
|
-
docker info --format '
|
|
186
|
+
docker info --format 'daemon: {{.ServerVersion}}'
|
|
178
187
|
```
|
|
179
188
|
|
|
180
|
-
|
|
181
|
-
|
|
189
|
+
The field in `docker info` is named differently from `docker version`: the first command does not
|
|
190
|
+
understand the name from the second, and the connection looks unchecked though the daemon
|
|
191
|
+
answers.
|
|
182
192
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
193
|
+
That the password is accepted is seen by the registry's answer: to an anonymous one it answers
|
|
194
|
+
`401`, to an authorised one — with content or `403`, but not `401`. The directory is removed at
|
|
195
|
+
the end — the runner lives between runs, and the registry password would stay lying on the
|
|
196
|
+
owner's disk.
|
|
186
197
|
|
|
187
|
-
##
|
|
198
|
+
## Token rights are asked before the pipeline leans on them
|
|
188
199
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
The token used by hand and the token the rollout uses are one and the same exactly until the
|
|
201
|
+
first write to the image registry: its scopes may end at reading. This is learned by a refusal
|
|
202
|
+
when the whole rollout path is already written, so it is asked earlier — and not by a guess but
|
|
203
|
+
by the host's answer header:
|
|
193
204
|
|
|
194
205
|
```bash
|
|
195
206
|
curl -sI -H "Authorization: Bearer <токен>" '<адрес хостинга>' | grep -i '^x-oauth-scopes:'
|
|
196
207
|
```
|
|
197
208
|
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
The first rollout done by hand because of such a refusal does not check the rollout path — it
|
|
210
|
+
checks the images. This is said to the owner directly: otherwise a green production reads as a
|
|
211
|
+
passed pipeline.
|
|
200
212
|
|
|
201
|
-
##
|
|
213
|
+
## The image is built for the production server platform
|
|
202
214
|
|
|
203
|
-
|
|
204
|
-
|
|
215
|
+
The owner's machine and the production server can be of different architectures. Without an
|
|
216
|
+
explicit platform the image is built for the builder: it goes to the registry, from there to the
|
|
217
|
+
server and does not start there at all.
|
|
205
218
|
|
|
206
219
|
```bash
|
|
207
220
|
docker buildx build --platform <платформа сервера> -f <файл сборки> --output type=cacheonly .
|
|
208
221
|
```
|
|
209
222
|
|
|
210
|
-
`--output type=cacheonly`
|
|
211
|
-
|
|
212
|
-
|
|
223
|
+
`--output type=cacheonly` runs the build without saving anything — that is how time is measured
|
|
224
|
+
without littering the machine with an image. A foreign platform goes by emulation, so build time
|
|
225
|
+
on the machine and in the cloud is compared by a number, not by expectation.
|
|
213
226
|
|
|
214
|
-
|
|
215
|
-
|
|
227
|
+
A builder with the `docker-container` driver is needed for a foreign platform and is created
|
|
228
|
+
separately; its first startup pulls its own image from the registry:
|
|
216
229
|
|
|
217
230
|
```bash
|
|
218
231
|
docker buildx create --name <приставка>-ci-builder --driver docker-container
|
|
219
|
-
docker buildx inspect <приставка>-ci-builder --bootstrap #
|
|
220
|
-
docker buildx build --builder <приставка>-ci-builder … #
|
|
232
|
+
docker buildx inspect <приставка>-ci-builder --bootstrap # shows the platforms and the state
|
|
233
|
+
docker buildx build --builder <приставка>-ci-builder … # the owner's builder is not switched
|
|
221
234
|
```
|
|
222
235
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
236
|
+
The builder is not torn down after the run: its cache holds the layers and the package store, and
|
|
237
|
+
without them the next build pulls all dependencies anew. The `--use` flag is not written either —
|
|
238
|
+
it switches the owner's builder; instead of it `--builder` on the build itself. Builder
|
|
239
|
+
declarations lie in the settings directory, so under a directory of one's own they are not
|
|
240
|
+
visible at all — `BUILDX_CONFIG` with the address of the owner's directory helps leave them in
|
|
241
|
+
place.
|
|
242
|
+
|
|
243
|
+
Dependency installation inside the build is limited by the number of requests, otherwise it
|
|
244
|
+
brings the build down whole — and not because the channel is slow, but because hundreds of
|
|
245
|
+
requests choke it for themselves.
|
|
246
|
+
|
|
247
|
+
## Common misses
|
|
248
|
+
|
|
249
|
+
- **The daemon restart is declared done by the application's state.** The application says
|
|
250
|
+
"running", and `docker info` at the same time answers with an error.
|
|
251
|
+
- **The stand is not brought back after the restart.** Its policy is `no`, and the owner finds a
|
|
252
|
+
dead port instead of the stand.
|
|
253
|
+
- **The command output is fed into `tail`** — and a working command is declared hung.
|
|
254
|
+
- **Several downloads at once** — and the machine is declared slow, not one's own queue.
|
|
255
|
+
- **The image is built without naming the platform** — production gets an image of a foreign
|
|
256
|
+
architecture, and this is visible only at the container restart.
|
|
257
|
+
- **One's own container took the development storage port** — the pipeline writes into the
|
|
258
|
+
owner's data.
|
|
259
|
+
- **Registry login from a service is done by the login command** — the password goes to the
|
|
260
|
+
keychain helper even from a settings directory of one's own, and the step fails before the
|
|
261
|
+
build.
|
|
262
|
+
- **The settings directory is substituted, and the daemon address is not set** — and fixing the
|
|
263
|
+
registry login looks like a fallen daemon.
|
|
264
|
+
- **The builder is torn down after the run** — together with the cache, and the next build goes as
|
|
265
|
+
the first.
|
|
266
|
+
- **A general cleanup for the sake of space** — takes away someone else's images and volumes, and
|
|
267
|
+
there is nothing to restore them with.
|
|
268
|
+
- **Space is freed by the rollout script whole.** The script is written for the production
|
|
269
|
+
server: there the pipeline builds, and the server only pulls the ready-made, so as the last step
|
|
270
|
+
the script tears down the builder cache. On the owner's machine the runner builds, and the same
|
|
271
|
+
step leaves the builder without a cache. The script's selection of the images themselves suits
|
|
272
|
+
here too — it goes by the name of its own registry, keeps the last three sha and skips running
|
|
273
|
+
containers — but its tail on this machine is run only when a full build wait was agreed to.
|