@certik/skynet 0.16.3 → 0.16.5
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 +11 -3
- package/deploy.js +3 -15
- package/dynamodb.js +24 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.16.5
|
|
4
|
+
|
|
5
|
+
- Updated: dynamodb translate config
|
|
6
|
+
|
|
7
|
+
## 0.16.4
|
|
8
|
+
|
|
9
|
+
- Updated: nomad job spec
|
|
10
|
+
|
|
3
11
|
## 0.16.3
|
|
4
12
|
|
|
5
|
-
- Removed log-shipper job
|
|
13
|
+
- Removed: log-shipper job
|
|
6
14
|
|
|
7
15
|
## 0.16.2
|
|
8
16
|
|
|
9
|
-
- Doubled log-shipper cpu and memory
|
|
17
|
+
- Updated: Doubled log-shipper cpu and memory
|
|
10
18
|
|
|
11
19
|
## 0.16.1
|
|
12
20
|
|
|
13
|
-
- Removed verbose log from exponentialRetry (@certik/skynet/availablity)
|
|
21
|
+
- Removed: verbose log from exponentialRetry (@certik/skynet/availablity)
|
|
14
22
|
|
|
15
23
|
## 0.16.0
|
|
16
24
|
|
package/deploy.js
CHANGED
|
@@ -67,7 +67,7 @@ const genConfig = ({
|
|
|
67
67
|
cron
|
|
68
68
|
? `# Triggers periodically
|
|
69
69
|
periodic {
|
|
70
|
-
|
|
70
|
+
crons = ["${cron}"]
|
|
71
71
|
prohibit_overlap = true
|
|
72
72
|
}`
|
|
73
73
|
: ""
|
|
@@ -156,8 +156,10 @@ EOH
|
|
|
156
156
|
|
|
157
157
|
# It is possible to set environment variables which will be
|
|
158
158
|
# available to the task when it runs.
|
|
159
|
+
# always update environment so that new deployment always triggers
|
|
159
160
|
env {
|
|
160
161
|
SKYNET_ENVIRONMENT="${isProduction ? "prd" : "dev"}"
|
|
162
|
+
SKYNET_DEPLOYED_AT="${new Date().toISOString()}"
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
kill_timeout = "${killTimeout || "60s"}"
|
|
@@ -358,13 +360,6 @@ function createModeDeploy({
|
|
|
358
360
|
delta: { cpu: deltaCpu, mem: deltaMem, killTimeout: deltaKillTimeout },
|
|
359
361
|
};
|
|
360
362
|
|
|
361
|
-
// added an always changing env var
|
|
362
|
-
// to ensure new deployment always triggers
|
|
363
|
-
env = {
|
|
364
|
-
...env,
|
|
365
|
-
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
366
|
-
};
|
|
367
|
-
|
|
368
363
|
// by default use delta cpu/mem settings
|
|
369
364
|
const { cpu, mem, killTimeout } = modeResouces[mode] || modeResouces.delta;
|
|
370
365
|
|
|
@@ -549,13 +544,6 @@ function createDeploy({
|
|
|
549
544
|
cron = cmdSchedule;
|
|
550
545
|
}
|
|
551
546
|
|
|
552
|
-
// added an always changing env var
|
|
553
|
-
// to ensure new deployment always triggers
|
|
554
|
-
env = {
|
|
555
|
-
...env,
|
|
556
|
-
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
557
|
-
};
|
|
558
|
-
|
|
559
547
|
const nomadJobDefinition = genConfig({
|
|
560
548
|
jobName,
|
|
561
549
|
cron: INTERVAL_ALIASES[cron] || cron,
|
package/dynamodb.js
CHANGED
|
@@ -24,8 +24,25 @@ function getDynamoDB(forceNew = false) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function getDocClient(forceNew = false) {
|
|
27
|
+
const marshallOptions = {
|
|
28
|
+
// Whether to automatically convert empty strings, blobs, and sets to `null`.
|
|
29
|
+
convertEmptyValues: true,
|
|
30
|
+
// Whether to remove undefined values while marshalling.
|
|
31
|
+
removeUndefinedValues: true,
|
|
32
|
+
// Whether to convert typeof object to map attribute.
|
|
33
|
+
convertClassInstanceToMap: true,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const unmarshallOptions = {
|
|
37
|
+
// Whether to return numbers as a string instead of converting them to native JavaScript numbers.
|
|
38
|
+
wrapNumbers: false, // false, by default.
|
|
39
|
+
};
|
|
40
|
+
|
|
27
41
|
if (!_docClient || forceNew) {
|
|
28
|
-
_docClient = DynamoDBDocumentClient.from(getDynamoDB()
|
|
42
|
+
_docClient = DynamoDBDocumentClient.from(getDynamoDB(), {
|
|
43
|
+
marshallOptions,
|
|
44
|
+
unmarshallOptions,
|
|
45
|
+
});
|
|
29
46
|
}
|
|
30
47
|
return _docClient;
|
|
31
48
|
}
|
|
@@ -161,10 +178,12 @@ async function readRecord(tableName, key, verbose = false) {
|
|
|
161
178
|
|
|
162
179
|
const docClient = getDocClient();
|
|
163
180
|
|
|
164
|
-
const record = await docClient.send(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
181
|
+
const record = await docClient.send(
|
|
182
|
+
new GetCommand({
|
|
183
|
+
TableName: tableName,
|
|
184
|
+
Key: key,
|
|
185
|
+
}),
|
|
186
|
+
);
|
|
168
187
|
|
|
169
188
|
return record.Item;
|
|
170
189
|
}
|