@toa.io/operations 1.0.0-alpha.262 → 1.0.0-alpha.264
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.264](https://github.com/toa-io/toa/compare/v1.0.0-alpha.263...v1.0.0-alpha.264) (2026-08-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @toa.io/operations
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.0.0-alpha.263](https://github.com/toa-io/toa/compare/v1.0.0-alpha.262...v1.0.0-alpha.263) (2026-08-29)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @toa.io/operations
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [1.0.0-alpha.262](https://github.com/toa-io/toa/compare/v1.0.0-alpha.261...v1.0.0-alpha.262) (2026-08-28)
|
|
7
23
|
|
|
8
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/operations",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.264",
|
|
4
4
|
"description": "Toa Deployment",
|
|
5
5
|
"homepage": "https://toa.io",
|
|
6
6
|
"author": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@toa.io/filesystem": "1.0.0-alpha.254",
|
|
31
31
|
"@toa.io/generic": "1.0.0-alpha.254",
|
|
32
|
-
"@toa.io/norm": "1.0.0-alpha.
|
|
32
|
+
"@toa.io/norm": "1.0.0-alpha.264",
|
|
33
33
|
"@toa.io/yaml": "1.0.0-alpha.254",
|
|
34
34
|
"execa": "5.1.1",
|
|
35
35
|
"fs-extra": "11.1.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "df47af37e7d4f7cf85ca8cf5c84355f53ccb90bd"
|
|
38
38
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Every deployment states what it may take. One that states nothing is `BestEffort`: the
|
|
5
|
+
* first evicted under memory pressure and the last given CPU under contention — which on
|
|
6
|
+
* a busy node is slow enough for its own startup probe to kill it, in a loop, while the
|
|
7
|
+
* chart reports nothing wrong. That is not a thing to find out in production.
|
|
8
|
+
*
|
|
9
|
+
* A deployment takes its own declaration, or the context's `resources` where it has none.
|
|
10
|
+
* Deploying without any is a decision rather than an omission, and it is spelled
|
|
11
|
+
* `resources: null` — at either place.
|
|
12
|
+
*/
|
|
13
|
+
function resources (context, values) {
|
|
14
|
+
for (const unit of units(values)) {
|
|
15
|
+
// `null` is an answer and `undefined` is not one, so the fallback reads only the latter
|
|
16
|
+
if (unit.deployment.resources === undefined)
|
|
17
|
+
unit.deployment.resources = context.resources
|
|
18
|
+
|
|
19
|
+
if (unit.deployment.resources === undefined)
|
|
20
|
+
throw new Error(`${unit.subject} declares no resources. ` +
|
|
21
|
+
'Declare them on it or as the context\'s \'resources\', ' +
|
|
22
|
+
'or \'resources: null\' to deploy it without any.')
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function * units (values) {
|
|
27
|
+
if (values.mono !== undefined)
|
|
28
|
+
yield { deployment: values.mono, subject: 'The mono deployment' }
|
|
29
|
+
|
|
30
|
+
for (const composition of values.compositions ?? [])
|
|
31
|
+
yield { deployment: composition, subject: `Composition '${composition.name}'` }
|
|
32
|
+
|
|
33
|
+
for (const service of values.services ?? [])
|
|
34
|
+
yield { deployment: service, subject: `Service '${service.name}'` }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.resources = resources
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const desc = require('./.describe')
|
|
4
4
|
const { addVariables } = require('./.describe/variables')
|
|
5
5
|
const { addMounts } = require('./.describe/mounts')
|
|
6
|
+
const { resources } = require('./.describe/resources')
|
|
6
7
|
|
|
7
8
|
const describe = (context, compositions, dependency, image) => {
|
|
8
9
|
const { services } = dependency
|
|
@@ -26,13 +27,17 @@ const describe = (context, compositions, dependency, image) => {
|
|
|
26
27
|
|
|
27
28
|
mono.image = image.reference
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
const values = {
|
|
30
31
|
compositions: [],
|
|
31
32
|
components: mono.components,
|
|
32
33
|
services: [],
|
|
33
34
|
credentials,
|
|
34
35
|
mono
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
resources(context, values)
|
|
39
|
+
|
|
40
|
+
return values
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
const components = desc.components(compositions)
|
|
@@ -40,12 +45,16 @@ const describe = (context, compositions, dependency, image) => {
|
|
|
40
45
|
desc.compositions(compositions, dependency)
|
|
41
46
|
desc.services(services, dependency.variables, dependency.probe, context.ingress)
|
|
42
47
|
|
|
43
|
-
|
|
48
|
+
const values = {
|
|
44
49
|
compositions,
|
|
45
50
|
components,
|
|
46
51
|
services,
|
|
47
52
|
credentials
|
|
48
53
|
}
|
|
54
|
+
|
|
55
|
+
resources(context, values)
|
|
56
|
+
|
|
57
|
+
return values
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
function unit (context, dependency) {
|