Compare commits

...
42 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
12d323e32f Update chart and app version (#2542)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-13 15:05:03 +05:30
2882e0d3e7 allow two HTTP triggers with no URLs and different prefix (#2540)
* allow two HTTP triggers with no URL and different prefix
* update dependency
* Fix controller existing tests
* Ensure namespace cleanup in API test
* update test cases
* handle error conditions in test

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-13 13:30:00 +05:30
79b41ec070 Add servicemonitor additional labels and podmonitor (#2541)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-12 20:25:17 +05:30
05130949ad Add grafana dashboards and configmap creation for auto provisioning (#2519)
* Add grafana dashboards and configmap creation
* Fix Data source, job and template rules
* Add units to all panels
* fix units and fix linting issues
* Enable verbose linting for dashboards

Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-12 17:10:07 +05:30
Sanket SudakeandGitHub dea7b2be94 Generate fission code using code-generator from upstream 1.25 release (#2534)
* Generate fission code using code-generator from upstream 1.25 release
* Update sigs.k8s.io/controller-runtime v0.13.0

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-07 10:15:29 +05:30
Sanket SudakeandGitHub 294ff5bb19 Optimize Github action workflows for Go version identification (#2533)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-06 17:30:21 +05:30
7dad7c8399 Ensure newdeploy function pod restart on referred configmap update (#2528)
Configmap inside pods for newdeploy and pool manager executor type were not being updated if the user update the configmap.
This fix will help to update the pods for both executor type with new configmap. As per the changes if there is any configmap update then pods will get restarted for both executor type and then it will refer new configmap.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-06 16:12:55 +05:30
e0c09ce340 Fix dashboard linting workflow (#2530)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-02 14:08:48 +05:30
e4751d54cb Add dashboard linting workflow (#2529)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-09-02 13:40:49 +05:30
ed6f4ea375 Dump labels and annotations for function via getmeta cli (#2525)
Co-authored-by: Nemanja Miletic <nmiletic@paloaltonetworks.com>
2022-08-31 12:51:11 +05:30
Sanket SudakeandGitHub fef2d8f875 Propogate context for prometheus queries via canaryconfig ops (#2527)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-31 12:03:00 +05:30
Sanket SudakeandGitHub 6971bcd287 Update Go version 1.19 (#2523)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-30 11:40:01 +05:30
neha_guptaandGitHub b16010dfa3 add values for nats jetstream keda connector (#2515)
* add values for jetstream connector

* formatte fission cli

* Update jetstream connector version
2022-08-29 10:45:18 +05:30
Andrey DudinandGitHub 9016b6d28c Correct error message in otel propagators test (#2522) 2022-08-26 11:43:37 +05:30
Andrey DudinandGitHub ce887f360a Fix fission version command in issue template (#2521) 2022-08-26 11:41:40 +05:30
Andrey DudinandGitHub 8238916340 Add endPoint property example (#2518) 2022-08-24 21:55:38 +05:30
Sanket SudakeandGitHub b1f8ad8dca Remove usused files and refactor crd ref docs generation (#2516)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-22 16:38:28 +05:30
Sanket SudakeandGitHub dca306d87f Change default branch to main across repository (#2514)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-22 14:57:00 +05:30
Sanket SudakeandGitHub 3b4211b581 Update go dependencies to latest and actions used in workflows (#2510)
* Updated all Go language dependencies to latest version available
* Formatted all files as per gofmt
* Update Golangci-lint version to 1.48.0
* Updated action version wherer application in Github workflows
* Updated Kubernetes version to latest available
* Remove "io/ioutil" references and replace with "io"/"os"

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-19 13:36:37 +05:30
5c4121ca1e Remove CRD generation from release workflow (#2513)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-08-18 16:26:48 +05:30
a3fde534e2 Add Github actions release CI (#2505)
Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
2022-08-18 16:08:39 +05:30
neha_guptaandGitHub 63c1c25fda Update keda connector versions (#2512)
- kafka: v0.11
- rabbitmq: v0.10
- awskinesis: v0.10
- aws_sqs: v0.10
- nats_steaming: v0.12
- gcp_pubsub: v0.5
- redis: v0.3
2022-08-18 14:00:01 +05:30
Sanket SudakeandGitHub d32e09aaf9 Update go-restful libraries (#2509)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-09 16:09:40 +05:30
Sanket SudakeandGitHub 1184864c14 Reestablish kakfa consumer group session on disconnection (#2504)
* Reestablish kakfa consumer group session on disconnection
* Add wait for the consumer
* Ignore empty message
* Update github.com/Shopify/sarama to v1.35.0

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-09 11:06:19 +05:30
Sanket SudakeandGitHub 9343eb9911 Use sig.k8s.io/yaml instead of ghodss/yaml (#2506)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-05 16:09:34 +05:30
Sanket SudakeandGitHub 3ecf21a6f1 Update kubernetes and opentelemetry dependencies (#2507)
* Update kubernetes libs to v0.24.3
* Update opentelemtry libraries

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-05 15:14:42 +05:30
Shubham BansalandGitHub 904413db6d Capture previous command exit code in integration tests cleanup (#2503)
* show previous response code

* log previous response code of shell script command
2022-08-04 10:16:05 +05:30
Shubham BansalandGitHub 3c8edab514 removed unused reference of TRACING_SAMPLING_RATE (#2498) 2022-07-27 14:30:30 +05:30
Sanket SudakeandGitHub 5c886e4cf4 Upgrade Opentelemetry Libraries and adopt enhancements (#2484)
1. Use websocket support introduced in Openetelemetry Librarries
2. Use propagators settings introduced in Opentelemetry Go SDK
3. Use samplers settings introduced in Openetelemetry Go SDK

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-07-20 11:13:12 +05:30
Pranoy Kumar KunduandGitHub dba9143f45 Prevent creating function of executor type container via fn create command (#2486) 2022-07-19 15:26:12 +05:30
Shubham BansalandGitHub 1abe4dadb7 fix to change value of BuildStatus from Pending to pending (#2489) 2022-07-19 13:29:36 +05:30
Shubham BansalandGitHub 9cedeb4fa6 Generate package within 63 character limit when creating function (#2482) 2022-07-13 10:19:45 +05:30
Sanket SudakeandGitHub 899e6e96d6 cleanup: Remove Opentracing support as no active users (#2196)
References:
[1] #2193
[2] https://fissionio.slack.com/archives/C3LUX6BBP/p1631706812069300

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-07-12 14:52:17 +05:30
Ankit ChawlaandGitHub 7838debadf Added fix to retrieve correct s3 urls (#2465)
* Added fix to retrieve correct s3 urls

* Fixes to S3 url

* Squashing commits

* Fixing if conditions for storagetype in geturl
2022-07-12 11:56:25 +05:30
Shubham BansalandGitHub db13455a7b Upgrade alpine version from 3.15 to 3.16 (#2480) 2022-07-11 16:06:53 +05:30
Shubham BansalandGitHub 5838340594 Increase time for port forwarding exponentially in fission CLI (#2468) 2022-07-07 15:36:36 +05:30
Sanket SudakeandGitHub 655456ee03 Update changelog for 1.17.0-rc1 (#2471)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-07-06 15:55:10 +05:30
199 changed files with 6176 additions and 3740 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ assignees: ''
<!-- If you tested with other services, for example Istio, please also provide the version of service as well. -->
<pre>
$ fission --version
$ fission version
$ kubectl version
</pre>
+9 -10
View File
@@ -3,14 +3,14 @@ name: Code Scanning
on:
push:
branches:
- master
- main
paths:
- '**.go'
- go.mod
- go.sum
pull_request:
branches:
- master
- main
paths:
- '**.go'
- go.mod
@@ -25,19 +25,18 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: actions/cache@v2
- name: setup go
uses: actions/setup-go@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: "go.mod"
cache: true
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
+35
View File
@@ -0,0 +1,35 @@
name: Lint dashboards
on:
push:
branches:
- main
paths:
- 'charts/fission-all/dashboards/**.json'
pull_request:
branches:
- main
paths:
- 'charts/fission-all/dashboards/**.json'
workflow_dispatch:
jobs:
lint-dashboards:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18.5
- name: Install dashboard linter
run: |
go get github.com/grafana/dashboard-linter
go install github.com/grafana/dashboard-linter
- name: Run dashboard linter
run: ./hack/lint-dashboards.sh
+27 -37
View File
@@ -3,69 +3,59 @@ name: Lint and Unit tests
on:
push:
branches:
- master
- main
paths:
- '**.go'
- "**.go"
- go.mod
- go.sum
pull_request:
branches:
- master
- main
paths:
- '**.go'
- "**.go"
- go.mod
- go.sum
workflow_dispatch:
env:
GOLANGCI_LINT_VERSION: v1.49.0
GOLANGCI_LINT_TIMEOUT: 5m
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18.1
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: actions/cache@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version-file: "go.mod"
cache: true
- name: Verify dependencies
run: |
go mod verify
go mod download
LINT_VERSION=1.45.0
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
tar xz --strip-components 1 --wildcards \*/golangci-lint
mkdir -p bin && mv golangci-lint bin/
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
- name: Run checks
- name: Detect git changes
if: always()
run: |
STATUS=0
assert-nothing-changed() {
local diff
"$@" >/dev/null || return 1
if ! diff="$(git diff -U1 --color --exit-code)"; then
printf '\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n\n' "$*" "$diff" >&2
git checkout -- .
STATUS=1
fi
}
assert-nothing-changed go fmt ./...
assert-nothing-changed go mod tidy
bin/golangci-lint run --out-format=github-actions --timeout=5m || STATUS=$?
exit $STATUS
if [[ $(git diff --stat) != '' ]]; then
echo -e '❌ \033[0;31m. Fix lint changes.\033[0m'
git diff --color
exit 1
else
echo '✔ No issues detected. Have a nice day :-)'
fi
- name: Run unit tests
run: ./hack/runtests.sh
+17 -19
View File
@@ -3,7 +3,7 @@ name: Fission CI
on:
push:
branches:
- master
- main
paths:
- "**.go"
- "charts/**"
@@ -12,7 +12,7 @@ on:
- go.sum
pull_request:
branches:
- master
- main
paths:
- "**.go"
- "charts/**"
@@ -21,6 +21,10 @@ on:
- go.sum
workflow_dispatch:
env:
HELM_VERSION: v3.9.0
KIND_VERSION: v0.14.0
jobs:
# Job to run change detection
integration-test:
@@ -28,40 +32,34 @@ jobs:
strategy:
fail-fast: false
matrix:
kindversion: ["v1.19.11", "v1.20.7", "v1.21.1"]
kindversion: ["v1.19.16", "v1.20.15", "v1.21.12"]
os: [ubuntu-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: setup go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18.1
go-version-file: "go.mod"
cache: true
- name: Checkout sources
uses: actions/checkout@v2.3.4
- name: Checkout sources
uses: actions/checkout@v2.3.4
uses: actions/checkout@v3
with:
repository: fission/examples
path: examples
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Helm installation
uses: Azure/setup-helm@v1
uses: Azure/setup-helm@v3
with:
version: v3.3.4
version: ${{ env.HELM_VERSION }}
- name: Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: kindest/node:${{ matrix.kindversion }}
version: v0.11.1
version: ${{ env.KIND_VERSION }}
config: kind.yaml
- name: Configuring and testing the Installation
+82
View File
@@ -0,0 +1,82 @@
name: Create Draft release
on:
push:
tags:
- v1.**
- v2.**
env:
KIND_VERSION: v0.14.0
KIND_NODE_IMAGE_TAG: v1.19.16
jobs:
create-draft-release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
install-only: true
- name: Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: kindest/node:${{ env.KIND_NODE_IMAGE_TAG }}
version: ${{ env.KIND_VERSION }}
config: kind.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Docker Login
uses: docker/login-action@v2
with:
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"
#ToDo - Verify and upload releases
+67 -69
View File
@@ -3,100 +3,98 @@ name: Fission CI upgrade
on:
push:
branches:
- master
- main
paths:
- '**.go'
- 'charts/**'
- 'test/**'
- "**.go"
- "charts/**"
- "test/**"
- go.mod
- go.sum
pull_request:
branches:
- master
- main
paths:
- '**.go'
- 'charts/**'
- 'test/**'
- "**.go"
- "charts/**"
- "test/**"
- go.mod
- go.sum
workflow_dispatch:
env:
HELM_VERSION: v3.9.0
KIND_VERSION: v0.14.0
jobs:
upgrade-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
kindimage : [ 'kindest/node:v1.19.11' ]
os: [ ubuntu-latest ]
kindimage: ["kindest/node:v1.19.16"]
os: [ubuntu-latest]
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.18.1
- name: Checkout action sources
uses: actions/checkout@v3
- name: Checkout action sources
uses: actions/checkout@v2.3.4
- name: Setup go
uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
cache: true
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Helm
uses: Azure/setup-helm@v3
with:
version: ${{ env.HELM_VERSION }}
- name: Setup Helm
uses: Azure/setup-helm@v1
with:
version: v3.3.4
- name: Setup Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: ${{ matrix.kindimage }}
version: ${{ env.KIND_VERSION }}
- name: Setup Kind Clutser
uses: engineerd/setup-kind@v0.5.0
with:
image: ${{ matrix.kindimage }}
version: v0.11.1
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
install-only: true
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
install-only: true
- name: Setup kubectl & fetch node information
run: |
kubectl cluster-info --context kind-kind
kubectl get nodes
kubectl get storageclasses.storage.k8s.io
- name: Setup kubectl & fetch node information
run: |
kubectl cluster-info --context kind-kind
kubectl get nodes
kubectl get storageclasses.storage.k8s.io
- name: Dump system info
run: |
source ./test/upgrade_test/fission_objects.sh dump_system_info
- name: Dump system info
run: |
source ./test/upgrade_test/fission_objects.sh dump_system_info
- name: Install and configure previous stable fission
run: |
source ./test/upgrade_test/fission_objects.sh install_stable_release \
&& create_fission_objects \
&& test_fission_objects
- name: Install and configure previous stable fission
run: |
source ./test/upgrade_test/fission_objects.sh install_stable_release \
&& create_fission_objects \
&& test_fission_objects
- name: Upgrade fission to latest
run: |
source ./test/upgrade_test/fission_objects.sh build_docker_images \
&& kind_image_load \
&& install_current_release \
&& install_fission_cli
- name: Upgrade fission to latest
run: |
source ./test/upgrade_test/fission_objects.sh build_docker_images \
&& kind_image_load \
&& install_current_release \
&& install_fission_cli
- name: Test previously created fission objects with new release
run: |
source ./test/upgrade_test/fission_objects.sh test_fission_objects
- name: Test previously created fission objects with new release
run: |
source ./test/upgrade_test/fission_objects.sh test_fission_objects
- name: Collect Fission Dump
if: ${{ always() }}
run: |
command -v fission && fission support dump
- name: Collect Fission Dump
if: ${{ always() }}
run: |
command -v fission && fission support dump
- name: Archive fission dump
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: fission-dump
path: fission-dump/*.zip
retention-days: 5
- name: Archive fission dump
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: fission-dump
path: fission-dump/*.zip
retention-days: 5
+4
View File
@@ -33,3 +33,7 @@ local/
build/
dist/
manifest/
.vscode/
coverage.txt
cosign.key
-4
View File
@@ -1,16 +1,13 @@
linters:
enable:
# Default linter
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
# Additional linters
- gofmt
- goimports
@@ -22,7 +19,6 @@ linters:
# - dogsled
# - dupl
# - gosec
# - ifshort
# - nilerr
# - prealloc
# - revive
+29 -4
View File
@@ -8,7 +8,6 @@ release:
header: |
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
Install Guide: https://fission.io/docs/installation/
Full Changelog: https://github.com/fission/fission/blob/master/CHANGELOG.md
extra_files:
- glob: ./manifest/charts/*
- glob: ./manifest/yamls/*
@@ -27,9 +26,9 @@ builds:
- -X github.com/fission/fission/pkg/info.BuildDate={{.Date}}
- -X github.com/fission/fission/pkg/info.Version={{.Tag}}
gcflags:
- all=-trimpath={{.Env.PWD}}
- all=-trimpath={{ if index .Env "GITHUB_WORKSPACE"}}{{ .Env.GITHUB_WORKSPACE }}{{ else }}{{ .Env.PWD }}{{ end }}
asmflags:
- all=-trimpath={{.Env.PWD}}
- all=-trimpath={{ if index .Env "GITHUB_WORKSPACE"}}{{ .Env.GITHUB_WORKSPACE }}{{ else }}{{ .Env.PWD }}{{ end }}
env:
- CGO_ENABLED=0
goos:
@@ -258,7 +257,7 @@ docker_manifests:
- fission/reporter:latest-arm64
- fission/reporter:latest-armv7
changelog:
skip: true
skip: false
archives:
- id: fission
builds:
@@ -268,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}'
+1 -1
View File
@@ -1,7 +1,7 @@
pull_request_rules:
- name: Automatic merge on approval
conditions:
- base=master
- base=main
- "#approved-reviews-by>=1"
- label=ready-to-merge
- label!=hold-off-merging
+22
View File
@@ -1,5 +1,27 @@
# Changelog
## [v1.17.0-rc1](https://github.com/fission/fission/tree/v1.17.0-rc1) (2022-07-06)
[Full Changelog](https://github.com/fission/fission/compare/v1.16.0...v1.17.0-rc1)
**Merged pull requests:**
- Update controller-tools to v0.9.2 [\#2467](https://github.com/fission/fission/pull/2467) ([sanketsudake](https://github.com/sanketsudake))
- OpenTelemetry package update to v1.7.0 [\#2466](https://github.com/fission/fission/pull/2466) ([shubham-bansal96](https://github.com/shubham-bansal96))
- Added support to set builder and fn pod specs via helm chart [\#2461](https://github.com/fission/fission/pull/2461) ([blackfly19](https://github.com/blackfly19))
- Pods immediately terminate for idletimeout in new deployment and container executer type [\#2459](https://github.com/fission/fission/pull/2459) ([shubham-bansal96](https://github.com/shubham-bansal96))
- Added variable to enable or disable archivePruner [\#2458](https://github.com/fission/fission/pull/2458) ([blackfly19](https://github.com/blackfly19))
- Avoid fission installation failure due to analytics connection error [\#2457](https://github.com/fission/fission/pull/2457) ([shubham-bansal96](https://github.com/shubham-bansal96))
- Fix for archivepruner to delete files only from subdir [\#2456](https://github.com/fission/fission/pull/2456) ([blackfly19](https://github.com/blackfly19))
- Upgraded controller-gen to remove status from fission CRDs [\#2454](https://github.com/fission/fission/pull/2454) ([sanketsudake](https://github.com/sanketsudake))
- builder: Allow command with arguments via custom build options [\#2453](https://github.com/fission/fission/pull/2453) ([shubham-bansal96](https://github.com/shubham-bansal96))
- CLI to operate archives managed by Storage Service [\#2450](https://github.com/fission/fission/pull/2450) ([blackfly19](https://github.com/blackfly19))
- \[issue-2401\] Added pod security context for Fission Components [\#2449](https://github.com/fission/fission/pull/2449) ([baba230896](https://github.com/baba230896))
- Update github.com/opencontainers/runc dependency to 1.1.2 [\#2448](https://github.com/fission/fission/pull/2448) ([blackfly19](https://github.com/blackfly19))
- Fixed help for ColdStarts metric in executor according to new labels [\#2446](https://github.com/fission/fission/pull/2446) ([blackfly19](https://github.com/blackfly19))
- Ensure poolmanager fn address validation even if pod has active connections [\#2441](https://github.com/fission/fission/pull/2441) ([blackfly19](https://github.com/blackfly19))
- Fix pre-check failure during new fission installation [\#2437](https://github.com/fission/fission/pull/2437) ([shubham4443](https://github.com/shubham4443))
## [v1.16.0](https://github.com/fission/fission/tree/v1.16.0) (2022-05-24)
[Full Changelog](https://github.com/fission/fission/compare/v1.16.0-rc2...v1.16.0)
+5 -4
View File
@@ -42,9 +42,7 @@ debug-vars: print-GOOS print-GOARCH print-GOAMD64 print-VERSION print-TIMESTAMP
check: test-run build-fission-cli clean
code-checks:
hack/verify-gofmt.sh
hack/verify-govet.sh
hack/verify-staticcheck.sh
golangci-lint run
# run basic check scripts
test-run: code-checks
@@ -92,7 +90,10 @@ generate-swagger-doc:
generate-cli-docs:
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
generate-crd-ref-docs:
install-crd-ref-docs:
go install github.com/elastic/crd-ref-docs@master
generate-crd-ref-docs: install-crd-ref-docs
# crd-ref-docs: https://github.com/elastic/crd-ref-docs
crd-ref-docs --source-path=pkg/apis/core/v1 --config=tools/crd-ref-docs/config.yaml --renderer markdown
cp tools/crd-ref-docs/header.md crd_docs.md
+2 -2
View File
@@ -5,7 +5,7 @@
</p>
<p align="center">
<a href="https://github.com/fission/fission/blob/master/LICENSE">
<a href="https://github.com/fission/fission/blob/main/LICENSE">
<img alt="Fission Licence" src="https://img.shields.io/github/license/fission/fission">
</a>
<a href="https://github.com/fission/fission/releases">
@@ -20,7 +20,7 @@
<a href="https://github.com/fission/fission/graphs/contributors">
<img alt="Fission contributors" src="https://img.shields.io/github/contributors/fission/fission">
</a>
<a href="https://github.com/fission/fission/commits/master">
<a href="https://github.com/fission/fission/commits/main">
<img alt="Commit Activity" src="https://img.shields.io/github/commit-activity/m/fission/fission">
</a>
<br>
+2 -2
View File
@@ -1,7 +1,7 @@
apiVersion: v2
name: fission-all
version: v1.17.0-rc1
appVersion: v1.17.0-rc1
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
+13
View File
@@ -0,0 +1,13 @@
exclusions:
template-job-rule:
reason: "Most panels dont need to be filtered by job"
template-instance-rule:
reason: "Most panels dont need to be filtered by instance"
target-job-rule:
reason: "Most panels dont need to be filtered by job"
target-instance-rule:
reason: "Most panels dont need to be filtered by instance"
panel-units-rule:
reason: "Some panels are using the 'number' unit which throws a linting error."
target-counter-agg-rule:
reason: "disabled for fission_archives_total. This metric should be not have total due to naming conventions as its a gauge, not a counter"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,648 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Shows function calls, namespaces and their response codes.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "increase(fission_function_calls_total{function_name=~\"$Function_Name\",function_namespace=~\"$Function_Namespace\"}[1m])",
"interval": "",
"legendFormat": "Namespace:{{function_namespace}} Func:{{function_name}} {{method}} Response: {{code}} ",
"range": true,
"refId": "A"
}
],
"title": "Function calls",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Shows any functions that return 400 or 500 errors.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "reqps"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "increase(fission_function_errors_total{function_name=~\"$Function_Name\",function_namespace=~\"$Function_Namespace\"}[1m])",
"legendFormat": "Namespace:{{function_namespace}} Function:{{function_name}} Response:{{code}} ",
"range": true,
"refId": "A"
}
],
"title": "Function Errors",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Tracks cold starts of all functions.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"id": 4,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "increase(fission_function_cold_starts_total{function_name=~\"$Function_Name\",function_namespace=~\"$Function_Namespace\"}[1m])",
"legendFormat": "{{function_name}}",
"range": true,
"refId": "A"
}
],
"title": "Function cold starts",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 16
},
"id": 12,
"panels": [],
"title": "Http Requests",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Shows the number of requests currently in flight per function path",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 17
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "http_requests_in_flight{path=~\"$Path\"}",
"legendFormat": "{{path}}",
"range": true,
"refId": "A"
}
],
"title": "Http Requests in Flight (function)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Shows the average latency for each path.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 17
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"editorMode": "code",
"expr": "http_requests_duration_seconds_sum{path!=\"/healthz\",path!~\"/v2/.*\",path!~\"/router.*\",path=~\"$Path\"}/http_requests_duration_seconds_count{path=~\"$Path\"}",
"legendFormat": "{{path}}",
"range": true,
"refId": "A"
}
],
"title": "Request latency",
"type": "timeseries"
}
],
"schemaVersion": 36,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "Prometheus",
"value": "Prometheus"
},
"hide": 0,
"includeAll": false,
"label": "Data Source",
"multi": false,
"name": "datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"allValue": ".*",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(fission_function_calls_total, function_name)",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "Function_Name",
"options": [],
"query": {
"query": "label_values(fission_function_calls_total, function_name)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": ".*",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(http_requests_total, path)",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "Path",
"options": [],
"query": {
"query": "label_values(http_requests_total, path)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"allValue": ".*",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(kube_namespace_labels, namespace)",
"description": "",
"hide": 0,
"includeAll": true,
"multi": false,
"name": "Function_Namespace",
"options": [],
"query": {
"query": "label_values(kube_namespace_labels, namespace)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {
"selected": false,
"text": "fission",
"value": "fission"
},
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"definition": "label_values(fission_function_calls_total, namespace)",
"hide": 0,
"includeAll": false,
"multi": false,
"name": "Fission_Namespace",
"options": [],
"query": {
"query": "label_values(fission_function_calls_total, namespace)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Fission User Dashboard",
"uid": "he2w3Xq7z",
"version": 3,
"weekStart": ""
}
@@ -71,12 +71,3 @@ This template generates the image name for the deployment depending on the value
- name: OTEL_PROPAGATORS
value: "{{ .Values.openTelemetry.propagators }}"
{{- end }}
{{- define "opentracing.envs" }}
- name: OPENTRACING_ENABLED
value: {{ .Values.openTracing.enabled | default false | quote }}
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
value: "{{ .Values.openTracing.collectorEndpoint }}"
- name: TRACING_SAMPLING_RATE
value: {{ .Values.openTracing.samplingRate | default "0.5" | quote }}
{{- end }}
@@ -55,7 +55,6 @@ spec:
value: {{ .Values.pprof.enabled | quote }}
- name: HELM_RELEASE_NAME
value: {{ .Release.Name | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
ports:
- containerPort: 8080
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: buildermgr-monitor
{{- if .Values.podMonitor.namespace }}
namespace: {{ .Values.podMonitor.namespace }}
{{- end }}
{{- with .Values.podMonitor.additionalPodMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
svc: buildermgr
podMetricsEndpoints:
- port: "metrics"
path: "/metrics"
{{- end -}}
@@ -42,7 +42,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.controller.resources | nindent 10 }}
@@ -6,6 +6,10 @@ metadata:
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
@@ -0,0 +1,17 @@
{{- if .Values.grafana.dashboards.enable }}
{{- $files := .Files }}
{{- range $path, $bytes := .Files.Glob "dashboards/*.json" }}
{{- $filename := trimSuffix (ext $path) (base $path) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-%s" $.Chart.Name $filename | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Values.grafana.namespace }}
labels:
grafana_dashboard: "1"
created_by: "{{ $.Chart.Name }}"
data:
{{ base $path }}: '{{ $files.Get $path }}'
---
{{- end }}
{{- end }}
@@ -59,7 +59,6 @@ spec:
value: {{ .Values.pprof.enabled | quote }}
- name: HELM_RELEASE_NAME
value: {{ .Release.Name | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.executor.resources | nindent 10 }}
@@ -6,6 +6,10 @@ metadata:
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
@@ -118,8 +118,6 @@ spec:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OPENTRACING_ENABLED
value: {{ .Values.openTracing.enabled | default false | quote }}
command: ["/fission-bundle"]
args: ["--logger"]
volumeMounts:
@@ -161,8 +159,6 @@ spec:
key: password
- name: LOG_PATH
value: /var/log/fission/*.log
- name: OPENTRACING_ENABLED
value: {{ .Values.openTracing.enabled | default false | quote }}
{{- if .Values.logger.enableSecurityContext }}
securityContext:
privileged: true
@@ -29,7 +29,6 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
@@ -33,6 +33,9 @@ spec:
imagePullPolicy: {{ .Values.pullPolicy }}
command: ["/fission-bundle"]
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
ports:
- containerPort: 8080
name: metrics
env:
- name: MESSAGE_QUEUE_TYPE
value: kafka
@@ -44,7 +47,6 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
# TLS authentication is TLS with authentication (2 way)
# More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview
@@ -0,0 +1,23 @@
{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: mqt-fission-kafka-monitor
{{- if .Values.podMonitor.namespace }}
namespace: {{ .Values.podMonitor.namespace }}
{{- end }}
{{- with .Values.podMonitor.additionalPodMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
svc: mqtrigger
podMetricsEndpoints:
- port: "metrics"
path: "/metrics"
{{- end -}}
@@ -40,11 +40,12 @@ spec:
value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}"
- name: STAN_IMAGE
value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}"
- name: NATS-JETSTREAM_IMAGE
value: "{{ .Values.mqt_keda.connector_images.nats_jetstream.image }}:{{ .Values.mqt_keda.connector_images.nats_jetstream.tag }}"
- name: GCP-PUBSUB_IMAGE
value: "{{ .Values.mqt_keda.connector_images.gcp_pubsub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pubsub.tag }}"
- name: REDIS_IMAGE
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
@@ -83,7 +83,6 @@ spec:
value: {{ .Values.pprof.enabled | quote }}
- name: DISPLAY_ACCESS_LOG
value: {{ .Values.router.displayAccessLog | default false | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.router.resources | nindent 10 }}
@@ -6,6 +6,10 @@ metadata:
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
@@ -60,7 +60,6 @@ spec:
- name: STORAGE_S3_REGION
value: {{ .Values.persistence.s3.region }}
{{- end }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
@@ -5,7 +5,11 @@ metadata:
name: storagesvc-monitor
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
{{- end }}
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
matchNames:
@@ -29,7 +29,6 @@ spec:
value: {{ .Values.debugEnv | quote }}
- name: PPROF_ENABLED
value: {{ .Values.pprof.enabled | quote }}
{{- include "opentracing.envs" . | indent 8 }}
{{- include "opentelemtry.envs" . | indent 8 }}
resources:
{{- toYaml .Values.timer.resources | nindent 10 }}
+50 -28
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-rc1
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-rc1
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.
@@ -452,11 +452,33 @@ kafka:
##
# version: "0.11.2.0"
# The following components expose Prometheus metrics and have servicemonitors in this chart (disabled by default)
# Controller, router, executor, storage svc
serviceMonitor:
enabled: false
##namespace in which you want to deploy servicemonitor
##
namespace: ""
## Map of additional lables to add to the ServiceMonitor resources
# to allow selecting sepcific ServiceMonitors
# in case of multiple prometheus deployments
additionalServiceMonitorLabels: {}
# release: "monitoring"
# key: "value"
# The following components expose Prometheus metrics and have podmonitors in this chart (disabled by default)
#
podMonitor:
enabled: false
##namespace in which you want to deploy podmonitor
##
namespace: ""
## Map of additional lables to add to the PodMonitor resources
# to allow selecting sepcific PodMonitor
# in case of multiple prometheus deployments
additionalPodMonitorLabels: {}
# release: "monitoring"
# key: "value"
## Persist data to a persistent volume.
##
@@ -479,7 +501,9 @@ persistence:
# accessKeyId: <awsAccessKeyId>
# secretAccessKey: <awsSecretAccessKey>
# region: <awsRegion>
## For Minio and other s3 compatible storage systems set endPoint property
# endPoint: <s3StorageUrl>
## A manually managed Persistent Volume Claim name
## Requires persistence.enabled: true
## If defined, PVC must be created manually before volume will be bound
@@ -583,7 +607,7 @@ preUpgradeChecks:
image: fission/pre-upgrade-checks
## pre-install/pre-upgrade checks image version
##
imageTag: v1.17.0-rc1
imageTag: v1.17.0
## Fission post-install/post-upgrade reporting live in this image
##
@@ -639,23 +663,6 @@ authentication:
##
jwtIssuer: fission
## Use the following flags to enable OpenTracing.
## Note: OpenTracing support will be removed in an upcoming release.
## Please prefer using OpenTelemetry instead.
##
openTracing:
## set this flag to true if you wish to enable OpenTracing
##
enabled: false
## if enabled is true, the variable is endpoint of Jaeger collector in the format shown below
##
#collectorEndpoint: "http://jaeger-collector.jaeger.svc:14268/api/traces?format=jaeger.thrift"
## uniformly sample traces with the given probabilistic sampling rate
##
#samplingRate: 0.75
## OpenTelemetry is a set of tools for collecting, analyzing, and visualizing
## distributed tracing data across function calls.
##
@@ -679,6 +686,7 @@ openTelemetry:
## parentbased_always_on - (default if empty) Sampler that respects its parent span's sampling decision, but otherwise always samples.
## parentbased_always_off - Sampler that respects its parent span's sampling decision, but otherwise never samples.
## parentbased_traceidratio - Sampler that respects its parent span's sampling decision, but otherwise samples probabalistically based on rate.
## See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
##
tracesSampler: "parentbased_traceidratio"
## Each Sampler type defines its own expected input, if any.
@@ -696,6 +704,8 @@ openTelemetry:
## jaeger - Jaeger uber-trace-id header
## xray - AWS X-Ray (third party)
## ottrace - OpenTracing Trace (third party)
## none - No tracing
## See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#general-sdk-configuration
##
propagators: "tracecontext,baggage"
@@ -706,25 +716,28 @@ mqt_keda:
connector_images:
kafka:
image: fission/keda-kafka-http-connector
tag: v0.10
tag: v0.11
rabbitmq:
image: fission/keda-rabbitmq-http-connector
tag: v0.9
tag: v0.10
awskinesis:
image: fission/keda-aws-kinesis-http-connector
tag: v0.9
tag: v0.10
aws_sqs:
image: fission/keda-aws-sqs-http-connector
tag: v0.9
tag: v0.10
nats_steaming:
image: fission/keda-nats-streaming-http-connector
tag: v0.11
tag: v0.12
nats_jetstream:
image: fission/keda-nats-jetstream-http-connector
tag: v0.2
gcp_pubsub:
image: fission/keda-gcp-pubsub-http-connector
tag: v0.4
tag: v0.5
redis:
image: fission/keda-redis-http-connector
tag: v0.2
tag: v0.3
## Pod resources as:
## resources:
@@ -782,3 +795,12 @@ builderPodSpec:
runAsNonRoot: true
runAsUser: 10001
## Enable Grafana Dashboard configmaps for auto dashboard provisioning
## If you use kube-prometheus stack for monitoring, these will get imported into grafana
grafana:
## The namespace in which grafana pod is present
namespace: monitoring
dashboards:
## Disabled by default. switch to true to deploy them
enable: false
+1 -1
View File
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
RUN apk add --update ca-certificates
COPY builder /builder
ENTRYPOINT ["/builder"]
+1 -1
View File
@@ -38,7 +38,7 @@ func main() {
if os.IsNotExist(err) {
err = os.MkdirAll(shareVolume, os.ModeDir|0700)
if err != nil {
logger.Fatal("error creating directory: %v", zap.Error(err), zap.String("directory", shareVolume))
logger.Fatal("error creating directory: %s", zap.Error(err), zap.String("directory", shareVolume))
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
RUN apk add --update ca-certificates
COPY fetcher /
ENTRYPOINT ["/fetcher"]
+8 -24
View File
@@ -25,14 +25,12 @@ import (
"os"
"sync/atomic"
"go.opencensus.io/plugin/ochttp"
"go.opentelemetry.io/otel"
"go.uber.org/zap"
"github.com/fission/fission/pkg/fetcher"
"github.com/fission/fission/pkg/utils/httpserver"
otelUtils "github.com/fission/fission/pkg/utils/otel"
"github.com/fission/fission/pkg/utils/tracing"
)
var (
@@ -41,7 +39,6 @@ var (
func Run(ctx context.Context, logger *zap.Logger) {
flag.Usage = fetcherUsage
collectorEndpoint := flag.String("jaeger-collector-endpoint", "", "")
specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod startup")
specializePayload := flag.String("specialize-request", "", "JSON payload for specialize request")
secretDir := flag.String("secret-dir", "", "Path to shared secrets directory")
@@ -62,21 +59,13 @@ func Run(ctx context.Context, logger *zap.Logger) {
}
}
}
openTracingEnabled := tracing.TracingEnabled(logger)
if openTracingEnabled {
go func() {
if err := tracing.RegisterTraceExporter(logger, *collectorEndpoint, "Fission-Fetcher"); err != nil {
logger.Fatal("could not register trace exporter", zap.Error(err), zap.String("collector_endpoint", *collectorEndpoint))
}
}()
} else {
shutdown, err := otelUtils.InitProvider(ctx, logger, "Fission-Fetcher")
if err != nil {
logger.Fatal("error initializing provider for OTLP", zap.Error(err))
}
if shutdown != nil {
defer shutdown(ctx)
}
shutdown, err := otelUtils.InitProvider(ctx, logger, "Fission-Fetcher")
if err != nil {
logger.Fatal("error initializing provider for OTLP", zap.Error(err))
}
if shutdown != nil {
defer shutdown(ctx)
}
tracer := otel.Tracer("fetcher")
@@ -129,12 +118,7 @@ func Run(ctx context.Context, logger *zap.Logger) {
logger.Info("fetcher ready to receive requests")
var handler http.Handler
if openTracingEnabled {
handler = &ochttp.Handler{Handler: mux}
} else {
handler = otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
}
handler := otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
httpserver.StartServer(ctx, logger, "fetcher", "8000", handler)
}
+1 -1
View File
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
RUN apk add --update ca-certificates
COPY fission-bundle /
ENTRYPOINT ["/fission-bundle"]
+19 -29
View File
@@ -42,19 +42,18 @@ import (
"github.com/fission/fission/pkg/utils/otel"
"github.com/fission/fission/pkg/utils/profile"
"github.com/fission/fission/pkg/utils/signals"
"github.com/fission/fission/pkg/utils/tracing"
)
func runController(ctx context.Context, logger *zap.Logger, port int, openTracingEnabled bool) {
controller.Start(ctx, logger, port, false, openTracingEnabled)
func runController(ctx context.Context, logger *zap.Logger, port int) {
controller.Start(ctx, logger, port, false)
}
func runRouter(ctx context.Context, logger *zap.Logger, port int, executorUrl string, openTracingEnabled bool) {
router.Start(ctx, logger, port, executorUrl, openTracingEnabled)
func runRouter(ctx context.Context, logger *zap.Logger, port int, executorUrl string) {
router.Start(ctx, logger, port, executorUrl)
}
func runExecutor(ctx context.Context, logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string, openTracingEnabled bool) error {
return executor.StartExecutor(ctx, logger, functionNamespace, envBuilderNamespace, port, openTracingEnabled)
func runExecutor(ctx context.Context, logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string) error {
return executor.StartExecutor(ctx, logger, functionNamespace, envBuilderNamespace, port)
}
func runKubeWatcher(ctx context.Context, logger *zap.Logger, routerUrl string) error {
@@ -74,8 +73,8 @@ func runMQManager(ctx context.Context, logger *zap.Logger, routerURL string) err
return mqt.StartScalerManager(ctx, logger, routerURL)
}
func runStorageSvc(ctx context.Context, logger *zap.Logger, port int, storage storagesvc.Storage, openTracingEnabled bool) error {
return storagesvc.Start(ctx, logger, storage, port, openTracingEnabled)
func runStorageSvc(ctx context.Context, logger *zap.Logger, port int, storage storagesvc.Storage) error {
return storagesvc.Start(ctx, logger, storage, port)
}
func runBuilderMgr(ctx context.Context, logger *zap.Logger, storageSvcUrl string, envBuilderNamespace string) error {
@@ -210,22 +209,13 @@ Options:
return
}
openTracingEnabled := tracing.TracingEnabled(logger)
if openTracingEnabled {
err = tracing.RegisterTraceExporter(logger, os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"), getServiceName(arguments))
if err != nil {
logger.Error("failed to register trace exporter", zap.Error(err), zap.Any("argument", arguments))
return
}
} else {
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
if err != nil {
logger.Error("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
return
}
if shutdown != nil {
defer shutdown(ctx)
}
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
if err != nil {
logger.Error("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
return
}
if shutdown != nil {
defer shutdown(ctx)
}
functionNs := getStringArgWithDefault(arguments["--namespace"], "fission-function")
@@ -237,21 +227,21 @@ Options:
if arguments["--controllerPort"] != nil {
port := getPort(logger, arguments["--controllerPort"])
runController(ctx, logger, port, openTracingEnabled)
runController(ctx, logger, port)
logger.Error("controller exited")
return
}
if arguments["--routerPort"] != nil {
port := getPort(logger, arguments["--routerPort"])
runRouter(ctx, logger, port, executorUrl, openTracingEnabled)
runRouter(ctx, logger, port, executorUrl)
logger.Error("router exited")
return
}
if arguments["--executorPort"] != nil {
port := getPort(logger, arguments["--executorPort"])
err = runExecutor(ctx, logger, port, functionNs, envBuilderNs, openTracingEnabled)
err = runExecutor(ctx, logger, port, functionNs, envBuilderNs)
if err != nil {
logger.Error("executor exited", zap.Error(err))
return
@@ -314,7 +304,7 @@ Options:
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
storage = storagesvc.NewLocalStorage("/fission")
}
err := runStorageSvc(ctx, logger, port, storage, openTracingEnabled)
err := runStorageSvc(ctx, logger, port, storage)
if err != nil {
logger.Error("storage service exited", zap.Error(err))
return
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
RUN apk add --update ca-certificates
COPY pre-upgrade-checks /
ENTRYPOINT ["/pre-upgrade-checks"]
+1 -1
View File
@@ -1,4 +1,4 @@
FROM alpine:3.15
FROM alpine:3.16
RUN apk add --update ca-certificates
COPY reporter /
ENTRYPOINT ["/reporter"]
+2 -2
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -59,7 +59,7 @@ func eventCommandHandler(cmd *cobra.Command, args []string) error {
return t.SendEvent(ctx, event)
}
//EventCommand reports an event to analytics
// EventCommand reports an event to analytics
func EventCommand() *cobra.Command {
eventCmd := &cobra.Command{
Use: "event",
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -122,7 +122,7 @@ spec:
description: BuildLog stores build log during the compilation.
type: string
buildstatus:
default: Pending
default: pending
description: BuildStatus is the package build status.
type: string
lastUpdateTimestamp:
-7
View File
@@ -1,7 +0,0 @@
module.exports = async (context) => {
return {
status: 200,
body: "hello, world!\n"
};
}
+61 -70
View File
@@ -1,77 +1,69 @@
module github.com/fission/fission
go 1.18
go 1.19
require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
github.com/Shopify/sarama v1.32.0
github.com/Shopify/sarama v1.36.0
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
github.com/dustin/go-humanize v1.0.0
github.com/emicklei/go-restful v2.15.0+incompatible
github.com/emicklei/go-restful-openapi v1.4.1
github.com/emicklei/go-restful-openapi/v2 v2.9.0
github.com/emicklei/go-restful/v3 v3.9.0
github.com/fatih/color v1.13.0
github.com/fsnotify/fsnotify v1.5.1
github.com/ghodss/yaml v1.0.0
github.com/fsnotify/fsnotify v1.5.4
github.com/go-git/go-git/v5 v5.4.2
github.com/go-openapi/spec v0.20.4
github.com/golang-jwt/jwt/v4 v4.3.0
github.com/go-openapi/spec v0.20.7
github.com/golang-jwt/jwt/v4 v4.4.2
github.com/gorilla/mux v1.8.0
github.com/graymeta/stow v0.2.7
github.com/graymeta/stow v0.2.8
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-retryablehttp v0.7.1
github.com/imdario/mergo v0.3.12
github.com/influxdata/influxdb v1.9.6
github.com/imdario/mergo v0.3.13
github.com/influxdata/influxdb v1.10.0
github.com/mholt/archiver/v3 v3.5.1
github.com/minio/minio-go v6.0.14+incompatible
github.com/ory/dockertest v3.3.5+incompatible
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/common v0.32.1
github.com/prometheus/client_golang v1.13.0
github.com/prometheus/common v0.37.0
github.com/robfig/cron v1.2.0
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/spf13/cobra v1.4.0
github.com/spf13/cobra v1.5.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.8.0
github.com/wcharczuk/go-chart v2.0.1+incompatible
go.opencensus.io v0.23.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
go.opentelemetry.io/contrib/propagators/aws v1.7.0
go.opentelemetry.io/contrib/propagators/b3 v1.7.0
go.opentelemetry.io/contrib/propagators/jaeger v1.7.0
go.opentelemetry.io/contrib/propagators/ot v1.7.0
go.opentelemetry.io/otel v1.7.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0
go.opentelemetry.io/otel/sdk v1.7.0
go.opentelemetry.io/otel/trace v1.7.0
go.uber.org/zap v1.21.0
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
google.golang.org/grpc v1.47.0
k8s.io/api v0.23.4
k8s.io/apiextensions-apiserver v0.23.4
k8s.io/apimachinery v0.23.4
k8s.io/client-go v0.23.4
k8s.io/metrics v0.23.4
sigs.k8s.io/controller-runtime v0.10.2
sigs.k8s.io/yaml v1.2.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0
go.opentelemetry.io/contrib/propagators/autoprop v0.34.0
go.opentelemetry.io/otel v1.9.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0
go.opentelemetry.io/otel/sdk v1.9.0
go.opentelemetry.io/otel/trace v1.9.0
go.uber.org/zap v1.23.0
golang.org/x/net v0.0.0-20220812174116-3211cb980234
google.golang.org/grpc v1.48.0
k8s.io/api v0.25.0
k8s.io/apiextensions-apiserver v0.25.0
k8s.io/apimachinery v0.25.0
k8s.io/client-go v0.25.0
k8s.io/metrics v0.25.0
sigs.k8s.io/controller-runtime v0.13.0
sigs.k8s.io/yaml v1.3.0
)
require (
cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/andybalholm/brotli v1.0.1 // indirect
github.com/aws/aws-sdk-go v1.42.34 // indirect
@@ -81,52 +73,51 @@ require (
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/continuity v0.2.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-resiliency v1.3.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-ini/ini v1.66.4 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.14.4 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/lib/pq v1.10.4 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
@@ -137,49 +128,49 @@ require (
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.2 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.8 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/uber/jaeger-client-go v2.28.0+incompatible // indirect
github.com/ulikunitz/xz v0.5.9 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect
go.opentelemetry.io/otel/metric v0.27.0 // indirect
go.opentelemetry.io/contrib/propagators/aws v1.9.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect
go.opentelemetry.io/contrib/propagators/jaeger v1.9.0 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.9.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.9.0 // indirect
go.opentelemetry.io/otel/metric v0.31.0 // indirect
go.opentelemetry.io/proto/otlp v0.18.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
google.golang.org/api v0.62.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools v2.2.0+incompatible // indirect
k8s.io/klog/v2 v2.30.0 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
+147 -373
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -55,11 +55,11 @@ Fix the build if it is not green. DON'T proceed unless build is GREEN!
6. Push this release-x.y.z branch to remote repo. Create a PR and wait for CI passed.
7. Now manually merge the release-x.y.z branch into master branch with Git command to prevent the commit SHA from being changed.
7. Now manually merge the release-x.y.z branch into main branch with Git command to prevent the commit SHA from being changed.
`git checkout master && git merge --ff-only release-<VERSION>`
`git checkout main && git merge --ff-only release-<VERSION>`
8. Test build from master branch for sanity check and make sure the master build is green
8. Test build from main branch for sanity check and make sure the main build is green
## Updating [Fission Charts](https://github.com/fission/fission-charts)
@@ -80,7 +80,7 @@ Before you save the release - UNCHECK the "This is a pre-release" checkbox. This
1. Documentation Update
a. Merge documentation PRs that are peer reviewed and get latest master locally.
a. Merge documentation PRs that are peer reviewed and get latest main locally.
b. In the repo fission/fission.io change version in version.sh file to latest version (x.y.z) and run build.sh script
+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"
+16
View File
@@ -0,0 +1,16 @@
if ! command -v dashboard-linter >/dev/null 2>&1; then
echo "dashboard-linter is not installed"
exit 1;
fi
BASE_PATH=$(pwd)
if [[ -z "$BASE_PATH" ]] ; then
BASE_PATH=$(GITHUB_WORKSPACE)
fi
DASHBOARD_PATH="$BASE_PATH/charts/fission-all/dashboards/*"
for f in $DASHBOARD_PATH
do
dashboard-linter lint --strict --verbose $f
done
+1 -1
View File
@@ -1,2 +1,2 @@
Install Guide: https://fission.io/docs/installation/
Full Changelog: https://github.com/fission/fission/blob/master/CHANGELOG.md
Full Changelog: https://github.com/fission/fission/blob/main/CHANGELOG.md
+9 -5
View File
@@ -22,8 +22,8 @@ check_commands() {
# Ensure we're on the master branch
check_branch() {
curr_branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$curr_branch" != "master" ]; then
echo "Not on master branch."
if [ "$curr_branch" != "main" ]; then
echo "Not on main branch."
exit 1
fi
echo "check_branch == PASSED"
@@ -39,14 +39,17 @@ check_clean() {
}
check_github_token() {
if [ ! -f "$HOME"/.github-token ]; then
echo "Error finding github access token at ${HOME}/.github-token"
if [ ! -f "$HOME"/.github-token ] && [ -z "$GITHUB_TOKEN" ]; then
echo "Error finding github access token at ${HOME}/.github-token or in GITHUB_TOKEN envvar"
exit 1
fi
echo "check_github_token == PASSED"
}
export GITHUB_TOKEN=$(cat ~/.github-token)
# Read token from file if not set as envvar
if [ -z "$GITHUB_TOKEN"]; then
export GITHUB_TOKEN=$(cat ~/.github-token)
fi
version=$1
if [ -z "$version" ]; then
@@ -66,6 +69,7 @@ check_github_token
export GORELEASER_CURRENT_TAG=$version
echo "Release version $GORELEASER_CURRENT_TAG "
echo "DOCKER_CLI_EXPERIMENTAL $DOCKER_CLI_EXPERIMENTAL"
goreleaser release
echo "############ DONE #############"
-1
View File
@@ -21,7 +21,6 @@ limitations under the License.
// +k8s:defaulter-gen=TypeMeta
// +groupName=fission.io
// +groupGoName=core
//
package v1
const (
+2 -2
View File
@@ -304,7 +304,7 @@ type (
// is ready for deploy instead of setting "none" in build status.
// BuildStatus is the package build status.
// +kubebuilder:default:="Pending"
// +kubebuilder:default:="pending"
BuildStatus BuildStatus `json:"buildstatus,omitempty"`
// BuildLog stores build log during the compilation.
@@ -883,7 +883,7 @@ type (
}
)
//IsEmpty checks if the archive byte and litreal are of length 0
// IsEmpty checks if the archive byte and litreal are of length 0
func (a Archive) IsEmpty() bool {
return len(a.Literal) == 0 && len(a.URL) == 0
}
+3 -3
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,7 +18,7 @@ package builder
import (
"bytes"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"os"
@@ -139,7 +139,7 @@ func TestBuilder(t *testing.T) {
if resp.StatusCode != test.status {
t.Errorf("expected status code %d, got %d", test.status, resp.StatusCode)
}
body, err = ioutil.ReadAll(resp.Body)
body, err = io.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
}
+1 -9
View File
@@ -26,7 +26,6 @@ import (
"time"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.uber.org/zap"
"golang.org/x/net/context/ctxhttp"
@@ -34,7 +33,6 @@ import (
"github.com/fission/fission/pkg/builder"
ferror "github.com/fission/fission/pkg/error"
otelUtils "github.com/fission/fission/pkg/utils/otel"
"github.com/fission/fission/pkg/utils/tracing"
)
type (
@@ -46,13 +44,7 @@ type (
)
func MakeClient(logger *zap.Logger, builderUrl string) *Client {
var hc *http.Client
if tracing.TracingEnabled(logger) {
hc = &http.Client{Transport: &ochttp.Transport{}}
} else {
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
}
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
return &Client{
logger: logger.Named("builder_client"),
url: strings.TrimSuffix(builderUrl, "/"),
+4 -4
View File
@@ -199,7 +199,7 @@ func (canaryCfgMgr *canaryConfigMgr) processCanaryConfig(ctx *context.Context, c
zap.String("name", canaryConfig.ObjectMeta.Name),
zap.String("namespace", canaryConfig.ObjectMeta.Namespace),
zap.String("version", canaryConfig.ObjectMeta.ResourceVersion))
canaryCfgMgr.RollForwardOrBack(canaryConfig, quit, ticker)
canaryCfgMgr.RollForwardOrBack(*ctx, canaryConfig, quit, ticker)
case <-quit:
// we're done processing this canary config either because the new function receives 100% of the traffic
@@ -221,7 +221,7 @@ func (canaryCfgMgr *canaryConfigMgr) processCanaryConfig(ctx *context.Context, c
}
}
func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryConfig, quit chan struct{}, ticker *time.Ticker) {
func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(ctx context.Context, canaryConfig *fv1.CanaryConfig, quit chan struct{}, ticker *time.Ticker) {
// handle race between delete event and notification on ticker.C
_, err := canaryCfgMgr.canaryCfgCancelFuncMap.lookup(&canaryConfig.ObjectMeta)
if err != nil {
@@ -233,7 +233,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
}
// get the http trigger object associated with this canary config
triggerObj, err := canaryCfgMgr.fissionClient.CoreV1().HTTPTriggers(canaryConfig.ObjectMeta.Namespace).Get(context.TODO(), canaryConfig.Spec.Trigger, metav1.GetOptions{})
triggerObj, err := canaryCfgMgr.fissionClient.CoreV1().HTTPTriggers(canaryConfig.ObjectMeta.Namespace).Get(ctx, canaryConfig.Spec.Trigger, metav1.GetOptions{})
if err != nil {
// if the http trigger is not found, then give up processing this config.
if k8serrors.IsNotFound(err) {
@@ -286,7 +286,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
methods = append(methods, triggerObj.Spec.Method)
}
}
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(urlPath, methods,
failurePercent, err := canaryCfgMgr.promClient.GetFunctionFailurePercentage(ctx, urlPath, methods,
canaryConfig.Spec.NewFunction, canaryConfig.ObjectMeta.Namespace, canaryConfig.Spec.WeightIncrementDuration)
if err != nil {
// silently ignore. wait for next window to increment weight
+11 -11
View File
@@ -51,11 +51,11 @@ func MakePrometheusClient(logger *zap.Logger, prometheusSvc string) (*Prometheus
}, nil
}
func (promApiClient *PrometheusApiClient) GetFunctionFailurePercentage(path string, methods []string, funcName, funcNs string, window string) (float64, error) {
func (promApiClient *PrometheusApiClient) GetFunctionFailurePercentage(ctx context.Context, path string, methods []string, funcName, funcNs string, window string) (float64, error) {
var reqs, failedReqs float64
// first get a total count of requests to this url in a time window
for _, method := range methods {
mreqs, err := promApiClient.GetRequestsToFuncInWindow(path, method, funcName, funcNs, window)
mreqs, err := promApiClient.GetRequestsToFuncInWindow(ctx, path, method, funcName, funcNs, window)
if err != nil {
return 0, err
}
@@ -68,7 +68,7 @@ func (promApiClient *PrometheusApiClient) GetFunctionFailurePercentage(path stri
// next, get a total count of errored out requests to this function in the same window
for _, method := range methods {
mfailedReqs, err := promApiClient.GetTotalFailedRequestsToFuncInWindow(funcName, funcNs, path, method, window)
mfailedReqs, err := promApiClient.GetTotalFailedRequestsToFuncInWindow(ctx, funcName, funcNs, path, method, window)
if err != nil {
return 0, err
}
@@ -85,18 +85,18 @@ func (PrometheusApiClient *PrometheusApiClient) getFunctionQueryLabels(functionN
return fmt.Sprintf("function_name=\"%s\",function_namespace=\"%s\",path=\"%s\",method=\"%s\"", functionName, functionNamespace, path, method)
}
func (promApiClient *PrometheusApiClient) GetRequestsToFuncInWindow(path string, method string, funcName string, funcNs string, window string) (float64, error) {
func (promApiClient *PrometheusApiClient) GetRequestsToFuncInWindow(ctx context.Context, path string, method string, funcName string, funcNs string, window string) (float64, error) {
queryLabels := promApiClient.getFunctionQueryLabels(funcName, funcNs, path, method)
queryString := fmt.Sprintf("fission_function_calls_total{%s}[%v]", queryLabels, window)
reqs, err := promApiClient.executeQuery(queryString)
reqs, err := promApiClient.executeQuery(ctx, queryString)
if err != nil {
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
}
queryString = fmt.Sprintf("fission_function_calls_total{%s} offset %v", queryLabels, window)
reqsInPrevWindow, err := promApiClient.executeQuery(queryString)
reqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
if err != nil {
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
}
@@ -111,18 +111,18 @@ func (promApiClient *PrometheusApiClient) GetRequestsToFuncInWindow(path string,
return reqsInCurrentWindow, nil
}
func (promApiClient *PrometheusApiClient) GetTotalFailedRequestsToFuncInWindow(funcName string, funcNs string, path string, method string, window string) (float64, error) {
func (promApiClient *PrometheusApiClient) GetTotalFailedRequestsToFuncInWindow(ctx context.Context, funcName string, funcNs string, path string, method string, window string) (float64, error) {
queryLabels := promApiClient.getFunctionQueryLabels(funcName, funcNs, path, method)
queryString := fmt.Sprintf("fission_function_errors_total{%s}[%v]", queryLabels, window)
failedRequests, err := promApiClient.executeQuery(queryString)
failedRequests, err := promApiClient.executeQuery(ctx, queryString)
if err != nil {
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
}
queryString = fmt.Sprintf("fission_function_errors_total{%s} offset %v", queryLabels, window)
failedReqsInPrevWindow, err := promApiClient.executeQuery(queryString)
failedReqsInPrevWindow, err := promApiClient.executeQuery(ctx, queryString)
if err != nil {
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
}
@@ -137,10 +137,10 @@ func (promApiClient *PrometheusApiClient) GetTotalFailedRequestsToFuncInWindow(f
return failedReqsInCurrentWindow, nil
}
func (promApiClient *PrometheusApiClient) executeQuery(queryString string) (float64, error) {
func (promApiClient *PrometheusApiClient) executeQuery(ctx context.Context, queryString string) (float64, error) {
promApiClient.logger.Debug("executing prometheus query", zap.String("query", queryString))
val, warn, err := promApiClient.client.Query(context.Background(), queryString, time.Now())
val, warn, err := promApiClient.client.Query(ctx, queryString, time.Now())
if err != nil {
return 0, errors.Wrapf(err, "error querying prometheus")
}
+2 -9
View File
@@ -24,7 +24,6 @@ import (
"strings"
"github.com/gorilla/mux"
"go.opencensus.io/plugin/ochttp"
"go.uber.org/zap"
apiv1 "k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
@@ -270,14 +269,8 @@ func (api *API) GetHandler() http.Handler {
return r
}
func (api *API) Serve(ctx context.Context, port int, openTracingEnabled bool) {
var handler http.Handler
if openTracingEnabled {
handler = &ochttp.Handler{Handler: api.GetHandler()}
} else {
handler = otel.GetHandlerWithOTEL(api.GetHandler(), "fission-controller", otel.UrlsToIgnore("/healthz"))
}
func (api *API) Serve(ctx context.Context, port int) {
handler := otel.GetHandlerWithOTEL(api.GetHandler(), "fission-controller", otel.UrlsToIgnore("/healthz"))
go metrics.ServeMetrics(ctx, api.logger)
httpserver.StartServer(ctx, api.logger, "controller", fmt.Sprintf("%d", port), handler)
}
+144 -20
View File
@@ -31,7 +31,6 @@ import (
uuid "github.com/satori/go.uuid"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -41,6 +40,7 @@ import (
"github.com/fission/fission/pkg/crd"
ferror "github.com/fission/fission/pkg/error"
"github.com/fission/fission/pkg/fission-cli/cmd"
"github.com/fission/fission/pkg/utils/loggerfactory"
)
var (
@@ -130,7 +130,10 @@ func TestFunctionApi(t *testing.T) {
testFunc.ObjectMeta.Name = "bar"
m2, err := g.Client().V1().Function().Create(testFunc)
panicIf(err)
defer panicIf(g.Client().V1().Function().Delete(m2))
defer func() {
err := g.Client().V1().Function().Delete(m2)
panicIf(err)
}()
funcs, err := g.Client().V1().Function().List(testNS)
panicIf(err)
@@ -174,7 +177,10 @@ func TestHTTPTriggerApi(t *testing.T) {
m, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
panicIf(err)
defer panicIf(g.Client().V1().HTTPTrigger().Delete(m))
defer func() {
err := g.Client().V1().HTTPTrigger().Delete(m)
panicIf(err)
}()
_, err = g.Client().V1().HTTPTrigger().Create(testTrigger)
assertNameReuseFailure(err, "httptrigger")
@@ -199,13 +205,111 @@ func TestHTTPTriggerApi(t *testing.T) {
testTrigger.Spec.RelativeURL = "/hi2"
m2, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
panicIf(err)
defer panicIf(g.Client().V1().HTTPTrigger().Delete(m2))
defer func() {
err = g.Client().V1().HTTPTrigger().Delete(m2)
panicIf(err)
}()
ts, err := g.Client().V1().HTTPTrigger().List(testNS)
panicIf(err)
assert(len(ts) == 2, fmt.Sprintf("created two triggers, but found %v", len(ts)))
}
func createFissionFnForMultipleTrigger() {
testFunc := &fv1.Function{
ObjectMeta: metav1.ObjectMeta{
Name: "foo1",
Namespace: testNS,
},
Spec: fv1.FunctionSpec{
Environment: fv1.EnvironmentReference{
Name: "nodejs",
Namespace: testNS,
},
Package: fv1.FunctionPackageRef{
FunctionName: "xxx",
PackageRef: fv1.PackageRef{
Namespace: testNS,
Name: "xxx",
ResourceVersion: "12345",
},
},
},
}
_, err := g.Client().V1().Function().Create(testFunc)
panicIf(err)
defer func() {
panicIf(err)
}()
testFunc.Name = "foo2"
_, err = g.Client().V1().Function().Create(testFunc)
panicIf(err)
defer func() {
panicIf(err)
}()
}
func TestHTTPTriggerCreateMultipleTrigger(t *testing.T) {
logger := loggerfactory.GetLogger()
createFissionFnForMultipleTrigger()
prefix := "url_new"
testTrigger := &fv1.HTTPTrigger{
ObjectMeta: metav1.ObjectMeta{
Name: "foo1",
Namespace: testNS,
},
Spec: fv1.HTTPTriggerSpec{
Methods: []string{http.MethodGet},
Prefix: &prefix,
FunctionReference: fv1.FunctionReference{
Type: fv1.FunctionReferenceTypeFunctionName,
Name: "foo1",
},
},
}
m, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
panicIf(err)
defer panicIf(g.Client().V1().HTTPTrigger().Delete(m))
prefix_2 := "url_another"
testTrigger2 := &fv1.HTTPTrigger{
ObjectMeta: metav1.ObjectMeta{
Name: "foo2",
Namespace: testNS,
},
Spec: fv1.HTTPTriggerSpec{
Methods: []string{http.MethodGet},
Prefix: &prefix_2,
FunctionReference: fv1.FunctionReference{
Type: fv1.FunctionReferenceTypeFunctionName,
Name: "foo2",
},
},
}
m2, err := g.Client().V1().HTTPTrigger().Create(testTrigger2)
if err != nil {
t.Fatal()
}
defer func() {
if m2 != nil {
err := g.Client().V1().HTTPTrigger().Delete(m2)
if err != nil {
logger.Error("Error deleting http trigger", zap.String("name", m2.Name), zap.Error(err))
}
}
}()
}
func TestEnvironmentApi(t *testing.T) {
testEnv := &fv1.Environment{
ObjectMeta: metav1.ObjectMeta{
@@ -228,7 +332,10 @@ func TestEnvironmentApi(t *testing.T) {
m, err := g.Client().V1().Environment().Create(testEnv)
panicIf(err)
defer panicIf(g.Client().V1().Environment().Delete(m))
defer func() {
err := g.Client().V1().Environment().Delete(m)
panicIf(err)
}()
_, err = g.Client().V1().Environment().Create(testEnv)
assertNameReuseFailure(err, "environment")
@@ -247,7 +354,10 @@ func TestEnvironmentApi(t *testing.T) {
m2, err := g.Client().V1().Environment().Create(testEnv)
panicIf(err)
defer panicIf(g.Client().V1().Environment().Delete(m2))
defer func() {
err := g.Client().V1().Environment().Delete(m2)
panicIf(err)
}()
ts, err := g.Client().V1().Environment().List(testNS)
panicIf(err)
@@ -277,7 +387,10 @@ func TestWatchApi(t *testing.T) {
m, err := g.Client().V1().KubeWatcher().Create(testWatch)
panicIf(err)
defer panicIf(g.Client().V1().KubeWatcher().Delete(m))
defer func() {
err := g.Client().V1().KubeWatcher().Delete(m)
panicIf(err)
}()
_, err = g.Client().V1().KubeWatcher().Create(testWatch)
assertNameReuseFailure(err, "watch")
@@ -292,7 +405,10 @@ func TestWatchApi(t *testing.T) {
testWatch.ObjectMeta.Name = "yyy"
m2, err := g.Client().V1().KubeWatcher().Create(testWatch)
panicIf(err)
defer panicIf(g.Client().V1().KubeWatcher().Delete(m2))
defer func() {
err := g.Client().V1().KubeWatcher().Delete(m2)
panicIf(err)
}()
ws, err := g.Client().V1().KubeWatcher().List(testNS)
panicIf(err)
@@ -318,7 +434,10 @@ func TestTimeTriggerApi(t *testing.T) {
m, err := g.Client().V1().TimeTrigger().Create(testTrigger)
panicIf(err)
defer panicIf(g.Client().V1().TimeTrigger().Delete(m))
defer func() {
err := g.Client().V1().TimeTrigger().Delete(m)
panicIf(err)
}()
_, err = g.Client().V1().TimeTrigger().Create(testTrigger)
assertNameReuseFailure(err, "trigger")
@@ -348,10 +467,15 @@ func TestTimeTriggerApi(t *testing.T) {
func TestMain(m *testing.M) {
flag.Parse()
ctx, cancel := context.WithCancel(context.Background())
logger := loggerfactory.GetLogger()
// skip test if no cluster available for testing
kubeconfig := os.Getenv("KUBECONFIG")
if len(kubeconfig) == 0 {
log.Println("Skipping test, no kubernetes cluster")
cancel()
return
}
@@ -362,22 +486,14 @@ func TestMain(m *testing.M) {
id, err := uuid.NewV4()
panicIf(err)
testNS = id.String()
_, err = kubeClient.CoreV1().Namespaces().Create(context.TODO(), &v1.Namespace{
_, err = kubeClient.CoreV1().Namespaces().Create(ctx, &v1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: testNS,
},
}, metav1.CreateOptions{})
panicIf(err)
defer panicIf(kubeClient.CoreV1().Namespaces().Delete(context.TODO(), testNS, metav1.DeleteOptions{}))
config := zap.NewDevelopmentConfig()
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
logger, err := config.Build()
panicIf(err)
ctx := context.Background()
go Start(ctx, logger, 8888, true, true)
go Start(ctx, logger, 8888, true)
time.Sleep(5 * time.Second)
@@ -400,5 +516,13 @@ func TestMain(m *testing.M) {
_, err = io.ReadAll(resp.Body)
panicIf(err)
os.Exit(m.Run())
exitVal := m.Run()
logger.Info("Deleting test namespace", zap.String("namespace", testNS))
gracePeriod := int64(0)
err = kubeClient.CoreV1().Namespaces().Delete(context.TODO(), testNS, metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod})
if err != nil {
logger.Error("error deleting test namespace", zap.String("namespace", testNS), zap.Error(err))
}
cancel()
os.Exit(exitVal)
}
+2 -2
View File
@@ -22,8 +22,8 @@ import (
"io"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
"go.uber.org/zap"
+2 -2
View File
@@ -24,7 +24,7 @@ import (
"github.com/fission/fission/pkg/crd"
)
func Start(ctx context.Context, logger *zap.Logger, port int, unitTestFlag bool, openTracingEnabled bool) {
func Start(ctx context.Context, logger *zap.Logger, port int, unitTestFlag bool) {
cLogger := logger.Named("controller")
fc, kc, apiExtClient, _, err := crd.MakeFissionClient()
@@ -51,5 +51,5 @@ func Start(ctx context.Context, logger *zap.Logger, port int, unitTestFlag bool,
if err != nil {
cLogger.Fatal("failed to start controller", zap.Error(err))
}
api.Serve(ctx, port, openTracingEnabled)
api.Serve(ctx, port)
}
+2 -2
View File
@@ -21,8 +21,8 @@ import (
"io"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
"go.uber.org/zap"
+5 -5
View File
@@ -28,8 +28,8 @@ import (
"strconv"
"strings"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
"github.com/pkg/errors"
@@ -332,21 +332,21 @@ func (a *API) FunctionPodLogs(w http.ResponseWriter, r *http.Request) {
}
// get the pod with highest resource version
err = getContainerLog(a.kubernetesClient, w, f, &pods[0])
err = getContainerLog(r.Context(), a.kubernetesClient, w, f, &pods[0])
if err != nil {
a.respondWithError(w, errors.Wrapf(err, "error getting container logs"))
return
}
}
func getContainerLog(kubernetesClient kubernetes.Interface, w http.ResponseWriter, fn *fv1.Function, pod *apiv1.Pod) error {
func getContainerLog(ctx context.Context, kubernetesClient kubernetes.Interface, w http.ResponseWriter, fn *fv1.Function, pod *apiv1.Pod) error {
seq := strings.Repeat("=", 35)
for _, container := range pod.Spec.Containers {
podLogOpts := apiv1.PodLogOptions{Container: container.Name} // Only the env container, not fetcher
podLogsReq := kubernetesClient.CoreV1().Pods(pod.Namespace).GetLogs(pod.ObjectMeta.Name, &podLogOpts)
podLogs, err := podLogsReq.Stream(context.Background())
podLogs, err := podLogsReq.Stream(ctx)
if err != nil {
return errors.Wrapf(err, "error streaming pod log")
}
+3 -3
View File
@@ -24,8 +24,8 @@ import (
"net/http"
"sort"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -134,7 +134,7 @@ func (a *API) checkHTTPTriggerDuplicates(ctx context.Context, t *fv1.HTTPTrigger
continue
}
urlMatch := false
if ht.Spec.RelativeURL == t.Spec.RelativeURL || (ht.Spec.Prefix != nil && t.Spec.Prefix != nil && *ht.Spec.Prefix != "" && *ht.Spec.Prefix == *t.Spec.Prefix) {
if (ht.Spec.RelativeURL != "" && ht.Spec.RelativeURL == t.Spec.RelativeURL) || (ht.Spec.Prefix != nil && t.Spec.Prefix != nil && *ht.Spec.Prefix != "" && *ht.Spec.Prefix == *t.Spec.Prefix) {
urlMatch = true
}
methodMatch := false
+2 -2
View File
@@ -21,8 +21,8 @@ import (
"io"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+2 -2
View File
@@ -19,8 +19,8 @@ package controller
import (
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
)
+2 -2
View File
@@ -23,8 +23,8 @@ import (
"net/http"
"github.com/dustin/go-humanize"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+2 -2
View File
@@ -22,8 +22,8 @@ import (
"net/http/httputil"
"net/url"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"go.uber.org/zap"
)
+2 -2
View File
@@ -21,8 +21,8 @@ import (
"io"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
"github.com/robfig/cron"
+2 -2
View File
@@ -21,8 +21,8 @@ import (
"io"
"net/http"
"github.com/emicklei/go-restful"
restfulspec "github.com/emicklei/go-restful-openapi"
restfulspec "github.com/emicklei/go-restful-openapi/v2"
restful "github.com/emicklei/go-restful/v3"
"github.com/go-openapi/spec"
"github.com/gorilla/mux"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+2 -9
View File
@@ -28,7 +28,6 @@ import (
"github.com/gorilla/mux"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.uber.org/zap"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
@@ -263,14 +262,8 @@ func (executor *Executor) GetHandler() http.Handler {
}
// Serve starts an HTTP server.
func (executor *Executor) Serve(ctx context.Context, port int, openTracingEnabled bool) {
var handler http.Handler
if openTracingEnabled {
handler = &ochttp.Handler{Handler: executor.GetHandler()}
} else {
handler = otelUtils.GetHandlerWithOTEL(executor.GetHandler(), "fission-executor", otelUtils.UrlsToIgnore("/healthz"))
}
func (executor *Executor) Serve(ctx context.Context, port int) {
handler := otelUtils.GetHandlerWithOTEL(executor.GetHandler(), "fission-executor", otelUtils.UrlsToIgnore("/healthz"))
httpserver.StartServer(ctx, executor.logger, "executor", fmt.Sprintf("%d", port), handler)
}
-6
View File
@@ -27,13 +27,11 @@ import (
"github.com/hashicorp/go-retryablehttp"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.uber.org/zap"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
ferror "github.com/fission/fission/pkg/error"
"github.com/fission/fission/pkg/utils/tracing"
)
type (
@@ -57,10 +55,6 @@ type (
// MakeClient initializes and returns a Client instance.
func MakeClient(logger *zap.Logger, executorURL string) *Client {
hc := retryablehttp.NewClient()
if tracing.TracingEnabled(logger) {
hc.HTTPClient.Transport = &ochttp.Transport{Base: hc.HTTPClient.Transport}
}
c := &Client{
logger: logger.Named("executor_client"),
executorURL: strings.TrimSuffix(executorURL, "/"),
+1 -1
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+1 -1
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+2 -2
View File
@@ -253,7 +253,7 @@ func (executor *Executor) getFunctionServiceFromCache(ctx context.Context, fn *f
// StartExecutor Starts executor and the executor components such as Poolmgr,
// deploymgr and potential future executor types
func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace string, envBuilderNamespace string, port int, openTracingEnabled bool) error {
func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace string, envBuilderNamespace string, port int) error {
fissionClient, kubernetesClient, _, metricsClient, err := crd.MakeFissionClient()
if err != nil {
return errors.Wrap(err, "failed to get kubernetes client")
@@ -383,7 +383,7 @@ func StartExecutor(ctx context.Context, logger *zap.Logger, functionNamespace st
}
go reaper.CleanupRoleBindings(ctx, logger, kubernetesClient, fissionClient, functionNamespace, envBuilderNamespace, time.Minute*30)
go metrics.ServeMetrics(ctx, logger)
go api.Serve(ctx, port, openTracingEnabled)
go api.Serve(ctx, port)
return nil
}
+1 -1
View File
@@ -174,7 +174,7 @@ func TestExecutor(t *testing.T) {
// create poolmgr
port := 9999
ctx := context.Background()
err = StartExecutor(ctx, logger, functionNs, "fission-builder", port, true)
err = StartExecutor(ctx, logger, functionNs, "fission-builder", port)
if err != nil {
log.Panicf("failed to start poolmgr: %v", err)
}
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -249,7 +249,7 @@ func (deploy *NewDeploy) getDeploymentSpec(ctx context.Context, fn *fv1.Function
Env: []apiv1.EnvVar{
{
Name: fv1.ResourceVersionCount,
Value: fmt.Sprintf("%v", rvCount),
Value: fmt.Sprintf("%d", rvCount),
},
},
// https://istio.io/docs/setup/kubernetes/additional-setup/requirements/
@@ -264,13 +264,13 @@ func (deploy *NewDeploy) RefreshFuncPods(ctx context.Context, logger *zap.Logger
// Ideally there should be only one deployment but for now we rely on label/selector to ensure that condition
for _, deployment := range dep.Items {
rvCount, err := referencedResourcesRVSum(ctx, deploy.kubernetesClient, deployment.Namespace, f.Spec.Secrets, f.Spec.ConfigMaps)
rvCount, err := referencedResourcesRVSum(ctx, deploy.kubernetesClient, f.ObjectMeta.Namespace, f.Spec.Secrets, f.Spec.ConfigMaps)
if err != nil {
return err
}
patch := fmt.Sprintf(`{"spec" : {"template": {"spec":{"containers":[{"name": "%s", "env":[{"name": "%s", "value": "%v"}]}]}}}}`,
f.ObjectMeta.Name, fv1.ResourceVersionCount, rvCount)
patch := fmt.Sprintf(`{"spec" : {"template": {"spec":{"containers":[{"name": "%s", "image": "%s", "env":[{"name": "%s", "value": "%d"}]}]}}}}`,
env.ObjectMeta.Name, env.Spec.Runtime.Image, fv1.ResourceVersionCount, rvCount)
_, err = deploy.kubernetesClient.AppsV1().Deployments(deployment.ObjectMeta.Namespace).Patch(ctx, deployment.ObjectMeta.Name,
k8sTypes.StrategicMergePatchType,
@@ -0,0 +1,254 @@
package newdeploy
import (
"context"
"fmt"
"os"
"testing"
"time"
uuid "github.com/satori/go.uuid"
"github.com/stretchr/testify/assert"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes/fake"
k8sCache "k8s.io/client-go/tools/cache"
fv1 "github.com/fission/fission/pkg/apis/core/v1"
"github.com/fission/fission/pkg/executor/util"
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
fClient "github.com/fission/fission/pkg/generated/clientset/versioned/fake"
genInformer "github.com/fission/fission/pkg/generated/informers/externalversions"
"github.com/fission/fission/pkg/utils"
"github.com/fission/fission/pkg/utils/loggerfactory"
)
const (
defaultNamespace string = "default"
functionNamespace string = "fission-function"
envName string = "newdeploy-test-env"
functionName string = "newdeploy-test-func"
configmapName string = "newdeploy-test-configmap"
)
func runInformers(ctx context.Context, informers []k8sCache.SharedIndexInformer) {
// Run all informers
for _, informer := range informers {
go informer.Run(ctx.Done())
}
}
func TestRefreshFuncPods(t *testing.T) {
os.Setenv("DEBUG_ENV", "true")
logger := loggerfactory.GetLogger()
kubernetesClient := fake.NewSimpleClientset()
fissionClient := fClient.NewSimpleClientset()
informerFactory := genInformer.NewSharedInformerFactory(fissionClient, time.Minute*30)
funcInformer := informerFactory.Core().V1().Functions()
envInformer := informerFactory.Core().V1().Environments()
newDeployInformerFactory, err := utils.GetInformerFactoryByExecutor(kubernetesClient, fv1.ExecutorTypeNewdeploy, time.Minute*30)
if err != nil {
t.Fatalf("Error creating informer factory: %s", err)
}
deployInformer := newDeployInformerFactory.Apps().V1().Deployments()
svcInformer := newDeployInformerFactory.Core().V1().Services()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
err = BuildConfigMap(ctx, kubernetesClient, functionNamespace, fv1.RuntimePodSpecConfigmap, map[string]string{})
if err != nil {
t.Fatalf("Error building configmap: %s", err)
}
podSpecPatch, err := util.GetSpecFromConfigMap(ctx, kubernetesClient, fv1.RuntimePodSpecConfigmap, functionNamespace)
if err != nil {
t.Fatalf("Error creating pod spec: %s", err)
}
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
if err != nil {
t.Fatalf("Error creating fetcher config: %s", err)
}
executor, err := MakeNewDeploy(logger, fissionClient, kubernetesClient, functionNamespace, fetcherConfig, "test",
funcInformer, envInformer, deployInformer, svcInformer, podSpecPatch)
if err != nil {
t.Fatalf("new deploy manager creation failed: %s", err)
}
ndm := executor.(*NewDeploy)
go ndm.Run(ctx)
t.Log("New deploy manager started")
runInformers(ctx, []k8sCache.SharedIndexInformer{
envInformer.Informer(),
funcInformer.Informer(),
deployInformer.Informer(),
svcInformer.Informer(),
})
t.Log("Informers required for new deploy manager started")
if ok := k8sCache.WaitForCacheSync(ctx.Done(), ndm.deplListerSynced, ndm.svcListerSynced); !ok {
t.Fatal("Timed out waiting for caches to sync")
}
envSpec := &fv1.Environment{
ObjectMeta: metav1.ObjectMeta{
Name: envName,
Namespace: defaultNamespace,
UID: "83c82da2-81e9-4ebd-867e-f383e65e603f",
},
Spec: fv1.EnvironmentSpec{
Version: 1,
Runtime: fv1.Runtime{
Image: "gcr.io/xyz",
},
},
}
_, err = fissionClient.CoreV1().Environments(defaultNamespace).Create(ctx, envSpec, metav1.CreateOptions{})
if err != nil {
t.Fatalf("creating environment failed : %s", err)
}
envRes, err := fissionClient.CoreV1().Environments(defaultNamespace).Get(ctx, envName, metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting environment: %s", err)
}
assert.Equal(t, envRes.ObjectMeta.Name, envName)
funcUID, err := uuid.NewV4()
if err != nil {
t.Fatal(err)
}
funcSpec := fv1.Function{
ObjectMeta: metav1.ObjectMeta{
Name: functionName,
Namespace: defaultNamespace,
UID: types.UID(funcUID.String()),
},
Spec: fv1.FunctionSpec{
Environment: fv1.EnvironmentReference{
Name: envName,
Namespace: defaultNamespace,
},
InvokeStrategy: fv1.InvokeStrategy{
ExecutionStrategy: fv1.ExecutionStrategy{
ExecutorType: fv1.ExecutorTypeNewdeploy,
},
},
},
}
_, err = fissionClient.CoreV1().Functions(defaultNamespace).Create(ctx, &funcSpec, metav1.CreateOptions{})
if err != nil {
t.Fatalf("creating function failed : %s", err)
}
funcRes, err := fissionClient.CoreV1().Functions(defaultNamespace).Get(ctx, functionName, metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting function: %s", err)
}
assert.Equal(t, funcRes.ObjectMeta.Name, functionName)
ctx2, cancel2 := context.WithCancel(context.Background())
wait.Until(func() {
t.Log("Checking for deployment")
ret, err := kubernetesClient.AppsV1().Deployments(functionNamespace).List(ctx2, metav1.ListOptions{})
if err != nil {
t.Fatalf("Error getting deployment: %s", err)
}
if len(ret.Items) > 0 {
t.Log("Deployment created", ret.Items[0].Name)
cancel2()
}
}, time.Second*2, ctx2.Done())
err = BuildConfigMap(ctx, kubernetesClient, defaultNamespace, configmapName, map[string]string{
"test-key": "test-value",
})
if err != nil {
t.Fatalf("Error building configmap: %s", err)
}
t.Log("Adding configmap to function")
funcRes.Spec.ConfigMaps = []fv1.ConfigMapReference{
{
Name: configmapName,
Namespace: defaultNamespace,
},
}
_, err = fissionClient.CoreV1().Functions(defaultNamespace).Update(ctx, funcRes, metav1.UpdateOptions{})
if err != nil {
t.Fatalf("Error updating function: %s", err)
}
funcRes, err = fissionClient.CoreV1().Functions(defaultNamespace).Get(ctx, functionName, metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting function: %s", err)
}
assert.Greater(t, len(funcRes.Spec.ConfigMaps), 0)
err = ndm.RefreshFuncPods(ctx, logger, *funcRes)
if err != nil {
t.Fatalf("Error refreshing function pods: %s", err)
}
funcLabels := ndm.getDeployLabels(funcRes.ObjectMeta, envRes.ObjectMeta)
dep, err := kubernetesClient.AppsV1().Deployments(metav1.NamespaceAll).List(ctx, metav1.ListOptions{
LabelSelector: labels.Set(funcLabels).AsSelector().String(),
})
if err != nil {
t.Fatalf("Error getting deployment: %s", err)
}
assert.Equal(t, len(dep.Items), 1)
cm, err := kubernetesClient.CoreV1().ConfigMaps(defaultNamespace).Get(ctx, configmapName, metav1.GetOptions{})
if err != nil {
t.Fatalf("Error getting configmap: %s", err)
}
assert.Equal(t, cm.ObjectMeta.Name, configmapName)
updatedDepl := dep.Items[0]
resourceVersionMatch := false
assert.Equal(t, len(updatedDepl.Spec.Template.Spec.Containers), 2)
for _, v := range updatedDepl.Spec.Template.Spec.Containers {
if v.Name == envName {
assert.Greater(t, len(v.Env), 0)
for _, env := range v.Env {
if env.Name == fv1.ResourceVersionCount {
assert.Equal(t, env.Value, cm.ObjectMeta.ResourceVersion)
resourceVersionMatch = true
}
}
}
}
assert.True(t, resourceVersionMatch)
}
func FakeResourceVersion() string {
return fmt.Sprint(time.Now().Nanosecond())[:6]
}
func BuildConfigMap(ctx context.Context, kubernetesClient *fake.Clientset, namespace, name string, data map[string]string) error {
testConfigMap := apiv1.ConfigMap{
TypeMeta: metav1.TypeMeta{
Kind: "ConfigMap",
APIVersion: "v1",
},
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
ResourceVersion: FakeResourceVersion(),
},
Data: data,
}
_, err := kubernetesClient.CoreV1().ConfigMaps(namespace).Create(ctx, &testConfigMap, metav1.CreateOptions{})
return err
}
+4 -4
View File
@@ -278,11 +278,11 @@ func (gpm *GenericPoolManager) RefreshFuncPods(ctx context.Context, logger *zap.
}
funcSvc, err := gp.fsCache.GetByFunction(&f.ObjectMeta)
if err != nil {
return err
}
gp.fsCache.DeleteEntry(funcSvc)
// delete function service address from cache only when function service address found in cache
if err == nil {
gp.fsCache.DeleteEntry(funcSvc)
}
funcLabels := gp.labelsForFunction(&f.ObjectMeta)
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+1 -1
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+1 -1
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+1 -1
View File
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"fmt"
"os"
"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"
)
// GetFeatureConfig reads the configMap file and unmarshals the config into a feature config struct
+1 -9
View File
@@ -10,14 +10,12 @@ import (
"time"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.uber.org/zap"
"golang.org/x/net/context/ctxhttp"
ferror "github.com/fission/fission/pkg/error"
"github.com/fission/fission/pkg/fetcher"
"github.com/fission/fission/pkg/utils/tracing"
)
type (
@@ -29,13 +27,7 @@ type (
)
func MakeClient(logger *zap.Logger, fetcherUrl string) *Client {
var hc *http.Client
if tracing.TracingEnabled(logger) {
hc = &http.Client{Transport: &ochttp.Transport{}}
} else {
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
}
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
return &Client{
logger: logger.Named("fetcher_client"),
url: strings.TrimSuffix(fetcherUrl, "/"),
+7 -11
View File
@@ -34,8 +34,6 @@ type Config struct {
sharedCfgMapPath string
serviceAccount string
jaegerCollectorEndpoint string
}
func getFetcherResources() (apiv1.ResourceRequirements, error) {
@@ -82,14 +80,13 @@ func MakeFetcherConfig(sharedMountPath string) (*Config, error) {
}
return &Config{
resourceRequirements: resources,
fetcherImage: fetcherImage,
fetcherImagePullPolicy: utils.GetImagePullPolicy(fetcherImagePullPolicy),
sharedMountPath: sharedMountPath,
sharedSecretPath: "/secrets",
sharedCfgMapPath: "/configs",
jaegerCollectorEndpoint: os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"),
serviceAccount: fv1.FissionFetcherSA,
resourceRequirements: resources,
fetcherImage: fetcherImage,
fetcherImagePullPolicy: utils.GetImagePullPolicy(fetcherImagePullPolicy),
sharedMountPath: sharedMountPath,
sharedSecretPath: "/secrets",
sharedCfgMapPath: "/configs",
serviceAccount: fv1.FissionFetcherSA,
}, nil
}
@@ -169,7 +166,6 @@ func (cfg *Config) fetcherCommand(extraArgs ...string) []string {
command := []string{"/fetcher",
"-secret-dir", cfg.sharedSecretPath,
"-cfgmap-dir", cfg.sharedCfgMapPath,
"-jaeger-collector-endpoint", cfg.jaegerCollectorEndpoint,
}
command = append(command, extraArgs...)
+1 -9
View File
@@ -31,7 +31,6 @@ import (
"github.com/mholt/archiver/v3"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"go.opencensus.io/plugin/ochttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.uber.org/zap"
"golang.org/x/net/context/ctxhttp"
@@ -53,7 +52,6 @@ import (
storageSvcClient "github.com/fission/fission/pkg/storagesvc/client"
"github.com/fission/fission/pkg/utils"
otelUtils "github.com/fission/fission/pkg/utils/otel"
"github.com/fission/fission/pkg/utils/tracing"
)
type (
@@ -107,13 +105,7 @@ func MakeFetcher(logger *zap.Logger, sharedVolumePath string, sharedSecretPath s
return nil, errors.Wrap(err, "error reading pod namespace from downward volume")
}
var hc *http.Client
if tracing.TracingEnabled(logger) {
hc = &http.Client{Transport: &ochttp.Transport{}}
} else {
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
}
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
return &Fetcher{
logger: fLogger,
sharedVolumePath: sharedVolumePath,
-2
View File
@@ -22,11 +22,9 @@ import (
fv1 "github.com/fission/fission/pkg/apis/core/v1"
)
//
// Fission-Environment interface. The following types are not
// exposed in the Fission API, but rather used by Fission to
// talk to environments.
//
type (
FetchRequestType int
+7 -8
View File
@@ -61,15 +61,12 @@ func (opts *GetURLSubCommand) do(input cli.Input) error {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("Error getting URL. Exited with Status: %v", resp.Status)
return fmt.Errorf("Error getting URL. Exited with Status: %s", resp.Status)
}
archiveURL, err := url.Parse(resp.Header.Get("X-FISSION-ARCHIVEURL"))
if err != nil {
return err
}
storageType := resp.Header.Get("X-FISSION-STORAGETYPE")
if archiveURL.Scheme == "file" {
if storageType == "local" {
storageSvc, err := opts.Client().V1().Misc().GetSvcURL("application=fission-storage")
if err != nil {
return err
@@ -77,8 +74,10 @@ func (opts *GetURLSubCommand) do(input cli.Input) error {
storagesvcURL := "http://" + storageSvc
client := storagesvcClient.MakeClient(storagesvcURL)
fmt.Printf("URL: %s", client.GetUrl(archiveID))
} else {
fmt.Printf("URL: %s", archiveURL.String())
} else if storageType == "s3" {
storageBucket := resp.Header.Get("X-FISSION-BUCKET")
s3url := fmt.Sprintf("https://%s.s3.amazonaws.com/%s", storageBucket, archiveID)
fmt.Printf("URL: %s", s3url)
}
return nil

Some files were not shown because too many files have changed in this diff Show More