docker-stack 2.0.7__tar.gz → 2.1.1__tar.gz
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.
- {docker_stack-2.0.7 → docker_stack-2.1.1}/PKG-INFO +103 -3
- {docker_stack-2.0.7 → docker_stack-2.1.1}/README.md +101 -1
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/__init__.py +1 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/cli.py +548 -140
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/docker_objects.py +36 -10
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/helpers.py +17 -6
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/login.py +66 -8
- docker_stack-2.1.1/docker_stack/manager_api.py +706 -0
- docker_stack-2.1.1/docker_stack/shell_auth.py +742 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/PKG-INFO +103 -3
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/SOURCES.txt +3 -1
- {docker_stack-2.0.7 → docker_stack-2.1.1}/setup.py +2 -2
- {docker_stack-2.0.7 → docker_stack-2.1.1}/tests/test_docker_objects.py +21 -0
- docker_stack-2.1.1/tests/test_docker_stack.py +1202 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/tests/test_login.py +54 -26
- docker_stack-2.1.1/tests/test_manager_api.py +462 -0
- docker_stack-2.1.1/tests/test_shell_auth.py +389 -0
- docker_stack-2.0.7/docker_stack/manager_api.py +0 -378
- docker_stack-2.0.7/tests/test_docker_stack.py +0 -598
- docker_stack-2.0.7/tests/test_manager_api.py +0 -72
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/command_runner.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/compose.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/envsubst.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/envsubst_merge.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/markers.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/merge_conf.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/registry.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack/url_parser.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/dependency_links.txt +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/entry_points.txt +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/requires.txt +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/docker_stack.egg-info/top_level.txt +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/pyproject.toml +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/setup.cfg +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/tests/test_load_env.py +0 -0
- {docker_stack-2.0.7 → docker_stack-2.1.1}/tests/test_node_ls.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: docker-stack
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.1
|
|
4
4
|
Summary: CLI for deploying and managing Docker stacks.
|
|
5
5
|
Home-page: https://github.com/mesudip/docker-stack
|
|
6
6
|
Author: Sudip Bhattarai
|
|
@@ -8,7 +8,7 @@ Author-email: sudip@bhattarai.me
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
Requires-Dist: PyYAML
|
|
14
14
|
Provides-Extra: dev
|
|
@@ -64,7 +64,9 @@ What this gives you on a raw Docker daemon:
|
|
|
64
64
|
|
|
65
65
|
### GitHub Actions
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
#### 1. Normal Docker daemon
|
|
68
|
+
|
|
69
|
+
Use this when the runner already has Docker access through the default Docker context or `DOCKER_HOST`.
|
|
68
70
|
|
|
69
71
|
```yaml
|
|
70
72
|
steps:
|
|
@@ -76,6 +78,85 @@ steps:
|
|
|
76
78
|
- run: docker-stack deploy my-stack docker-compose.yml
|
|
77
79
|
```
|
|
78
80
|
|
|
81
|
+
Use this option when CI can connect directly to the target Docker daemon.
|
|
82
|
+
|
|
83
|
+
#### 2. Docker-Manager
|
|
84
|
+
|
|
85
|
+
Use the bundled action when deploying through Docker-Manager:
|
|
86
|
+
|
|
87
|
+
For a full compose deployment directly from CI, use the action to configure
|
|
88
|
+
Docker-Manager authentication and then run the normal `docker-stack deploy`
|
|
89
|
+
command:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
permissions:
|
|
93
|
+
contents: read
|
|
94
|
+
id-token: write
|
|
95
|
+
|
|
96
|
+
steps:
|
|
97
|
+
- uses: actions/checkout@v4
|
|
98
|
+
- uses: mesudip/docker-stack@v2
|
|
99
|
+
with:
|
|
100
|
+
manager: https://manager.example.com:2378
|
|
101
|
+
- run: docker-stack deploy --namespace team-a --with-registry-auth my-stack docker-compose.yml
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
You can also deploy the full compose file through action inputs:
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
permissions:
|
|
108
|
+
contents: read
|
|
109
|
+
id-token: write
|
|
110
|
+
|
|
111
|
+
steps:
|
|
112
|
+
- uses: actions/checkout@v4
|
|
113
|
+
- uses: mesudip/docker-stack@v2
|
|
114
|
+
with:
|
|
115
|
+
manager: https://manager.example.com:2378
|
|
116
|
+
stack: my-stack
|
|
117
|
+
compose-file: docker-compose.yml
|
|
118
|
+
namespace: team-a
|
|
119
|
+
with-registry-auth: "true"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
To release new service images without submitting the compose file again:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
permissions:
|
|
126
|
+
contents: read
|
|
127
|
+
id-token: write
|
|
128
|
+
|
|
129
|
+
steps:
|
|
130
|
+
- uses: actions/checkout@v4
|
|
131
|
+
- uses: mesudip/docker-stack@v2
|
|
132
|
+
with:
|
|
133
|
+
manager: https://manager.example.com:2378
|
|
134
|
+
stack: my-stack
|
|
135
|
+
namespace: team-a
|
|
136
|
+
with-registry-auth: "true"
|
|
137
|
+
images: |
|
|
138
|
+
api=ghcr.io/acme/api:${{ github.sha }}
|
|
139
|
+
worker=ghcr.io/acme/worker:${{ github.sha }}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use a full compose deployment when the workflow owns the complete stack
|
|
143
|
+
definition. Use an image-only deployment when the stack is already managed and
|
|
144
|
+
the workflow only needs to release new images. Both forms support namespaces;
|
|
145
|
+
the namespace defaults to `default` when omitted.
|
|
146
|
+
|
|
147
|
+
### Authenticated Docker-Manager shell
|
|
148
|
+
|
|
149
|
+
Open an isolated Bash or Zsh session for a manager context:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
docker-stack shell office
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The prompt displays `(docker:office)`, keeps the selected manager context active,
|
|
156
|
+
and refreshes authentication when needed. The session supports `docker` and
|
|
157
|
+
`docker compose`; legacy `docker-compose` is not supported. If authentication
|
|
158
|
+
expires, run `docker-stack login` again.
|
|
159
|
+
|
|
79
160
|
## Core Capabilities
|
|
80
161
|
|
|
81
162
|
- **Advanced Deployments on Plain Docker Daemons:**
|
|
@@ -139,6 +220,20 @@ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for d
|
|
|
139
220
|
```
|
|
140
221
|
*(Content of `./templates/my_config.tpl` might be: `DB_HOST=${DATABASE_HOST}`)*
|
|
141
222
|
|
|
223
|
+
### `environment`: Secret Content from Environment Variables
|
|
224
|
+
Secrets can read their content from an environment variable at deploy time.
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
secrets:
|
|
228
|
+
api_token:
|
|
229
|
+
environment: API_TOKEN
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
If the variable is unset or empty, deployment fails before Docker objects are created.
|
|
233
|
+
|
|
234
|
+
### Stored Source Metadata
|
|
235
|
+
Versioned stack configs include a top-level `x-files` list with base64-encoded source material for recovery and auditing. This includes the original compose file as `compose.yml`, a generated `.env` containing referenced non-secret environment values, and config files referenced by `configs.*.file` or `configs.*.x-template-file`. Secret source files and variables used by `secrets.*.environment` are not stored in `x-files`.
|
|
236
|
+
|
|
142
237
|
### `x-generate`: Dynamic Secret Generation (Secrets Only)
|
|
143
238
|
This powerful feature allows you to automatically generate random secrets based on specified criteria, eliminating the need to manually create and manage them. This is particularly useful for passwords, API keys, and other sensitive data.
|
|
144
239
|
|
|
@@ -242,6 +337,11 @@ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for d
|
|
|
242
337
|
uppercase: false
|
|
243
338
|
```
|
|
244
339
|
|
|
340
|
+
## Known Limitations
|
|
341
|
+
|
|
342
|
+
Docker limits config content to 500 KB. Stack history includes encoded source
|
|
343
|
+
files, so stacks with large compose or config files can exceed that limit.
|
|
344
|
+
|
|
245
345
|
## Development
|
|
246
346
|
|
|
247
347
|
Install runtime and test dependencies with either:
|
|
@@ -38,7 +38,9 @@ What this gives you on a raw Docker daemon:
|
|
|
38
38
|
|
|
39
39
|
### GitHub Actions
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
#### 1. Normal Docker daemon
|
|
42
|
+
|
|
43
|
+
Use this when the runner already has Docker access through the default Docker context or `DOCKER_HOST`.
|
|
42
44
|
|
|
43
45
|
```yaml
|
|
44
46
|
steps:
|
|
@@ -50,6 +52,85 @@ steps:
|
|
|
50
52
|
- run: docker-stack deploy my-stack docker-compose.yml
|
|
51
53
|
```
|
|
52
54
|
|
|
55
|
+
Use this option when CI can connect directly to the target Docker daemon.
|
|
56
|
+
|
|
57
|
+
#### 2. Docker-Manager
|
|
58
|
+
|
|
59
|
+
Use the bundled action when deploying through Docker-Manager:
|
|
60
|
+
|
|
61
|
+
For a full compose deployment directly from CI, use the action to configure
|
|
62
|
+
Docker-Manager authentication and then run the normal `docker-stack deploy`
|
|
63
|
+
command:
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
permissions:
|
|
67
|
+
contents: read
|
|
68
|
+
id-token: write
|
|
69
|
+
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v4
|
|
72
|
+
- uses: mesudip/docker-stack@v2
|
|
73
|
+
with:
|
|
74
|
+
manager: https://manager.example.com:2378
|
|
75
|
+
- run: docker-stack deploy --namespace team-a --with-registry-auth my-stack docker-compose.yml
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
You can also deploy the full compose file through action inputs:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
permissions:
|
|
82
|
+
contents: read
|
|
83
|
+
id-token: write
|
|
84
|
+
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
- uses: mesudip/docker-stack@v2
|
|
88
|
+
with:
|
|
89
|
+
manager: https://manager.example.com:2378
|
|
90
|
+
stack: my-stack
|
|
91
|
+
compose-file: docker-compose.yml
|
|
92
|
+
namespace: team-a
|
|
93
|
+
with-registry-auth: "true"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
To release new service images without submitting the compose file again:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
permissions:
|
|
100
|
+
contents: read
|
|
101
|
+
id-token: write
|
|
102
|
+
|
|
103
|
+
steps:
|
|
104
|
+
- uses: actions/checkout@v4
|
|
105
|
+
- uses: mesudip/docker-stack@v2
|
|
106
|
+
with:
|
|
107
|
+
manager: https://manager.example.com:2378
|
|
108
|
+
stack: my-stack
|
|
109
|
+
namespace: team-a
|
|
110
|
+
with-registry-auth: "true"
|
|
111
|
+
images: |
|
|
112
|
+
api=ghcr.io/acme/api:${{ github.sha }}
|
|
113
|
+
worker=ghcr.io/acme/worker:${{ github.sha }}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Use a full compose deployment when the workflow owns the complete stack
|
|
117
|
+
definition. Use an image-only deployment when the stack is already managed and
|
|
118
|
+
the workflow only needs to release new images. Both forms support namespaces;
|
|
119
|
+
the namespace defaults to `default` when omitted.
|
|
120
|
+
|
|
121
|
+
### Authenticated Docker-Manager shell
|
|
122
|
+
|
|
123
|
+
Open an isolated Bash or Zsh session for a manager context:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
docker-stack shell office
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The prompt displays `(docker:office)`, keeps the selected manager context active,
|
|
130
|
+
and refreshes authentication when needed. The session supports `docker` and
|
|
131
|
+
`docker compose`; legacy `docker-compose` is not supported. If authentication
|
|
132
|
+
expires, run `docker-stack login` again.
|
|
133
|
+
|
|
53
134
|
## Core Capabilities
|
|
54
135
|
|
|
55
136
|
- **Advanced Deployments on Plain Docker Daemons:**
|
|
@@ -113,6 +194,20 @@ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for d
|
|
|
113
194
|
```
|
|
114
195
|
*(Content of `./templates/my_config.tpl` might be: `DB_HOST=${DATABASE_HOST}`)*
|
|
115
196
|
|
|
197
|
+
### `environment`: Secret Content from Environment Variables
|
|
198
|
+
Secrets can read their content from an environment variable at deploy time.
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
secrets:
|
|
202
|
+
api_token:
|
|
203
|
+
environment: API_TOKEN
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
If the variable is unset or empty, deployment fails before Docker objects are created.
|
|
207
|
+
|
|
208
|
+
### Stored Source Metadata
|
|
209
|
+
Versioned stack configs include a top-level `x-files` list with base64-encoded source material for recovery and auditing. This includes the original compose file as `compose.yml`, a generated `.env` containing referenced non-secret environment values, and config files referenced by `configs.*.file` or `configs.*.x-template-file`. Secret source files and variables used by `secrets.*.environment` are not stored in `x-files`.
|
|
210
|
+
|
|
116
211
|
### `x-generate`: Dynamic Secret Generation (Secrets Only)
|
|
117
212
|
This powerful feature allows you to automatically generate random secrets based on specified criteria, eliminating the need to manually create and manage them. This is particularly useful for passwords, API keys, and other sensitive data.
|
|
118
213
|
|
|
@@ -216,6 +311,11 @@ Vanilla Docker Stack deployments can sometimes lack the flexibility needed for d
|
|
|
216
311
|
uppercase: false
|
|
217
312
|
```
|
|
218
313
|
|
|
314
|
+
## Known Limitations
|
|
315
|
+
|
|
316
|
+
Docker limits config content to 500 KB. Stack history includes encoded source
|
|
317
|
+
files, so stacks with large compose or config files can exceed that limit.
|
|
318
|
+
|
|
219
319
|
## Development
|
|
220
320
|
|
|
221
321
|
Install runtime and test dependencies with either:
|