v1.0.0-beta.13
Intro
Performance Enhanced
In this version, we have restructured the cloud function runtime, enhancing the execution performance of cloud functions by over 400%, HTTP request QPS by more than 300% (with CPU usage savings of over 200% under the same concurrency), and Websocket long connection performance by over 500%.
New logger implementent of runtime
Additionally, we have restructured the function log implementation, now directly using Runtime Pod log streams, which supports real-time log viewing and beautification of log formats.
New billing & monitoring implement of application
We have also rewritten application resource monitoring and metered billing, enabling laf in the sealos user namespace to support resource monitoring and metered billing functions.
What's Changed
- fix(web): fix add index bug by @0fatal in #1626
- feat(web): footer add 'about us' page by @newfish-cmyk in #1622
- feat(runtime): refactor log console & enable module cache by @skyoct in #1618
- fix(web): fix upload file entry 100 items limit by @newfish-cmyk in #1629
- fix(runtime): fix DISABLE_MODULE_CACHE condition error by @maslow in #1630
- feat(web): add pods logs modal by @newfish-cmyk in #1634
- feat(server): add pod log interface by @HUAHUAI23 in #1631
- fix(web): fix inner html with LogViewer by @newfish-cmyk in #1636
- feat(runtime): beautify runtime log format by @maslow in #1637
- fix(web): log viewer line height and fontsize by @newfish-cmyk in #1639
- styles(web): fix logs date & adjust logs modal font family by @newfish-cmyk in #1641
- chore: add LOG_DEPTH conf to runtime, beautify log format by @maslow in #1642
- style(web): change log modal style by @0fatal in #1643
- style(web): change log modal style by @0fatal in #1644
- fix(web): fix wrap of log amended by @0fatal in #1645
- feat(exporter): add runtime exporter by @HUAHUAI23 in #1619
- refactor(server): get metering data of billing from prometheus by @0fatal in #1628
- refactor(server): refactor billing by @0fatal in #1648
- refactor(web): handle large header data by @newfish-cmyk in #1649
- chore(web): refactor log req/resp header by @0fatal in #1651
- chore(runtime): use gzip+base64 encode debug request header instead of uri encode by @maslow in #1652
- fix(runtime): fix interceptor main func error by @skyoct in #1638
- chore(server): handle get metering data error by @0fatal in #1650
- refactor(log-server): remove old log server by @0fatal in #1655
- chore(server): add labels to ingress resources by @maslow in #1656
- refactor(web): change old logs position by @newfish-cmyk in #1661
- fix(web): fix pages without logs by @newfish-cmyk in #1662
- fix(services): Fix metrics data caching issue by @HUAHUAI23 in #1663
- fix(services): fix runtime exporter metrics data caching issue by @HUAHUAI23 in #1664
- fix(server): fix billing miss on old app by @0fatal in #1659
- fix(server): fix billing miss on old app by @0fatal in #1666
- chore(server): enhance billing loop when app stop -> start by @0fatal in #1667
- refactor(runtime): refactor the cloud function engine by @maslow in #1668
- refactor(server): use record rules to enhance billing performance by @0fatal in #1671
- feat(web): cpu and memory monitor support "all" option by @newfish-cmyk in #1670
- fix(server): fix get metering data miss quota by @0fatal in #1673
- fix(web): fix mergeArrays function by @newfish-cmyk in #1672
- fix(web): fix padding array with front and end by @newfish-cmyk in #1675
- refactor(web): hide selection when only one pod by @newfish-cmyk in #1676
Full Changelog: v1.0.0-beta.12...v1.0.0-beta.13
Migration Guides
Update laf-server & laf-web images:
# upgrade laf SERVER
kubectl set image deployments/laf-server -n laf-system \
laf-server=docker.io/lafyun/laf-server:1.0.0-beta.13
# upgrade laf WEB
kubectl set image deployments/laf-web -n laf-system \
laf-web=docker.io/lafyun/laf-web:1.0.0-beta.13
Update sys_db.Runtime
to upgrade runtime images in MongoDb
use sys_db
// runtime version
const version = "1.0.0-beta.13"
const main_image = `docker.io/lafyun/runtime-node:${version}`
const init_image = `docker.io/lafyun/runtime-node:${version}`
db.Runtime.updateOne({ latest: true }, {
$set: {
version: version,
image: {
main: main_image,
init: init_image
}
}
})
db.Runtime.find().pretty()
Restart all Running applications by update sys_db.Application
in MongoDb
use sys_db
db.Application.updateMany({ state: 'Running' }, {
$set: {
state: 'Restarting'
}
})
Enabling Resource Monitoring
This version of Laf uses a specialized runtime exporter for runtime resource metrics collection, so you will need to install the runtime exporter into the cluster to enable resource monitoring
kubectl apply --namespace=laf-system -f - <<EOF
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
name: runtime-exporter
spec:
ports:
- name: http
port: 2342
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/name: runtime-exporter
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
name: runtime-exporter
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: runtime-exporter
template:
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
spec:
automountServiceAccountToken: true
serviceAccountName: laf-server # It's the same as the laf server's sa.
securityContext: {}
containers:
- image: docker.io/lafyun/runtime-exporter:latest
imagePullPolicy: Always
name: runtime-exporter
ports:
- name: http
containerPort: 2342
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: http
readinessProbe:
httpGet:
path: /healthz
port: http
env:
- name: API_SECRET
value: "fafafafa"
- name: NAMESPACE
value: "laf-system" # Depends on the namespace of the runtime.
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
release: prometheus
name: runtime-exporter
spec:
endpoints:
- interval: 60s
path: "/runtime/metrics/fafafafa" # fafafafa is consistent with the runtime exporter's environment variable API_SECRET
scrapeTimeout: 10s
honorLabels: true
namespaceSelector:
matchNames:
- laf-system # Depends on the namespace of the runtime exporter.
selector:
matchLabels:
app.kubernetes.io/name: runtime-exporter
---
# Application billing rules
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app.kubernetes.io/name: runtime-exporter
release: prometheus
name: prometheus-laf-billing.rules
spec:
groups:
- name: prometheus-laf-billing.rules
interval: 60s
rules:
- record: laf:billing:cpu
expr: max_over_time(sum by (appid) (laf_runtime_cpu_limit{container!=""})[1h:])
- record: laf:billing:memory
expr: max_over_time(sum by (appid) (laf_runtime_memory_limit{container!=""})[1h:])
EOF