Compare commits

..
5 Commits
Author SHA1 Message Date
b36e0516f4 Update chart version v1.17.0 (#2549)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-16 18:40:41 +05:30
121f962399 Add yaml manifest generation (#2548)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-16 18:13:46 +05:30
58f33d6f6c Add artifact and image signing (#2547)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-15 19:31:10 +05:30
61f4d4f5ad Fix dashboard template (#2546)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-15 19:17:31 +05:30
Shubham BansalandGitHub dc4c6e20e3 Add metric fission_mqt_message_lag for kafka mqt connector (#2544)
These changes have specifically been made for Kafka connector. This will expose a new metric named `fission_mqt_message_lag`, which will show a number of messages lag per topic and partition.

We can use this metric in the auto-scaling of the pod for the new deploy type executor function. While creating a new deploy function we need to add hpa metrics of external type inside the function definition.
2022-09-15 14:45:51 +05:30
9 changed files with 135 additions and 8 deletions
+20
View File
@@ -49,12 +49,32 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.12.0'
- name: Check cosign install!
run: cosign version
- name: Write cosign signing key to disk
run: 'echo "$KEY" > cosign.key'
shell: bash
env:
KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
- name: Generate yaml for manifest, Minikube and Openshift installation
run: ${GITHUB_WORKSPACE}/hack/build-yaml.sh $VERSION
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
shell: bash
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release
env:
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_CLI_EXPERIMENTAL: "enabled"
+2
View File
@@ -35,3 +35,5 @@ dist/
manifest/
.vscode/
coverage.txt
cosign.key
+26
View File
@@ -267,3 +267,29 @@ archives:
checksum:
name_template: "checksums.txt"
algorithm: sha256
# signs the checksum file
# https://goreleaser.com/customization/sign
signs:
- cmd: cosign
artifacts: all
stdin: '{{ .Env.COSIGN_PWD }}'
output: true
args:
- sign-blob
- '--key=cosign.key'
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
# signs our docker image
# https://goreleaser.com/customization/docker_sign
docker_signs:
- cmd: cosign
artifacts: all
stdin: '{{ .Env.COSIGN_PWD }}'
output: true
args:
- 'sign'
- '--key=cosign.key'
- '${artifact}'
+2 -2
View File
@@ -1,7 +1,7 @@
apiVersion: v2
name: fission-all
version: v1.17.0-rc2
appVersion: v1.17.0-rc2
version: v1.17.0
appVersion: v1.17.0
description: Fission is a fast serverless framework for Kubernetes.
home: https://fission.io/
icon: https://fission.io/images/fission-logo-white.svg
@@ -6,10 +6,10 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-%s" $.Chart.Name $filename | trunc 63 | trimSuffix "-" }}
namespace: {{ $.grafana.Namespace }}
namespace: {{ $.Values.grafana.namespace }}
labels:
grafana_dashboard: "1"
created_by: "{{ .Chart.Name }}"
created_by: "{{ $.Chart.Name }}"
data:
{{ base $path }}: '{{ $files.Get $path }}'
---
+3 -3
View File
@@ -25,7 +25,7 @@ image: fission/fission-bundle
## It is also used by the chart to identify version of the few more images apart from fission-bundle.
## Keep it empty for using latest tag.
##
imageTag: v1.17.0-rc2
imageTag: v1.17.0
## pullPolicy represents the pull policy to use for images in the chart.
##
@@ -92,7 +92,7 @@ fetcher:
## image represents the image of the fetcher component.
image: fission/fetcher
## imageTag represents the tag of the image of the fetcher component.
imageTag: v1.17.0-rc2
imageTag: v1.17.0
## Fetcher is only for to downloading or uploading archive.
## Normally, you don't need to change the value here, unless necessary.
@@ -607,7 +607,7 @@ preUpgradeChecks:
image: fission/pre-upgrade-checks
## pre-install/pre-upgrade checks image version
##
imageTag: v1.17.0-rc2
imageTag: v1.17.0
## Fission post-install/post-upgrade reporting live in this image
##
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
set -e
set -x
DIR=${GITHUB_WORKSPACE}
MANIFESTDIR=${GITHUB_WORKSPACE}/manifest
CHARTPATH=${GITHUB_WORKSPACE}/charts/fission-all
source $(realpath "${DIR}"/test/init_tools.sh)
doit() {
echo "! $*"
"$@"
}
build_yamls() {
local version=$1
mkdir -p "${MANIFESTDIR}"/yamls
releaseName=fission-$(echo "${version}" | sed 's/\./-/g')
cd $CHARTPATH
doit helm dependency update
cd $GITHUB_WORKSPACE
echo "Release name", "$releaseName"
cmdprefix="helm template ${releaseName} ${CHARTPATH} --namespace fission --validate"
# for minikube and other environments that don't support LoadBalancer
command="$cmdprefix --set analytics=false,analyticsNonHelmInstall=true,serviceType=NodePort,routerServiceType=NodePort"
echo "$command"
$command >"$MANIFESTDIR/yamls/fission-all-${version}"-minikube.yaml
# for environments that support LoadBalancer
command="$cmdprefix --set analytics=false,analyticsNonHelmInstall=true"
echo "$command"
$command >"$MANIFESTDIR/yamls/fission-all-${version}".yaml
# for OpenShift
command="$cmdprefix --set analytics=false,analyticsNonHelmInstall=true,logger.enableSecurityContext=true"
echo "$command"
$command >"$MANIFESTDIR/yamls/fission-all-${version}"-openshift.yaml
}
version=$1
if [ -z "$version" ]; then
echo "Release version not mentioned"
exit 1
fi
echo "Current version for release: $version"
build_yamls "$version"
+14 -1
View File
@@ -100,6 +100,15 @@ func (ch MqtConsumerGroupHandler) Cleanup(session sarama.ConsumerGroupSession) e
// ConsumeClaims implemented to satisfy the sarama.ConsumerGroupHandler interface
func (ch MqtConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error {
trigger := ch.trigger.Name
triggerNamespace := ch.trigger.Namespace
topic := claim.Topic()
partition := string(claim.Partition())
// initially set metrics to -1
mqtrigger.SetMessageLagCount(trigger, triggerNamespace, topic, partition, -1)
// Do not move the code below to a goroutine.
// The `ConsumeClaim` itself is called within a goroutine
for {
@@ -108,8 +117,12 @@ func (ch MqtConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSessi
if msg != nil {
ch.kafkaMsgHandler(msg)
session.MarkMessage(msg, "")
mqtrigger.IncreaseMessageCount(ch.trigger.Name, ch.trigger.Namespace)
mqtrigger.IncreaseMessageCount(trigger, triggerNamespace)
}
mqtrigger.SetMessageLagCount(trigger, triggerNamespace, topic, partition,
claim.HighWaterMarkOffset()-msg.Offset-1)
// Should return when `session.Context()` is done.
case <-session.Context().Done():
return nil
+11
View File
@@ -37,6 +37,13 @@ var (
},
labels,
)
messageLagCount = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Name: "fission_mqt_message_lag",
Help: "Total number of messages lag per topic and partition",
},
[]string{"trigger_name", "trigger_namespace", "topic", "partition"},
)
)
func IncreaseSubscriptionCount() {
@@ -50,3 +57,7 @@ func DecreaseSubscriptionCount() {
func IncreaseMessageCount(trigname, trignamespace string) {
messageCount.WithLabelValues(trigname, trignamespace).Inc()
}
func SetMessageLagCount(trigname, trignamespace, topic, partition string, lag int64) {
messageLagCount.WithLabelValues(trigname, trignamespace, topic, partition).Set(float64(lag))
}