rosetack 0.1.1 → 0.1.2
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/deploy/k8s/rosetack.yaml +107 -0
- package/dist-cli/compiler.mjs +577 -96
- package/dist-cli/edge.mjs +46 -11
- package/dist-cli/rosetack.mjs +963 -144
- package/dist-cli/runtime.mjs +94 -10
- package/dist-cli/test.mjs +610 -104
- package/package.json +1 -1
- package/src/FRAMEWORK_VERSION +1 -1
- package/src/cli/edge.ts +9 -2
- package/src/cli/index.ts +349 -41
- package/src/cli/prompt.ts +127 -0
- package/src/cli/shell.ts +59 -9
- package/src/compiler/errors.ts +74 -0
- package/src/compiler/index.ts +729 -124
- package/src/runtime/index.ts +122 -14
- package/src/types/rosetack.d.ts +9 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# The hybrid deploy on Kubernetes (consultant P0 §3 方案B) - the same split
|
|
2
|
+
# `docker-compose.yml` runs …
|
|
3
|
+
apiVersion: apps/v1
|
|
4
|
+
kind: Deployment
|
|
5
|
+
metadata:
|
|
6
|
+
name: rosetack-static
|
|
7
|
+
labels: { app: rosetack, tier: static }
|
|
8
|
+
spec:
|
|
9
|
+
replicas: 2
|
|
10
|
+
selector:
|
|
11
|
+
matchLabels: { app: rosetack, tier: static }
|
|
12
|
+
template:
|
|
13
|
+
metadata:
|
|
14
|
+
labels: { app: rosetack, tier: static }
|
|
15
|
+
annotations:
|
|
16
|
+
prometheus.io/scrape: "true"
|
|
17
|
+
prometheus.io/path: /metrics
|
|
18
|
+
prometheus.io/port: "8080"
|
|
19
|
+
spec:
|
|
20
|
+
containers:
|
|
21
|
+
- name: static
|
|
22
|
+
image: rosetack-static:latest
|
|
23
|
+
env:
|
|
24
|
+
- name: PORT
|
|
25
|
+
value: "8080"
|
|
26
|
+
- name: UPSTREAM
|
|
27
|
+
value: http://rosetack-dynamic:3000
|
|
28
|
+
ports:
|
|
29
|
+
- name: http
|
|
30
|
+
containerPort: 8080
|
|
31
|
+
readinessProbe:
|
|
32
|
+
httpGet: { path: /, port: http }
|
|
33
|
+
resources:
|
|
34
|
+
requests: { cpu: 50m, memory: 32Mi }
|
|
35
|
+
limits: { memory: 64Mi }
|
|
36
|
+
---
|
|
37
|
+
apiVersion: v1
|
|
38
|
+
kind: Service
|
|
39
|
+
metadata:
|
|
40
|
+
name: rosetack-static
|
|
41
|
+
spec:
|
|
42
|
+
selector: { app: rosetack, tier: static }
|
|
43
|
+
ports:
|
|
44
|
+
- name: http
|
|
45
|
+
port: 80
|
|
46
|
+
targetPort: http
|
|
47
|
+
---
|
|
48
|
+
apiVersion: apps/v1
|
|
49
|
+
kind: Deployment
|
|
50
|
+
metadata:
|
|
51
|
+
name: rosetack-dynamic
|
|
52
|
+
labels: { app: rosetack, tier: dynamic }
|
|
53
|
+
spec:
|
|
54
|
+
replicas: 2
|
|
55
|
+
selector:
|
|
56
|
+
matchLabels: { app: rosetack, tier: dynamic }
|
|
57
|
+
template:
|
|
58
|
+
metadata:
|
|
59
|
+
labels: { app: rosetack, tier: dynamic }
|
|
60
|
+
spec:
|
|
61
|
+
containers:
|
|
62
|
+
- name: dynamic
|
|
63
|
+
image: rosetack:latest
|
|
64
|
+
# `rosetack serve` is the production runner: the stdlib cluster (one
|
|
65
|
+
# worker per core), bounded bodies, timeouts, graceful drain.
|
|
66
|
+
command: ["rosetack", "serve"]
|
|
67
|
+
env:
|
|
68
|
+
- name: PORT
|
|
69
|
+
value: "3000"
|
|
70
|
+
ports:
|
|
71
|
+
- name: http
|
|
72
|
+
containerPort: 3000
|
|
73
|
+
readinessProbe:
|
|
74
|
+
httpGet: { path: /, port: http }
|
|
75
|
+
resources:
|
|
76
|
+
requests: { cpu: 100m, memory: 128Mi }
|
|
77
|
+
limits: { memory: 512Mi }
|
|
78
|
+
---
|
|
79
|
+
apiVersion: v1
|
|
80
|
+
kind: Service
|
|
81
|
+
metadata:
|
|
82
|
+
name: rosetack-dynamic
|
|
83
|
+
spec:
|
|
84
|
+
# ClusterIP on purpose: the dynamic half is reached through the static
|
|
85
|
+
# half's UPSTREAM proxy, never directly.
|
|
86
|
+
type: ClusterIP
|
|
87
|
+
selector: { app: rosetack, tier: dynamic }
|
|
88
|
+
ports:
|
|
89
|
+
- name: http
|
|
90
|
+
port: 3000
|
|
91
|
+
targetPort: http
|
|
92
|
+
---
|
|
93
|
+
apiVersion: networking.k8s.io/v1
|
|
94
|
+
kind: Ingress
|
|
95
|
+
metadata:
|
|
96
|
+
name: rosetack
|
|
97
|
+
spec:
|
|
98
|
+
rules:
|
|
99
|
+
- http:
|
|
100
|
+
paths:
|
|
101
|
+
- path: /
|
|
102
|
+
pathType: Prefix
|
|
103
|
+
backend:
|
|
104
|
+
service:
|
|
105
|
+
name: rosetack-static
|
|
106
|
+
port:
|
|
107
|
+
number: 80
|