@certik/skynet 0.10.30 → 0.10.33
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 +12 -0
- package/api.js +1 -1
- package/app.js +13 -4
- package/deploy.js +14 -0
- package/monitor.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.33
|
|
4
|
+
|
|
5
|
+
- Fixed api monitor error messages
|
|
6
|
+
|
|
7
|
+
## 0.10.32
|
|
8
|
+
|
|
9
|
+
- Changed deploy to add a SKYNET_DEPLOYED_AT variable to ensure new deployment would always be triggered in nomad
|
|
10
|
+
|
|
11
|
+
## 0.10.31
|
|
12
|
+
|
|
13
|
+
- `api` app bug fix
|
|
14
|
+
|
|
3
15
|
## 0.10.30
|
|
4
16
|
|
|
5
17
|
- Changed `api` app deployment to service type for rolling updates
|
package/api.js
CHANGED
|
@@ -110,7 +110,7 @@ ${getSelectorDesc(selector)}
|
|
|
110
110
|
|
|
111
111
|
const { verbose, ...selectorFlags } = cli.flags;
|
|
112
112
|
|
|
113
|
-
if (!serve.
|
|
113
|
+
if (!serve.instances || serve.instances === 1) {
|
|
114
114
|
await useLock({ name: getJobName(name, selectorFlags), ttl: 50, verbose });
|
|
115
115
|
}
|
|
116
116
|
|
package/app.js
CHANGED
|
@@ -609,13 +609,22 @@ function api({ name, routes, serve, beforeListen, env = {}, region = "us-east-1"
|
|
|
609
609
|
func: async () => {
|
|
610
610
|
const errors = [];
|
|
611
611
|
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
try {
|
|
613
|
+
const url = `http://localhost:9999${serve.prefix}/`;
|
|
614
|
+
const res = await fetch(url);
|
|
615
|
+
|
|
616
|
+
if (!res.ok) {
|
|
617
|
+
errors.push({
|
|
618
|
+
type: ERROR_LEVEL.ERROR,
|
|
619
|
+
message: `service ${name} is unhealthy`,
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
} catch (fetchErr) {
|
|
623
|
+
console.log(`error fetching ${url}`, fetchErr);
|
|
614
624
|
|
|
615
|
-
if (!res.ok) {
|
|
616
625
|
errors.push({
|
|
617
626
|
type: ERROR_LEVEL.ERROR,
|
|
618
|
-
message: `service ${name} is
|
|
627
|
+
message: `service ${name} is unhealthy`,
|
|
619
628
|
});
|
|
620
629
|
}
|
|
621
630
|
|
package/deploy.js
CHANGED
|
@@ -374,6 +374,13 @@ function createModeDeploy({
|
|
|
374
374
|
delta: { cpu: deltaCpu, mem: deltaMem },
|
|
375
375
|
};
|
|
376
376
|
|
|
377
|
+
// added an always changing env var
|
|
378
|
+
// to ensure new deployment always triggers
|
|
379
|
+
env = {
|
|
380
|
+
...env,
|
|
381
|
+
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
382
|
+
};
|
|
383
|
+
|
|
377
384
|
// by default use delta cpu/mem settings
|
|
378
385
|
const { cpu, mem } = modeResouces[mode] || modeResouces.delta;
|
|
379
386
|
|
|
@@ -554,6 +561,13 @@ function createDeploy({
|
|
|
554
561
|
cron = cmdSchedule;
|
|
555
562
|
}
|
|
556
563
|
|
|
564
|
+
// added an always changing env var
|
|
565
|
+
// to ensure new deployment always triggers
|
|
566
|
+
env = {
|
|
567
|
+
...env,
|
|
568
|
+
SKYNET_DEPLOYED_AT: new Date().toISOString(),
|
|
569
|
+
};
|
|
570
|
+
|
|
557
571
|
const nomadJobDefinition = genConfig({
|
|
558
572
|
jobName,
|
|
559
573
|
cron: INTERVAL_ALIASES[cron] || cron,
|
package/monitor.js
CHANGED