@ossy/deployment-tools 3.6.0 → 3.7.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/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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
+ # [3.7.0](https://github.com/ossy-se/ossy/compare/v3.6.2...v3.7.0) (2026-08-22)
7
+
8
+ ### Features
9
+
10
+ * **deployment-tools:** give website-ossy 1 vCPU, 4 GB, two tasks, and a larger Node heap ([#667](https://github.com/ossy-se/ossy/issues/667)) ([3e81436](https://github.com/ossy-se/ossy/commit/3e814363a7f80f37a1b90f64677371cfa2f2fe44))
11
+
12
+
6
13
  # [3.6.0](https://github.com/ossy-se/ossy/compare/v3.5.1...v3.6.0) (2026-08-16)
7
14
 
8
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/deployment-tools",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Collection of scripts and tools to aid deployment of containers and static files to Amazon Web Services through GitHub Actions",
5
5
  "source": "./src/index.js",
6
6
  "main": "./src/index.js",
@@ -24,5 +24,5 @@
24
24
  "devDependencies": {
25
25
  "jest": "^30.4.2"
26
26
  },
27
- "gitHead": "d1fd144986b0e819d46926aeb11f7815ac52a784"
27
+ "gitHead": "622d97535abad08415963405ace2f5aaaecd7ca4"
28
28
  }
@@ -21,6 +21,9 @@
21
21
  * @property {string} domain - primary hostname (default ALB host when `hosts` omitted)
22
22
  * @property {string[]=} hosts - ALB host-header values (#557); defaults to `[domain]`
23
23
  * @property {string} image - Docker image (e.g. ghcr.io/ossy-se/website-ossy:latest)
24
+ * @property {number=} cpu - Fargate CPU units; default 512
25
+ * @property {number=} memoryLimitMiB - Fargate memory MiB; default 1024
26
+ * @property {number=} desiredCount - ECS desired tasks; default 1
24
27
  *
25
28
  * @typedef {Object} TcpServiceConfig
26
29
  * @property {'tcp'} type - raw socket service; not deployed on the ECS path (#560)
@@ -42,6 +42,10 @@ const CONTAINER_ENVIRONMENT_KEYS = Object.freeze([
42
42
  * @property {string[]} hosts - ALB host-header values for this service (empty = default/catch-all)
43
43
  * @property {boolean} isDefault - when true, ALB default action forwards here (runtime)
44
44
  * @property {number} containerPort - container listen port
45
+ * @property {number} cpu - Fargate task CPU units (256, 512, 1024, …)
46
+ * @property {number} memoryLimitMiB - Fargate task memory (must be valid for `cpu`)
47
+ * @property {number} desiredCount - ECS service desired task count
48
+ * @property {string} [nodeOptions] - optional `NODE_OPTIONS` for the container
45
49
  */
46
50
 
47
51
  /**
@@ -55,7 +59,7 @@ function secretEnvKeysForEcsContainer(envKeys = []) {
55
59
  if (!Array.isArray(envKeys)) {
56
60
  throw new Error('[platform-ecs-services] envKeys must be an array')
57
61
  }
58
- const reserved = new Set(CONTAINER_ENVIRONMENT_KEYS)
62
+ const reserved = new Set([...CONTAINER_ENVIRONMENT_KEYS, 'NODE_OPTIONS'])
59
63
  return envKeys.filter((key) => typeof key === 'string' && key && !reserved.has(key))
60
64
  }
61
65
 
@@ -78,6 +82,7 @@ function containerEnvironment({
78
82
  containerPort = CONTAINER_PORT,
79
83
  mediaRepository,
80
84
  mediaCdnDomainName,
85
+ nodeOptions,
81
86
  }) {
82
87
  if (!serviceKey) {
83
88
  throw new Error('[platform-ecs-services] serviceKey is required')
@@ -91,6 +96,7 @@ function containerEnvironment({
91
96
  OSSY_SERVICE_NAME: serviceKey,
92
97
  MEDIA_REPOSITORY: mediaRepository,
93
98
  MEDIA_CDN_DOMAIN_NAME: mediaCdnDomainName,
99
+ ...(nodeOptions ? { NODE_OPTIONS: nodeOptions } : {}),
94
100
  }
95
101
  }
96
102
 
@@ -151,7 +157,7 @@ function runtimeHosts(config, httpEntries) {
151
157
  * @param {{
152
158
  * platformName: string,
153
159
  * domains?: string[],
154
- * services?: Array<{ name: string, type?: string, domain?: string, hosts?: string[], image?: string }>
160
+ * services?: Array<{ name: string, type?: string, domain?: string, hosts?: string[], image?: string, cpu?: number, memoryLimitMiB?: number, desiredCount?: number }>
155
161
  * }} config
156
162
  * @returns {PlatformEcsService[]}
157
163
  */
@@ -173,6 +179,9 @@ function listPlatformEcsServices(config) {
173
179
  hosts: runtimeHostList,
174
180
  isDefault: true,
175
181
  containerPort: CONTAINER_PORT,
182
+ cpu: 512,
183
+ memoryLimitMiB: 1024,
184
+ desiredCount: 1,
176
185
  }
177
186
  }
178
187
 
@@ -190,6 +199,10 @@ function listPlatformEcsServices(config) {
190
199
  hosts: hostsFromServiceEntry(service.entry),
191
200
  isDefault: false,
192
201
  containerPort: CONTAINER_PORT,
202
+ cpu: Number.isFinite(service.entry.cpu) ? service.entry.cpu : 512,
203
+ memoryLimitMiB: Number.isFinite(service.entry.memoryLimitMiB) ? service.entry.memoryLimitMiB : 1024,
204
+ desiredCount: Number.isFinite(service.entry.desiredCount) ? service.entry.desiredCount : 1,
205
+ nodeOptions: typeof service.entry.nodeOptions === 'string' ? service.entry.nodeOptions : undefined,
193
206
  }
194
207
  })
195
208
  }
@@ -63,6 +63,16 @@ describe('containerEnvironment', () => {
63
63
  })
64
64
  })
65
65
 
66
+ it('adds NODE_OPTIONS when provided', () => {
67
+ const env = containerEnvironment({
68
+ serviceKey: 'website-ossy',
69
+ mediaRepository: 'media-bucket',
70
+ mediaCdnDomainName: 'https://cdn.example',
71
+ nodeOptions: '--max-old-space-size=3072',
72
+ })
73
+ expect(env.NODE_OPTIONS).toBe('--max-old-space-size=3072')
74
+ })
75
+
66
76
  it('requires serviceKey and media fields', () => {
67
77
  expect(() => containerEnvironment({
68
78
  mediaRepository: 'b',
@@ -82,6 +92,7 @@ describe('secretEnvKeysForEcsContainer', () => {
82
92
  'TOKEN_SECRET',
83
93
  'NODE_ENV',
84
94
  'MEDIA_REPOSITORY',
95
+ 'NODE_OPTIONS',
85
96
  'DB_URL',
86
97
  ])).toEqual(['TOKEN_SECRET', 'DB_URL'])
87
98
  })
@@ -121,6 +132,10 @@ describe('listPlatformEcsServices', () => {
121
132
  domain: 'ossy.se',
122
133
  hosts: ['ossy.se', 'api.ossy.se'],
123
134
  image: 'ghcr.io/ossy-se/website-ossy:latest',
135
+ cpu: 1024,
136
+ memoryLimitMiB: 4096,
137
+ desiredCount: 2,
138
+ nodeOptions: '--max-old-space-size=3072',
124
139
  },
125
140
  {
126
141
  name: 'ossy-website-plexus-sanitas',
@@ -153,6 +168,19 @@ describe('listPlatformEcsServices', () => {
153
168
  expect(website.hosts).toEqual(['ossy.se', 'api.ossy.se'])
154
169
  expect(website.image).toBe('ghcr.io/ossy-se/website-ossy:latest')
155
170
  expect(website.secretName).toBe('ossybot/website-ossy')
171
+ expect(website.cpu).toBe(1024)
172
+ expect(website.memoryLimitMiB).toBe(4096)
173
+ expect(website.desiredCount).toBe(2)
174
+ expect(website.nodeOptions).toBe('--max-old-space-size=3072')
175
+
176
+ const plexus = services.find(s => s.key === 'website-plexus-sanitas')
177
+ expect(plexus.cpu).toBe(512)
178
+ expect(plexus.memoryLimitMiB).toBe(1024)
179
+ expect(plexus.desiredCount).toBe(1)
180
+ expect(plexus.nodeOptions).toBeUndefined()
181
+
182
+ expect(runtime.cpu).toBe(512)
183
+ expect(runtime.desiredCount).toBe(1)
156
184
 
157
185
  expect(services.some(s => s.key.includes('api'))).toBe(false)
158
186
  })
@@ -166,8 +166,8 @@ class PlatformEcsStack extends Stack {
166
166
 
167
167
  const taskDefinition = new FargateTaskDefinition(this, `TaskDef${idSuffix}`, {
168
168
  family: `${platformName}-${service.key}`,
169
- cpu: 512,
170
- memoryLimitMiB: 1024,
169
+ cpu: service.cpu,
170
+ memoryLimitMiB: service.memoryLimitMiB,
171
171
  runtimePlatform: {
172
172
  cpuArchitecture: CpuArchitecture.X86_64,
173
173
  operatingSystemFamily: OperatingSystemFamily.LINUX,
@@ -199,6 +199,7 @@ class PlatformEcsStack extends Stack {
199
199
  containerPort: service.containerPort,
200
200
  mediaRepository: props.bucket.bucketName,
201
201
  mediaCdnDomainName: `https://${props.cdnDomainName}`,
202
+ nodeOptions: service.nodeOptions,
202
203
  }),
203
204
  secrets: containerSecrets,
204
205
  // Node fetch → GET /health (no curl in node:*-slim; no image-local script required).
@@ -222,7 +223,7 @@ class PlatformEcsStack extends Stack {
222
223
  serviceName: truncateAwsName(`${platformName}-${service.key}`, 255),
223
224
  cluster,
224
225
  taskDefinition,
225
- desiredCount: 1,
226
+ desiredCount: service.desiredCount,
226
227
  assignPublicIp: false,
227
228
  securityGroups: [serviceSecurityGroup],
228
229
  vpcSubnets: { subnetType: SubnetType.PRIVATE_WITH_EGRESS },