Compare commits
37
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12d323e32f | ||
|
|
2882e0d3e7 | ||
|
|
79b41ec070 | ||
|
|
05130949ad | ||
|
|
dea7b2be94 | ||
|
|
294ff5bb19 | ||
|
|
7dad7c8399 | ||
|
|
e0c09ce340 | ||
|
|
e4751d54cb | ||
|
|
ed6f4ea375 | ||
|
|
fef2d8f875 | ||
|
|
6971bcd287 | ||
|
|
b16010dfa3 | ||
|
|
9016b6d28c | ||
|
|
ce887f360a | ||
|
|
8238916340 | ||
|
|
b1f8ad8dca | ||
|
|
dca306d87f | ||
|
|
3b4211b581 | ||
|
|
5c4121ca1e | ||
|
|
a3fde534e2 | ||
|
|
63c1c25fda | ||
|
|
d32e09aaf9 | ||
|
|
1184864c14 | ||
|
|
9343eb9911 | ||
|
|
3ecf21a6f1 | ||
|
|
904413db6d | ||
|
|
3c8edab514 | ||
|
|
5c886e4cf4 | ||
|
|
dba9143f45 | ||
|
|
1abe4dadb7 | ||
|
|
9cedeb4fa6 | ||
|
|
899e6e96d6 | ||
|
|
7838debadf | ||
|
|
db13455a7b | ||
|
|
5838340594 | ||
|
|
655456ee03 |
@@ -17,7 +17,7 @@ assignees: ''
|
|||||||
<!-- If you tested with other services, for example Istio, please also provide the version of service as well. -->
|
<!-- If you tested with other services, for example Istio, please also provide the version of service as well. -->
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ fission --version
|
$ fission version
|
||||||
$ kubectl version
|
$ kubectl version
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ name: Code Scanning
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- '**.go'
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- '**.go'
|
||||||
- go.mod
|
- go.mod
|
||||||
@@ -25,19 +25,18 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- 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:
|
with:
|
||||||
path: ~/go/pkg/mod
|
go-version-file: "go.mod"
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
cache: true
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v1
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
languages: go
|
languages: go
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v1
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -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
@@ -3,69 +3,59 @@ name: Lint and Unit tests
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- "**.go"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- "**.go"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GOLANGCI_LINT_VERSION: v1.49.0
|
||||||
|
GOLANGCI_LINT_TIMEOUT: 5m
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.18.1
|
|
||||||
|
|
||||||
- name: Check out code
|
- 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:
|
with:
|
||||||
path: ~/go/pkg/mod
|
go-version-file: "go.mod"
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
cache: true
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Verify dependencies
|
- name: Verify dependencies
|
||||||
run: |
|
run: |
|
||||||
go mod verify
|
go mod verify
|
||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
LINT_VERSION=1.45.0
|
- name: Run golangci-lint
|
||||||
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
|
uses: golangci/golangci-lint-action@v3
|
||||||
tar xz --strip-components 1 --wildcards \*/golangci-lint
|
with:
|
||||||
mkdir -p bin && mv golangci-lint bin/
|
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
|
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}
|
||||||
|
|
||||||
- name: Run checks
|
- name: Detect git changes
|
||||||
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
STATUS=0
|
if [[ $(git diff --stat) != '' ]]; then
|
||||||
assert-nothing-changed() {
|
echo -e '❌ \033[0;31m. Fix lint changes.\033[0m'
|
||||||
local diff
|
git diff --color
|
||||||
"$@" >/dev/null || return 1
|
exit 1
|
||||||
if ! diff="$(git diff -U1 --color --exit-code)"; then
|
else
|
||||||
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
|
echo '✔ No issues detected. Have a nice day :-)'
|
||||||
git checkout -- .
|
fi
|
||||||
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
|
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: ./hack/runtests.sh
|
run: ./hack/runtests.sh
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: Fission CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "**.go"
|
- "**.go"
|
||||||
- "charts/**"
|
- "charts/**"
|
||||||
@@ -12,7 +12,7 @@ on:
|
|||||||
- go.sum
|
- go.sum
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "**.go"
|
- "**.go"
|
||||||
- "charts/**"
|
- "charts/**"
|
||||||
@@ -21,6 +21,10 @@ on:
|
|||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
HELM_VERSION: v3.9.0
|
||||||
|
KIND_VERSION: v0.14.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Job to run change detection
|
# Job to run change detection
|
||||||
integration-test:
|
integration-test:
|
||||||
@@ -28,40 +32,34 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindversion: ["v1.19.11", "v1.20.7", "v1.21.1"]
|
kindversion: ["v1.19.16", "v1.20.15", "v1.21.12"]
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: setup go
|
- name: setup go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.18.1
|
go-version-file: "go.mod"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Checkout sources
|
|
||||||
uses: actions/checkout@v2.3.4
|
|
||||||
with:
|
with:
|
||||||
repository: fission/examples
|
repository: fission/examples
|
||||||
path: 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
|
- name: Helm installation
|
||||||
uses: Azure/setup-helm@v1
|
uses: Azure/setup-helm@v3
|
||||||
with:
|
with:
|
||||||
version: v3.3.4
|
version: ${{ env.HELM_VERSION }}
|
||||||
|
|
||||||
- name: Kind Clutser
|
- name: Kind Clutser
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: engineerd/setup-kind@v0.5.0
|
||||||
with:
|
with:
|
||||||
image: kindest/node:${{ matrix.kindversion }}
|
image: kindest/node:${{ matrix.kindversion }}
|
||||||
version: v0.11.1
|
version: ${{ env.KIND_VERSION }}
|
||||||
config: kind.yaml
|
config: kind.yaml
|
||||||
|
|
||||||
- name: Configuring and testing the Installation
|
- name: Configuring and testing the Installation
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
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: Run GoReleaser
|
||||||
|
uses: goreleaser/goreleaser-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
args: release
|
||||||
|
env:
|
||||||
|
GORELEASER_CURRENT_TAG: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||||
|
|
||||||
|
#ToDo - Verify and upload releases
|
||||||
@@ -3,100 +3,98 @@ name: Fission CI upgrade
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- "**.go"
|
||||||
- 'charts/**'
|
- "charts/**"
|
||||||
- 'test/**'
|
- "test/**"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '**.go'
|
- "**.go"
|
||||||
- 'charts/**'
|
- "charts/**"
|
||||||
- 'test/**'
|
- "test/**"
|
||||||
- go.mod
|
- go.mod
|
||||||
- go.sum
|
- go.sum
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
HELM_VERSION: v3.9.0
|
||||||
|
KIND_VERSION: v0.14.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upgrade-test:
|
upgrade-test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
kindimage : [ 'kindest/node:v1.19.11' ]
|
kindimage: ["kindest/node:v1.19.16"]
|
||||||
os: [ ubuntu-latest ]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Setup go
|
- name: Checkout action sources
|
||||||
uses: actions/setup-go@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
go-version: 1.18.1
|
|
||||||
|
|
||||||
- name: Checkout action sources
|
- name: Setup go
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version-file: "go.mod"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- name: Setup Helm
|
||||||
with:
|
uses: Azure/setup-helm@v3
|
||||||
path: ~/go/pkg/mod
|
with:
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
version: ${{ env.HELM_VERSION }}
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
|
|
||||||
- name: Setup Helm
|
- name: Setup Kind Clutser
|
||||||
uses: Azure/setup-helm@v1
|
uses: engineerd/setup-kind@v0.5.0
|
||||||
with:
|
with:
|
||||||
version: v3.3.4
|
image: ${{ matrix.kindimage }}
|
||||||
|
version: ${{ env.KIND_VERSION }}
|
||||||
|
|
||||||
- name: Setup Kind Clutser
|
- name: Install GoReleaser
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: goreleaser/goreleaser-action@v2
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.kindimage }}
|
install-only: true
|
||||||
version: v0.11.1
|
|
||||||
|
|
||||||
- name: Install GoReleaser
|
- name: Setup kubectl & fetch node information
|
||||||
uses: goreleaser/goreleaser-action@v2
|
run: |
|
||||||
with:
|
kubectl cluster-info --context kind-kind
|
||||||
install-only: true
|
kubectl get nodes
|
||||||
|
kubectl get storageclasses.storage.k8s.io
|
||||||
|
|
||||||
- name: Setup kubectl & fetch node information
|
- name: Dump system info
|
||||||
run: |
|
run: |
|
||||||
kubectl cluster-info --context kind-kind
|
source ./test/upgrade_test/fission_objects.sh dump_system_info
|
||||||
kubectl get nodes
|
|
||||||
kubectl get storageclasses.storage.k8s.io
|
|
||||||
|
|
||||||
- name: Dump system info
|
- name: Install and configure previous stable fission
|
||||||
run: |
|
run: |
|
||||||
source ./test/upgrade_test/fission_objects.sh dump_system_info
|
source ./test/upgrade_test/fission_objects.sh install_stable_release \
|
||||||
|
&& create_fission_objects \
|
||||||
|
&& test_fission_objects
|
||||||
|
|
||||||
- name: Install and configure previous stable fission
|
- name: Upgrade fission to latest
|
||||||
run: |
|
run: |
|
||||||
source ./test/upgrade_test/fission_objects.sh install_stable_release \
|
source ./test/upgrade_test/fission_objects.sh build_docker_images \
|
||||||
&& create_fission_objects \
|
&& kind_image_load \
|
||||||
&& test_fission_objects
|
&& install_current_release \
|
||||||
|
&& install_fission_cli
|
||||||
|
|
||||||
- name: Upgrade fission to latest
|
- name: Test previously created fission objects with new release
|
||||||
run: |
|
run: |
|
||||||
source ./test/upgrade_test/fission_objects.sh build_docker_images \
|
source ./test/upgrade_test/fission_objects.sh test_fission_objects
|
||||||
&& kind_image_load \
|
|
||||||
&& install_current_release \
|
|
||||||
&& install_fission_cli
|
|
||||||
|
|
||||||
- name: Test previously created fission objects with new release
|
- name: Collect Fission Dump
|
||||||
run: |
|
if: ${{ always() }}
|
||||||
source ./test/upgrade_test/fission_objects.sh test_fission_objects
|
run: |
|
||||||
|
command -v fission && fission support dump
|
||||||
|
|
||||||
- name: Collect Fission Dump
|
- name: Archive fission dump
|
||||||
if: ${{ always() }}
|
if: ${{ failure() }}
|
||||||
run: |
|
uses: actions/upload-artifact@v2
|
||||||
command -v fission && fission support dump
|
with:
|
||||||
|
name: fission-dump
|
||||||
- name: Archive fission dump
|
path: fission-dump/*.zip
|
||||||
if: ${{ failure() }}
|
retention-days: 5
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: fission-dump
|
|
||||||
path: fission-dump/*.zip
|
|
||||||
retention-days: 5
|
|
||||||
|
|||||||
@@ -33,3 +33,5 @@ local/
|
|||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
manifest/
|
manifest/
|
||||||
|
.vscode/
|
||||||
|
coverage.txt
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
# Default linter
|
# Default linter
|
||||||
- deadcode
|
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- structcheck
|
|
||||||
- typecheck
|
- typecheck
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
|
||||||
# Additional linters
|
# Additional linters
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
@@ -22,7 +19,6 @@ linters:
|
|||||||
# - dogsled
|
# - dogsled
|
||||||
# - dupl
|
# - dupl
|
||||||
# - gosec
|
# - gosec
|
||||||
# - ifshort
|
|
||||||
# - nilerr
|
# - nilerr
|
||||||
# - prealloc
|
# - prealloc
|
||||||
# - revive
|
# - revive
|
||||||
|
|||||||
+3
-4
@@ -8,7 +8,6 @@ release:
|
|||||||
header: |
|
header: |
|
||||||
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
|
Release Highlights: https://fission.io/docs/releases/{{ .Tag }}/
|
||||||
Install Guide: https://fission.io/docs/installation/
|
Install Guide: https://fission.io/docs/installation/
|
||||||
Full Changelog: https://github.com/fission/fission/blob/master/CHANGELOG.md
|
|
||||||
extra_files:
|
extra_files:
|
||||||
- glob: ./manifest/charts/*
|
- glob: ./manifest/charts/*
|
||||||
- glob: ./manifest/yamls/*
|
- glob: ./manifest/yamls/*
|
||||||
@@ -27,9 +26,9 @@ builds:
|
|||||||
- -X github.com/fission/fission/pkg/info.BuildDate={{.Date}}
|
- -X github.com/fission/fission/pkg/info.BuildDate={{.Date}}
|
||||||
- -X github.com/fission/fission/pkg/info.Version={{.Tag}}
|
- -X github.com/fission/fission/pkg/info.Version={{.Tag}}
|
||||||
gcflags:
|
gcflags:
|
||||||
- all=-trimpath={{.Env.PWD}}
|
- all=-trimpath={{ if index .Env "GITHUB_WORKSPACE"}}{{ .Env.GITHUB_WORKSPACE }}{{ else }}{{ .Env.PWD }}{{ end }}
|
||||||
asmflags:
|
asmflags:
|
||||||
- all=-trimpath={{.Env.PWD}}
|
- all=-trimpath={{ if index .Env "GITHUB_WORKSPACE"}}{{ .Env.GITHUB_WORKSPACE }}{{ else }}{{ .Env.PWD }}{{ end }}
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
@@ -258,7 +257,7 @@ docker_manifests:
|
|||||||
- fission/reporter:latest-arm64
|
- fission/reporter:latest-arm64
|
||||||
- fission/reporter:latest-armv7
|
- fission/reporter:latest-armv7
|
||||||
changelog:
|
changelog:
|
||||||
skip: true
|
skip: false
|
||||||
archives:
|
archives:
|
||||||
- id: fission
|
- id: fission
|
||||||
builds:
|
builds:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
pull_request_rules:
|
pull_request_rules:
|
||||||
- name: Automatic merge on approval
|
- name: Automatic merge on approval
|
||||||
conditions:
|
conditions:
|
||||||
- base=master
|
- base=main
|
||||||
- "#approved-reviews-by>=1"
|
- "#approved-reviews-by>=1"
|
||||||
- label=ready-to-merge
|
- label=ready-to-merge
|
||||||
- label!=hold-off-merging
|
- label!=hold-off-merging
|
||||||
|
|||||||
@@ -1,5 +1,27 @@
|
|||||||
# Changelog
|
# 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)
|
## [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)
|
[Full Changelog](https://github.com/fission/fission/compare/v1.16.0-rc2...v1.16.0)
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ debug-vars: print-GOOS print-GOARCH print-GOAMD64 print-VERSION print-TIMESTAMP
|
|||||||
check: test-run build-fission-cli clean
|
check: test-run build-fission-cli clean
|
||||||
|
|
||||||
code-checks:
|
code-checks:
|
||||||
hack/verify-gofmt.sh
|
golangci-lint run
|
||||||
hack/verify-govet.sh
|
|
||||||
hack/verify-staticcheck.sh
|
|
||||||
|
|
||||||
# run basic check scripts
|
# run basic check scripts
|
||||||
test-run: code-checks
|
test-run: code-checks
|
||||||
@@ -92,7 +90,10 @@ generate-swagger-doc:
|
|||||||
generate-cli-docs:
|
generate-cli-docs:
|
||||||
go run tools/cmd-docs/main.go -o "../fission.io/content/en/docs/reference/fission-cli"
|
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: 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
|
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
|
cp tools/crd-ref-docs/header.md crd_docs.md
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<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">
|
<img alt="Fission Licence" src="https://img.shields.io/github/license/fission/fission">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/fission/fission/releases">
|
<a href="https://github.com/fission/fission/releases">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<a href="https://github.com/fission/fission/graphs/contributors">
|
<a href="https://github.com/fission/fission/graphs/contributors">
|
||||||
<img alt="Fission contributors" src="https://img.shields.io/github/contributors/fission/fission">
|
<img alt="Fission contributors" src="https://img.shields.io/github/contributors/fission/fission">
|
||||||
</a>
|
</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">
|
<img alt="Commit Activity" src="https://img.shields.io/github/commit-activity/m/fission/fission">
|
||||||
</a>
|
</a>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: fission-all
|
name: fission-all
|
||||||
version: v1.17.0-rc1
|
version: v1.17.0-rc2
|
||||||
appVersion: v1.17.0-rc1
|
appVersion: v1.17.0-rc2
|
||||||
description: Fission is a fast serverless framework for Kubernetes.
|
description: Fission is a fast serverless framework for Kubernetes.
|
||||||
home: https://fission.io/
|
home: https://fission.io/
|
||||||
icon: https://fission.io/images/fission-logo-white.svg
|
icon: https://fission.io/images/fission-logo-white.svg
|
||||||
|
|||||||
@@ -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
|
- name: OTEL_PROPAGATORS
|
||||||
value: "{{ .Values.openTelemetry.propagators }}"
|
value: "{{ .Values.openTelemetry.propagators }}"
|
||||||
{{- end }}
|
{{- 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 }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
- name: HELM_RELEASE_NAME
|
- name: HELM_RELEASE_NAME
|
||||||
value: {{ .Release.Name | quote }}
|
value: {{ .Release.Name | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- 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:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.controller.resources | nindent 10 }}
|
{{- toYaml .Values.controller.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ metadata:
|
|||||||
{{- if .Values.serviceMonitor.namespace }}
|
{{- if .Values.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
namespace: {{ .Values.serviceMonitor.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
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: {{ $.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 }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
- name: HELM_RELEASE_NAME
|
- name: HELM_RELEASE_NAME
|
||||||
value: {{ .Release.Name | quote }}
|
value: {{ .Release.Name | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.executor.resources | nindent 10 }}
|
{{- toYaml .Values.executor.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ metadata:
|
|||||||
{{- if .Values.serviceMonitor.namespace }}
|
{{- if .Values.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
namespace: {{ .Values.serviceMonitor.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ spec:
|
|||||||
fieldRef:
|
fieldRef:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
fieldPath: spec.nodeName
|
fieldPath: spec.nodeName
|
||||||
- name: OPENTRACING_ENABLED
|
|
||||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--logger"]
|
args: ["--logger"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@@ -161,8 +159,6 @@ spec:
|
|||||||
key: password
|
key: password
|
||||||
- name: LOG_PATH
|
- name: LOG_PATH
|
||||||
value: /var/log/fission/*.log
|
value: /var/log/fission/*.log
|
||||||
- name: OPENTRACING_ENABLED
|
|
||||||
value: {{ .Values.openTracing.enabled | default false | quote }}
|
|
||||||
{{- if .Values.logger.enableSecurityContext }}
|
{{- if .Values.logger.enableSecurityContext }}
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ spec:
|
|||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
|
{{- toYaml .Values.kubewatcher.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ spec:
|
|||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: metrics
|
||||||
env:
|
env:
|
||||||
- name: MESSAGE_QUEUE_TYPE
|
- name: MESSAGE_QUEUE_TYPE
|
||||||
value: kafka
|
value: kafka
|
||||||
@@ -44,7 +47,6 @@ spec:
|
|||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
# TLS authentication is TLS with authentication (2 way)
|
# TLS authentication is TLS with authentication (2 way)
|
||||||
# More info: https://docs.confluent.io/current/kafka/authentication_ssl.html#ssl-overview
|
# 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 }}"
|
value: "{{ .Values.mqt_keda.connector_images.aws_sqs.image }}:{{ .Values.mqt_keda.connector_images.aws_sqs.tag }}"
|
||||||
- name: STAN_IMAGE
|
- name: STAN_IMAGE
|
||||||
value: "{{ .Values.mqt_keda.connector_images.nats_steaming.image }}:{{ .Values.mqt_keda.connector_images.nats_steaming.tag }}"
|
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
|
- name: GCP-PUBSUB_IMAGE
|
||||||
value: "{{ .Values.mqt_keda.connector_images.gcp_pubsub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pubsub.tag }}"
|
value: "{{ .Values.mqt_keda.connector_images.gcp_pubsub.image }}:{{ .Values.mqt_keda.connector_images.gcp_pubsub.tag }}"
|
||||||
- name: REDIS_IMAGE
|
- name: REDIS_IMAGE
|
||||||
value: "{{ .Values.mqt_keda.connector_images.redis.image }}:{{ .Values.mqt_keda.connector_images.redis.tag }}"
|
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 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
|
{{- toYaml .Values.mqt_keda.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ spec:
|
|||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
- name: DISPLAY_ACCESS_LOG
|
- name: DISPLAY_ACCESS_LOG
|
||||||
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.router.resources | nindent 10 }}
|
{{- toYaml .Values.router.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ metadata:
|
|||||||
{{- if .Values.serviceMonitor.namespace }}
|
{{- if .Values.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
namespace: {{ .Values.serviceMonitor.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ spec:
|
|||||||
- name: STORAGE_S3_REGION
|
- name: STORAGE_S3_REGION
|
||||||
value: {{ .Values.persistence.s3.region }}
|
value: {{ .Values.persistence.s3.region }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
|
{{- toYaml .Values.storagesvc.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ metadata:
|
|||||||
name: storagesvc-monitor
|
name: storagesvc-monitor
|
||||||
{{- if .Values.serviceMonitor.namespace }}
|
{{- if .Values.serviceMonitor.namespace }}
|
||||||
namespace: {{ .Values.serviceMonitor.namespace }}
|
namespace: {{ .Values.serviceMonitor.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.serviceMonitor.additionalServiceMonitorLabels }}
|
||||||
|
labels:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ spec:
|
|||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
- name: PPROF_ENABLED
|
- name: PPROF_ENABLED
|
||||||
value: {{ .Values.pprof.enabled | quote }}
|
value: {{ .Values.pprof.enabled | quote }}
|
||||||
{{- include "opentracing.envs" . | indent 8 }}
|
|
||||||
{{- include "opentelemtry.envs" . | indent 8 }}
|
{{- include "opentelemtry.envs" . | indent 8 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.timer.resources | nindent 10 }}
|
{{- toYaml .Values.timer.resources | nindent 10 }}
|
||||||
|
|||||||
@@ -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.
|
## 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.
|
## Keep it empty for using latest tag.
|
||||||
##
|
##
|
||||||
imageTag: v1.17.0-rc1
|
imageTag: v1.17.0-rc2
|
||||||
|
|
||||||
## pullPolicy represents the pull policy to use for images in the chart.
|
## 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 represents the image of the fetcher component.
|
||||||
image: fission/fetcher
|
image: fission/fetcher
|
||||||
## imageTag represents the tag of the image of the fetcher component.
|
## imageTag represents the tag of the image of the fetcher component.
|
||||||
imageTag: v1.17.0-rc1
|
imageTag: v1.17.0-rc2
|
||||||
|
|
||||||
## Fetcher is only for to downloading or uploading archive.
|
## Fetcher is only for to downloading or uploading archive.
|
||||||
## Normally, you don't need to change the value here, unless necessary.
|
## Normally, you don't need to change the value here, unless necessary.
|
||||||
@@ -452,11 +452,33 @@ kafka:
|
|||||||
##
|
##
|
||||||
# version: "0.11.2.0"
|
# 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:
|
serviceMonitor:
|
||||||
enabled: false
|
enabled: false
|
||||||
##namespace in which you want to deploy servicemonitor
|
##namespace in which you want to deploy servicemonitor
|
||||||
##
|
##
|
||||||
namespace: ""
|
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.
|
## Persist data to a persistent volume.
|
||||||
##
|
##
|
||||||
@@ -479,7 +501,9 @@ persistence:
|
|||||||
# accessKeyId: <awsAccessKeyId>
|
# accessKeyId: <awsAccessKeyId>
|
||||||
# secretAccessKey: <awsSecretAccessKey>
|
# secretAccessKey: <awsSecretAccessKey>
|
||||||
# region: <awsRegion>
|
# region: <awsRegion>
|
||||||
|
## For Minio and other s3 compatible storage systems set endPoint property
|
||||||
|
# endPoint: <s3StorageUrl>
|
||||||
|
|
||||||
## A manually managed Persistent Volume Claim name
|
## A manually managed Persistent Volume Claim name
|
||||||
## Requires persistence.enabled: true
|
## Requires persistence.enabled: true
|
||||||
## If defined, PVC must be created manually before volume will be bound
|
## If defined, PVC must be created manually before volume will be bound
|
||||||
@@ -583,7 +607,7 @@ preUpgradeChecks:
|
|||||||
image: fission/pre-upgrade-checks
|
image: fission/pre-upgrade-checks
|
||||||
## pre-install/pre-upgrade checks image version
|
## pre-install/pre-upgrade checks image version
|
||||||
##
|
##
|
||||||
imageTag: v1.17.0-rc1
|
imageTag: v1.17.0-rc2
|
||||||
|
|
||||||
## Fission post-install/post-upgrade reporting live in this image
|
## Fission post-install/post-upgrade reporting live in this image
|
||||||
##
|
##
|
||||||
@@ -639,23 +663,6 @@ authentication:
|
|||||||
##
|
##
|
||||||
jwtIssuer: fission
|
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
|
## OpenTelemetry is a set of tools for collecting, analyzing, and visualizing
|
||||||
## distributed tracing data across function calls.
|
## 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_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_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.
|
## 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"
|
tracesSampler: "parentbased_traceidratio"
|
||||||
## Each Sampler type defines its own expected input, if any.
|
## Each Sampler type defines its own expected input, if any.
|
||||||
@@ -696,6 +704,8 @@ openTelemetry:
|
|||||||
## jaeger - Jaeger uber-trace-id header
|
## jaeger - Jaeger uber-trace-id header
|
||||||
## xray - AWS X-Ray (third party)
|
## xray - AWS X-Ray (third party)
|
||||||
## ottrace - OpenTracing Trace (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"
|
propagators: "tracecontext,baggage"
|
||||||
|
|
||||||
@@ -706,25 +716,28 @@ mqt_keda:
|
|||||||
connector_images:
|
connector_images:
|
||||||
kafka:
|
kafka:
|
||||||
image: fission/keda-kafka-http-connector
|
image: fission/keda-kafka-http-connector
|
||||||
tag: v0.10
|
tag: v0.11
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: fission/keda-rabbitmq-http-connector
|
image: fission/keda-rabbitmq-http-connector
|
||||||
tag: v0.9
|
tag: v0.10
|
||||||
awskinesis:
|
awskinesis:
|
||||||
image: fission/keda-aws-kinesis-http-connector
|
image: fission/keda-aws-kinesis-http-connector
|
||||||
tag: v0.9
|
tag: v0.10
|
||||||
aws_sqs:
|
aws_sqs:
|
||||||
image: fission/keda-aws-sqs-http-connector
|
image: fission/keda-aws-sqs-http-connector
|
||||||
tag: v0.9
|
tag: v0.10
|
||||||
nats_steaming:
|
nats_steaming:
|
||||||
image: fission/keda-nats-streaming-http-connector
|
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:
|
gcp_pubsub:
|
||||||
image: fission/keda-gcp-pubsub-http-connector
|
image: fission/keda-gcp-pubsub-http-connector
|
||||||
tag: v0.4
|
tag: v0.5
|
||||||
redis:
|
redis:
|
||||||
image: fission/keda-redis-http-connector
|
image: fission/keda-redis-http-connector
|
||||||
tag: v0.2
|
tag: v0.3
|
||||||
|
|
||||||
## Pod resources as:
|
## Pod resources as:
|
||||||
## resources:
|
## resources:
|
||||||
@@ -782,3 +795,12 @@ builderPodSpec:
|
|||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
runAsUser: 10001
|
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,4 +1,4 @@
|
|||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
COPY builder /builder
|
COPY builder /builder
|
||||||
ENTRYPOINT ["/builder"]
|
ENTRYPOINT ["/builder"]
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ func main() {
|
|||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
err = os.MkdirAll(shareVolume, os.ModeDir|0700)
|
err = os.MkdirAll(shareVolume, os.ModeDir|0700)
|
||||||
if err != nil {
|
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,4 +1,4 @@
|
|||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
COPY fetcher /
|
COPY fetcher /
|
||||||
ENTRYPOINT ["/fetcher"]
|
ENTRYPOINT ["/fetcher"]
|
||||||
|
|||||||
@@ -25,14 +25,12 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/fetcher"
|
"github.com/fission/fission/pkg/fetcher"
|
||||||
"github.com/fission/fission/pkg/utils/httpserver"
|
"github.com/fission/fission/pkg/utils/httpserver"
|
||||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||||
"github.com/fission/fission/pkg/utils/tracing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -41,7 +39,6 @@ var (
|
|||||||
|
|
||||||
func Run(ctx context.Context, logger *zap.Logger) {
|
func Run(ctx context.Context, logger *zap.Logger) {
|
||||||
flag.Usage = fetcherUsage
|
flag.Usage = fetcherUsage
|
||||||
collectorEndpoint := flag.String("jaeger-collector-endpoint", "", "")
|
|
||||||
specializeOnStart := flag.Bool("specialize-on-startup", false, "Flag to activate specialize process at pod startup")
|
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")
|
specializePayload := flag.String("specialize-request", "", "JSON payload for specialize request")
|
||||||
secretDir := flag.String("secret-dir", "", "Path to shared secrets directory")
|
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 {
|
shutdown, err := otelUtils.InitProvider(ctx, logger, "Fission-Fetcher")
|
||||||
go func() {
|
if err != nil {
|
||||||
if err := tracing.RegisterTraceExporter(logger, *collectorEndpoint, "Fission-Fetcher"); err != nil {
|
logger.Fatal("error initializing provider for OTLP", zap.Error(err))
|
||||||
logger.Fatal("could not register trace exporter", zap.Error(err), zap.String("collector_endpoint", *collectorEndpoint))
|
}
|
||||||
}
|
if shutdown != nil {
|
||||||
}()
|
defer shutdown(ctx)
|
||||||
} 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tracer := otel.Tracer("fetcher")
|
tracer := otel.Tracer("fetcher")
|
||||||
@@ -129,12 +118,7 @@ func Run(ctx context.Context, logger *zap.Logger) {
|
|||||||
|
|
||||||
logger.Info("fetcher ready to receive requests")
|
logger.Info("fetcher ready to receive requests")
|
||||||
|
|
||||||
var handler http.Handler
|
handler := otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
|
||||||
if openTracingEnabled {
|
|
||||||
handler = &ochttp.Handler{Handler: mux}
|
|
||||||
} else {
|
|
||||||
handler = otelUtils.GetHandlerWithOTEL(mux, "fission-fetcher", otelUtils.UrlsToIgnore("/healthz", "/readiness-healthz"))
|
|
||||||
}
|
|
||||||
httpserver.StartServer(ctx, logger, "fetcher", "8000", handler)
|
httpserver.StartServer(ctx, logger, "fetcher", "8000", handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
COPY fission-bundle /
|
COPY fission-bundle /
|
||||||
ENTRYPOINT ["/fission-bundle"]
|
ENTRYPOINT ["/fission-bundle"]
|
||||||
|
|||||||
+19
-29
@@ -42,19 +42,18 @@ import (
|
|||||||
"github.com/fission/fission/pkg/utils/otel"
|
"github.com/fission/fission/pkg/utils/otel"
|
||||||
"github.com/fission/fission/pkg/utils/profile"
|
"github.com/fission/fission/pkg/utils/profile"
|
||||||
"github.com/fission/fission/pkg/utils/signals"
|
"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) {
|
func runController(ctx context.Context, logger *zap.Logger, port int) {
|
||||||
controller.Start(ctx, logger, port, false, openTracingEnabled)
|
controller.Start(ctx, logger, port, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runRouter(ctx context.Context, logger *zap.Logger, port int, executorUrl string, openTracingEnabled bool) {
|
func runRouter(ctx context.Context, logger *zap.Logger, port int, executorUrl string) {
|
||||||
router.Start(ctx, logger, port, executorUrl, openTracingEnabled)
|
router.Start(ctx, logger, port, executorUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runExecutor(ctx context.Context, logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string, openTracingEnabled bool) error {
|
func runExecutor(ctx context.Context, logger *zap.Logger, port int, functionNamespace, envBuilderNamespace string) error {
|
||||||
return executor.StartExecutor(ctx, logger, functionNamespace, envBuilderNamespace, port, openTracingEnabled)
|
return executor.StartExecutor(ctx, logger, functionNamespace, envBuilderNamespace, port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runKubeWatcher(ctx context.Context, logger *zap.Logger, routerUrl string) error {
|
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)
|
return mqt.StartScalerManager(ctx, logger, routerURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runStorageSvc(ctx context.Context, logger *zap.Logger, port int, storage storagesvc.Storage, openTracingEnabled bool) error {
|
func runStorageSvc(ctx context.Context, logger *zap.Logger, port int, storage storagesvc.Storage) error {
|
||||||
return storagesvc.Start(ctx, logger, storage, port, openTracingEnabled)
|
return storagesvc.Start(ctx, logger, storage, port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBuilderMgr(ctx context.Context, logger *zap.Logger, storageSvcUrl string, envBuilderNamespace string) error {
|
func runBuilderMgr(ctx context.Context, logger *zap.Logger, storageSvcUrl string, envBuilderNamespace string) error {
|
||||||
@@ -210,22 +209,13 @@ Options:
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
openTracingEnabled := tracing.TracingEnabled(logger)
|
shutdown, err := otel.InitProvider(ctx, logger, getServiceName(arguments))
|
||||||
if openTracingEnabled {
|
if err != nil {
|
||||||
err = tracing.RegisterTraceExporter(logger, os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"), getServiceName(arguments))
|
logger.Error("error initializing provider for OTLP", zap.Error(err), zap.Any("argument", arguments))
|
||||||
if err != nil {
|
return
|
||||||
logger.Error("failed to register trace exporter", zap.Error(err), zap.Any("argument", arguments))
|
}
|
||||||
return
|
if shutdown != nil {
|
||||||
}
|
defer shutdown(ctx)
|
||||||
} 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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
functionNs := getStringArgWithDefault(arguments["--namespace"], "fission-function")
|
functionNs := getStringArgWithDefault(arguments["--namespace"], "fission-function")
|
||||||
@@ -237,21 +227,21 @@ Options:
|
|||||||
|
|
||||||
if arguments["--controllerPort"] != nil {
|
if arguments["--controllerPort"] != nil {
|
||||||
port := getPort(logger, arguments["--controllerPort"])
|
port := getPort(logger, arguments["--controllerPort"])
|
||||||
runController(ctx, logger, port, openTracingEnabled)
|
runController(ctx, logger, port)
|
||||||
logger.Error("controller exited")
|
logger.Error("controller exited")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--routerPort"] != nil {
|
if arguments["--routerPort"] != nil {
|
||||||
port := getPort(logger, arguments["--routerPort"])
|
port := getPort(logger, arguments["--routerPort"])
|
||||||
runRouter(ctx, logger, port, executorUrl, openTracingEnabled)
|
runRouter(ctx, logger, port, executorUrl)
|
||||||
logger.Error("router exited")
|
logger.Error("router exited")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if arguments["--executorPort"] != nil {
|
if arguments["--executorPort"] != nil {
|
||||||
port := getPort(logger, arguments["--executorPort"])
|
port := getPort(logger, arguments["--executorPort"])
|
||||||
err = runExecutor(ctx, logger, port, functionNs, envBuilderNs, openTracingEnabled)
|
err = runExecutor(ctx, logger, port, functionNs, envBuilderNs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("executor exited", zap.Error(err))
|
logger.Error("executor exited", zap.Error(err))
|
||||||
return
|
return
|
||||||
@@ -314,7 +304,7 @@ Options:
|
|||||||
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
|
} else if arguments["--storageType"] == string(storagesvc.StorageTypeLocal) {
|
||||||
storage = storagesvc.NewLocalStorage("/fission")
|
storage = storagesvc.NewLocalStorage("/fission")
|
||||||
}
|
}
|
||||||
err := runStorageSvc(ctx, logger, port, storage, openTracingEnabled)
|
err := runStorageSvc(ctx, logger, port, storage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("storage service exited", zap.Error(err))
|
logger.Error("storage service exited", zap.Error(err))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
COPY pre-upgrade-checks /
|
COPY pre-upgrade-checks /
|
||||||
ENTRYPOINT ["/pre-upgrade-checks"]
|
ENTRYPOINT ["/pre-upgrade-checks"]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.15
|
FROM alpine:3.16
|
||||||
RUN apk add --update ca-certificates
|
RUN apk add --update ca-certificates
|
||||||
COPY reporter /
|
COPY reporter /
|
||||||
ENTRYPOINT ["/reporter"]
|
ENTRYPOINT ["/reporter"]
|
||||||
@@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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)
|
return t.SendEvent(ctx, event)
|
||||||
}
|
}
|
||||||
|
|
||||||
//EventCommand reports an event to analytics
|
// EventCommand reports an event to analytics
|
||||||
func EventCommand() *cobra.Command {
|
func EventCommand() *cobra.Command {
|
||||||
eventCmd := &cobra.Command{
|
eventCmd := &cobra.Command{
|
||||||
Use: "event",
|
Use: "event",
|
||||||
|
|||||||
+1280
-1098
File diff suppressed because it is too large
Load Diff
+593
-510
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -122,7 +122,7 @@ spec:
|
|||||||
description: BuildLog stores build log during the compilation.
|
description: BuildLog stores build log during the compilation.
|
||||||
type: string
|
type: string
|
||||||
buildstatus:
|
buildstatus:
|
||||||
default: Pending
|
default: pending
|
||||||
description: BuildStatus is the package build status.
|
description: BuildStatus is the package build status.
|
||||||
type: string
|
type: string
|
||||||
lastUpdateTimestamp:
|
lastUpdateTimestamp:
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
module.exports = async (context) => {
|
|
||||||
return {
|
|
||||||
status: 200,
|
|
||||||
body: "hello, world!\n"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,77 +1,69 @@
|
|||||||
module github.com/fission/fission
|
module github.com/fission/fission
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
contrib.go.opencensus.io/exporter/jaeger v0.2.1
|
github.com/Shopify/sarama v1.36.0
|
||||||
github.com/Shopify/sarama v1.32.0
|
|
||||||
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
|
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
||||||
github.com/dustin/go-humanize v1.0.0
|
github.com/dustin/go-humanize v1.0.0
|
||||||
github.com/emicklei/go-restful v2.15.0+incompatible
|
github.com/emicklei/go-restful-openapi/v2 v2.9.0
|
||||||
github.com/emicklei/go-restful-openapi v1.4.1
|
github.com/emicklei/go-restful/v3 v3.9.0
|
||||||
github.com/fatih/color v1.13.0
|
github.com/fatih/color v1.13.0
|
||||||
github.com/fsnotify/fsnotify v1.5.1
|
github.com/fsnotify/fsnotify v1.5.4
|
||||||
github.com/ghodss/yaml v1.0.0
|
|
||||||
github.com/go-git/go-git/v5 v5.4.2
|
github.com/go-git/go-git/v5 v5.4.2
|
||||||
github.com/go-openapi/spec v0.20.4
|
github.com/go-openapi/spec v0.20.7
|
||||||
github.com/golang-jwt/jwt/v4 v4.3.0
|
github.com/golang-jwt/jwt/v4 v4.4.2
|
||||||
github.com/gorilla/mux v1.8.0
|
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-multierror v1.1.1
|
||||||
github.com/hashicorp/go-retryablehttp v0.7.1
|
github.com/hashicorp/go-retryablehttp v0.7.1
|
||||||
github.com/imdario/mergo v0.3.12
|
github.com/imdario/mergo v0.3.13
|
||||||
github.com/influxdata/influxdb v1.9.6
|
github.com/influxdata/influxdb v1.10.0
|
||||||
github.com/mholt/archiver/v3 v3.5.1
|
github.com/mholt/archiver/v3 v3.5.1
|
||||||
github.com/minio/minio-go v6.0.14+incompatible
|
github.com/minio/minio-go v6.0.14+incompatible
|
||||||
github.com/ory/dockertest v3.3.5+incompatible
|
github.com/ory/dockertest v3.3.5+incompatible
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/prometheus/client_golang v1.12.1
|
github.com/prometheus/client_golang v1.13.0
|
||||||
github.com/prometheus/common v0.32.1
|
github.com/prometheus/common v0.37.0
|
||||||
github.com/robfig/cron v1.2.0
|
github.com/robfig/cron v1.2.0
|
||||||
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
|
||||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
|
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/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
|
github.com/wcharczuk/go-chart v2.0.1+incompatible
|
||||||
go.opencensus.io v0.23.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.34.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
|
go.opentelemetry.io/contrib/propagators/autoprop v0.34.0
|
||||||
go.opentelemetry.io/contrib/propagators/aws v1.7.0
|
go.opentelemetry.io/otel v1.9.0
|
||||||
go.opentelemetry.io/contrib/propagators/b3 v1.7.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0
|
||||||
go.opentelemetry.io/contrib/propagators/jaeger v1.7.0
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0
|
||||||
go.opentelemetry.io/contrib/propagators/ot v1.7.0
|
go.opentelemetry.io/otel/sdk v1.9.0
|
||||||
go.opentelemetry.io/otel v1.7.0
|
go.opentelemetry.io/otel/trace v1.9.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0
|
go.uber.org/zap v1.23.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0
|
golang.org/x/net v0.0.0-20220812174116-3211cb980234
|
||||||
go.opentelemetry.io/otel/sdk v1.7.0
|
google.golang.org/grpc v1.48.0
|
||||||
go.opentelemetry.io/otel/trace v1.7.0
|
k8s.io/api v0.25.0
|
||||||
go.uber.org/zap v1.21.0
|
k8s.io/apiextensions-apiserver v0.25.0
|
||||||
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
|
k8s.io/apimachinery v0.25.0
|
||||||
google.golang.org/grpc v1.47.0
|
k8s.io/client-go v0.25.0
|
||||||
k8s.io/api v0.23.4
|
k8s.io/metrics v0.25.0
|
||||||
k8s.io/apiextensions-apiserver v0.23.4
|
sigs.k8s.io/controller-runtime v0.13.0
|
||||||
k8s.io/apimachinery v0.23.4
|
sigs.k8s.io/yaml v1.3.0
|
||||||
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
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.99.0 // indirect
|
cloud.google.com/go v0.99.0 // indirect
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // 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 v14.2.0+incompatible // indirect
|
||||||
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
|
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
|
||||||
github.com/Azure/go-autorest/autorest/adal v0.9.13 // 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/autorest/date v0.3.0 // indirect
|
||||||
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
github.com/Azure/go-autorest/logger v0.2.1 // indirect
|
||||||
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
|
||||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // 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/acomagu/bufpipe v1.0.3 // indirect
|
||||||
github.com/andybalholm/brotli v1.0.1 // indirect
|
github.com/andybalholm/brotli v1.0.1 // indirect
|
||||||
github.com/aws/aws-sdk-go v1.42.34 // 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/cenkalti/backoff/v4 v4.1.3 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||||
github.com/containerd/continuity v0.2.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/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/docker/go-connections v0.4.0 // indirect
|
github.com/docker/go-connections v0.4.0 // indirect
|
||||||
github.com/docker/go-units 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/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/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
|
||||||
github.com/eapache/queue v1.1.0 // indirect
|
github.com/eapache/queue v1.1.0 // indirect
|
||||||
github.com/emirpasic/gods v1.12.0 // indirect
|
github.com/emirpasic/gods v1.12.0 // indirect
|
||||||
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
github.com/felixge/httpsnoop v1.0.3 // indirect
|
||||||
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
|
|
||||||
github.com/go-git/gcfg v1.5.0 // indirect
|
github.com/go-git/gcfg v1.5.0 // indirect
|
||||||
github.com/go-git/go-billy/v5 v5.3.1 // indirect
|
github.com/go-git/go-billy/v5 v5.3.1 // indirect
|
||||||
github.com/go-ini/ini v1.66.4 // indirect
|
github.com/go-ini/ini v1.66.4 // indirect
|
||||||
github.com/go-logr/logr v1.2.3 // indirect
|
github.com/go-logr/logr v1.2.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // 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/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/go-openapi/swag v0.19.15 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // 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/go-cmp v0.5.8 // indirect
|
||||||
github.com/google/gofuzz v1.1.0 // 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/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.3 // indirect
|
||||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.1 // 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/inconshreveable/mousetrap v1.0.0 // indirect
|
||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/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/gofork v1.7.6 // indirect
|
||||||
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
|
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
|
||||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // 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/klauspost/pgzip v1.2.5 // indirect
|
||||||
github.com/lib/pq v1.10.4 // indirect
|
github.com/lib/pq v1.10.4 // indirect
|
||||||
github.com/mailru/easyjson v0.7.6 // indirect
|
github.com/mailru/easyjson v0.7.6 // indirect
|
||||||
@@ -137,49 +128,49 @@ require (
|
|||||||
github.com/moby/spdystream v0.2.0 // indirect
|
github.com/moby/spdystream v0.2.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // 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/nwaples/rardecode v1.1.0 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.0.2 // indirect
|
github.com/opencontainers/image-spec v1.0.2 // indirect
|
||||||
github.com/opencontainers/runc v1.1.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.15 // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.8 // indirect
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
github.com/prometheus/client_model v0.2.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/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/sergi/go-diff v1.1.0 // indirect
|
github.com/sergi/go-diff v1.1.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.8.1 // 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/ulikunitz/xz v0.5.9 // indirect
|
||||||
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
github.com/xanzy/ssh-agent v0.3.0 // indirect
|
||||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // 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/contrib/propagators/aws v1.9.0 // indirect
|
||||||
go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect
|
go.opentelemetry.io/contrib/propagators/b3 v1.9.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v0.27.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.opentelemetry.io/proto/otlp v0.18.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.8.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/image v0.0.0-20190802002840-cff245a6509b // indirect
|
||||||
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // 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-20220728004956-3c1f35247d10 // indirect
|
||||||
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
|
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||||
golang.org/x/text v0.3.7 // indirect
|
golang.org/x/text v0.3.7 // indirect
|
||||||
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
|
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
|
||||||
google.golang.org/api v0.62.0 // indirect
|
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03 // 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/inf.v0 v0.9.1 // indirect
|
||||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
gotest.tools v2.2.0+incompatible // indirect
|
gotest.tools v2.2.0+incompatible // indirect
|
||||||
k8s.io/klog/v2 v2.30.0 // indirect
|
k8s.io/klog/v2 v2.70.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
|
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
|
||||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
|
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
|
||||||
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
|
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
|
||||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
|
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-4
@@ -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.
|
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)
|
## 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
|
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
|
b. In the repo fission/fission.io change version in version.sh file to latest version (x.y.z) and run build.sh script
|
||||||
|
|
||||||
|
|||||||
Executable
+16
@@ -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
@@ -1,2 +1,2 @@
|
|||||||
Install Guide: https://fission.io/docs/installation/
|
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
@@ -22,8 +22,8 @@ check_commands() {
|
|||||||
# Ensure we're on the master branch
|
# Ensure we're on the master branch
|
||||||
check_branch() {
|
check_branch() {
|
||||||
curr_branch=$(git rev-parse --abbrev-ref HEAD)
|
curr_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||||
if [ "$curr_branch" != "master" ]; then
|
if [ "$curr_branch" != "main" ]; then
|
||||||
echo "Not on master branch."
|
echo "Not on main branch."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "check_branch == PASSED"
|
echo "check_branch == PASSED"
|
||||||
@@ -39,14 +39,17 @@ check_clean() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_github_token() {
|
check_github_token() {
|
||||||
if [ ! -f "$HOME"/.github-token ]; then
|
if [ ! -f "$HOME"/.github-token ] && [ -z "$GITHUB_TOKEN" ]; then
|
||||||
echo "Error finding github access token at ${HOME}/.github-token"
|
echo "Error finding github access token at ${HOME}/.github-token or in GITHUB_TOKEN envvar"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "check_github_token == PASSED"
|
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
|
version=$1
|
||||||
if [ -z "$version" ]; then
|
if [ -z "$version" ]; then
|
||||||
@@ -66,6 +69,7 @@ check_github_token
|
|||||||
|
|
||||||
export GORELEASER_CURRENT_TAG=$version
|
export GORELEASER_CURRENT_TAG=$version
|
||||||
echo "Release version $GORELEASER_CURRENT_TAG "
|
echo "Release version $GORELEASER_CURRENT_TAG "
|
||||||
|
echo "DOCKER_CLI_EXPERIMENTAL $DOCKER_CLI_EXPERIMENTAL"
|
||||||
goreleaser release
|
goreleaser release
|
||||||
|
|
||||||
echo "############ DONE #############"
|
echo "############ DONE #############"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ limitations under the License.
|
|||||||
// +k8s:defaulter-gen=TypeMeta
|
// +k8s:defaulter-gen=TypeMeta
|
||||||
// +groupName=fission.io
|
// +groupName=fission.io
|
||||||
// +groupGoName=core
|
// +groupGoName=core
|
||||||
//
|
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ type (
|
|||||||
// is ready for deploy instead of setting "none" in build status.
|
// is ready for deploy instead of setting "none" in build status.
|
||||||
|
|
||||||
// BuildStatus is the package build status.
|
// BuildStatus is the package build status.
|
||||||
// +kubebuilder:default:="Pending"
|
// +kubebuilder:default:="pending"
|
||||||
BuildStatus BuildStatus `json:"buildstatus,omitempty"`
|
BuildStatus BuildStatus `json:"buildstatus,omitempty"`
|
||||||
|
|
||||||
// BuildLog stores build log during the compilation.
|
// 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 {
|
func (a Archive) IsEmpty() bool {
|
||||||
return len(a.Literal) == 0 && len(a.URL) == 0
|
return len(a.Literal) == 0 && len(a.URL) == 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@@ -18,7 +18,7 @@ package builder
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"os"
|
"os"
|
||||||
@@ -139,7 +139,7 @@ func TestBuilder(t *testing.T) {
|
|||||||
if resp.StatusCode != test.status {
|
if resp.StatusCode != test.status {
|
||||||
t.Errorf("expected status code %d, got %d", test.status, resp.StatusCode)
|
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 {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -34,7 +33,6 @@ import (
|
|||||||
"github.com/fission/fission/pkg/builder"
|
"github.com/fission/fission/pkg/builder"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||||
"github.com/fission/fission/pkg/utils/tracing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -46,13 +44,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func MakeClient(logger *zap.Logger, builderUrl string) *Client {
|
func MakeClient(logger *zap.Logger, builderUrl string) *Client {
|
||||||
var hc *http.Client
|
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
||||||
if tracing.TracingEnabled(logger) {
|
|
||||||
hc = &http.Client{Transport: &ochttp.Transport{}}
|
|
||||||
} else {
|
|
||||||
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
|
||||||
}
|
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
logger: logger.Named("builder_client"),
|
logger: logger.Named("builder_client"),
|
||||||
url: strings.TrimSuffix(builderUrl, "/"),
|
url: strings.TrimSuffix(builderUrl, "/"),
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ func (canaryCfgMgr *canaryConfigMgr) processCanaryConfig(ctx *context.Context, c
|
|||||||
zap.String("name", canaryConfig.ObjectMeta.Name),
|
zap.String("name", canaryConfig.ObjectMeta.Name),
|
||||||
zap.String("namespace", canaryConfig.ObjectMeta.Namespace),
|
zap.String("namespace", canaryConfig.ObjectMeta.Namespace),
|
||||||
zap.String("version", canaryConfig.ObjectMeta.ResourceVersion))
|
zap.String("version", canaryConfig.ObjectMeta.ResourceVersion))
|
||||||
canaryCfgMgr.RollForwardOrBack(canaryConfig, quit, ticker)
|
canaryCfgMgr.RollForwardOrBack(*ctx, canaryConfig, quit, ticker)
|
||||||
|
|
||||||
case <-quit:
|
case <-quit:
|
||||||
// we're done processing this canary config either because the new function receives 100% of the traffic
|
// 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
|
// handle race between delete event and notification on ticker.C
|
||||||
_, err := canaryCfgMgr.canaryCfgCancelFuncMap.lookup(&canaryConfig.ObjectMeta)
|
_, err := canaryCfgMgr.canaryCfgCancelFuncMap.lookup(&canaryConfig.ObjectMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -233,7 +233,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the http trigger object associated with this canary config
|
// 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 err != nil {
|
||||||
// if the http trigger is not found, then give up processing this config.
|
// if the http trigger is not found, then give up processing this config.
|
||||||
if k8serrors.IsNotFound(err) {
|
if k8serrors.IsNotFound(err) {
|
||||||
@@ -286,7 +286,7 @@ func (canaryCfgMgr *canaryConfigMgr) RollForwardOrBack(canaryConfig *fv1.CanaryC
|
|||||||
methods = append(methods, triggerObj.Spec.Method)
|
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)
|
canaryConfig.Spec.NewFunction, canaryConfig.ObjectMeta.Namespace, canaryConfig.Spec.WeightIncrementDuration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// silently ignore. wait for next window to increment weight
|
// silently ignore. wait for next window to increment weight
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ func MakePrometheusClient(logger *zap.Logger, prometheusSvc string) (*Prometheus
|
|||||||
}, nil
|
}, 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
|
var reqs, failedReqs float64
|
||||||
// first get a total count of requests to this url in a time window
|
// first get a total count of requests to this url in a time window
|
||||||
for _, method := range methods {
|
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 {
|
if err != nil {
|
||||||
return 0, err
|
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
|
// next, get a total count of errored out requests to this function in the same window
|
||||||
for _, method := range methods {
|
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 {
|
if err != nil {
|
||||||
return 0, err
|
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)
|
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)
|
queryLabels := promApiClient.getFunctionQueryLabels(funcName, funcNs, path, method)
|
||||||
queryString := fmt.Sprintf("fission_function_calls_total{%s}[%v]", queryLabels, window)
|
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 {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
||||||
}
|
}
|
||||||
|
|
||||||
queryString = fmt.Sprintf("fission_function_calls_total{%s} offset %v", queryLabels, window)
|
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 {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
||||||
}
|
}
|
||||||
@@ -111,18 +111,18 @@ func (promApiClient *PrometheusApiClient) GetRequestsToFuncInWindow(path string,
|
|||||||
return reqsInCurrentWindow, nil
|
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)
|
queryLabels := promApiClient.getFunctionQueryLabels(funcName, funcNs, path, method)
|
||||||
queryString := fmt.Sprintf("fission_function_errors_total{%s}[%v]", queryLabels, window)
|
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 {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
||||||
}
|
}
|
||||||
|
|
||||||
queryString = fmt.Sprintf("fission_function_errors_total{%s} offset %v", queryLabels, window)
|
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 {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
return 0, errors.Wrapf(err, "error executing query: %s", queryString)
|
||||||
}
|
}
|
||||||
@@ -137,10 +137,10 @@ func (promApiClient *PrometheusApiClient) GetTotalFailedRequestsToFuncInWindow(f
|
|||||||
return failedReqsInCurrentWindow, nil
|
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))
|
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 {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "error querying prometheus")
|
return 0, errors.Wrapf(err, "error querying prometheus")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
kerrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
@@ -270,14 +269,8 @@ func (api *API) GetHandler() http.Handler {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *API) Serve(ctx context.Context, port int, openTracingEnabled bool) {
|
func (api *API) Serve(ctx context.Context, port int) {
|
||||||
var handler http.Handler
|
handler := otel.GetHandlerWithOTEL(api.GetHandler(), "fission-controller", otel.UrlsToIgnore("/healthz"))
|
||||||
if openTracingEnabled {
|
|
||||||
handler = &ochttp.Handler{Handler: api.GetHandler()}
|
|
||||||
} else {
|
|
||||||
handler = otel.GetHandlerWithOTEL(api.GetHandler(), "fission-controller", otel.UrlsToIgnore("/healthz"))
|
|
||||||
}
|
|
||||||
|
|
||||||
go metrics.ServeMetrics(ctx, api.logger)
|
go metrics.ServeMetrics(ctx, api.logger)
|
||||||
httpserver.StartServer(ctx, api.logger, "controller", fmt.Sprintf("%d", port), handler)
|
httpserver.StartServer(ctx, api.logger, "controller", fmt.Sprintf("%d", port), handler)
|
||||||
}
|
}
|
||||||
|
|||||||
+144
-20
@@ -31,7 +31,6 @@ import (
|
|||||||
|
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -41,6 +40,7 @@ import (
|
|||||||
"github.com/fission/fission/pkg/crd"
|
"github.com/fission/fission/pkg/crd"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
"github.com/fission/fission/pkg/fission-cli/cmd"
|
"github.com/fission/fission/pkg/fission-cli/cmd"
|
||||||
|
"github.com/fission/fission/pkg/utils/loggerfactory"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -130,7 +130,10 @@ func TestFunctionApi(t *testing.T) {
|
|||||||
testFunc.ObjectMeta.Name = "bar"
|
testFunc.ObjectMeta.Name = "bar"
|
||||||
m2, err := g.Client().V1().Function().Create(testFunc)
|
m2, err := g.Client().V1().Function().Create(testFunc)
|
||||||
panicIf(err)
|
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)
|
funcs, err := g.Client().V1().Function().List(testNS)
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
@@ -174,7 +177,10 @@ func TestHTTPTriggerApi(t *testing.T) {
|
|||||||
|
|
||||||
m, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
|
m, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
|
||||||
panicIf(err)
|
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)
|
_, err = g.Client().V1().HTTPTrigger().Create(testTrigger)
|
||||||
assertNameReuseFailure(err, "httptrigger")
|
assertNameReuseFailure(err, "httptrigger")
|
||||||
@@ -199,13 +205,111 @@ func TestHTTPTriggerApi(t *testing.T) {
|
|||||||
testTrigger.Spec.RelativeURL = "/hi2"
|
testTrigger.Spec.RelativeURL = "/hi2"
|
||||||
m2, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
|
m2, err := g.Client().V1().HTTPTrigger().Create(testTrigger)
|
||||||
panicIf(err)
|
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)
|
ts, err := g.Client().V1().HTTPTrigger().List(testNS)
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
assert(len(ts) == 2, fmt.Sprintf("created two triggers, but found %v", len(ts)))
|
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) {
|
func TestEnvironmentApi(t *testing.T) {
|
||||||
testEnv := &fv1.Environment{
|
testEnv := &fv1.Environment{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@@ -228,7 +332,10 @@ func TestEnvironmentApi(t *testing.T) {
|
|||||||
|
|
||||||
m, err := g.Client().V1().Environment().Create(testEnv)
|
m, err := g.Client().V1().Environment().Create(testEnv)
|
||||||
panicIf(err)
|
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)
|
_, err = g.Client().V1().Environment().Create(testEnv)
|
||||||
assertNameReuseFailure(err, "environment")
|
assertNameReuseFailure(err, "environment")
|
||||||
@@ -247,7 +354,10 @@ func TestEnvironmentApi(t *testing.T) {
|
|||||||
|
|
||||||
m2, err := g.Client().V1().Environment().Create(testEnv)
|
m2, err := g.Client().V1().Environment().Create(testEnv)
|
||||||
panicIf(err)
|
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)
|
ts, err := g.Client().V1().Environment().List(testNS)
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
@@ -277,7 +387,10 @@ func TestWatchApi(t *testing.T) {
|
|||||||
|
|
||||||
m, err := g.Client().V1().KubeWatcher().Create(testWatch)
|
m, err := g.Client().V1().KubeWatcher().Create(testWatch)
|
||||||
panicIf(err)
|
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)
|
_, err = g.Client().V1().KubeWatcher().Create(testWatch)
|
||||||
assertNameReuseFailure(err, "watch")
|
assertNameReuseFailure(err, "watch")
|
||||||
@@ -292,7 +405,10 @@ func TestWatchApi(t *testing.T) {
|
|||||||
testWatch.ObjectMeta.Name = "yyy"
|
testWatch.ObjectMeta.Name = "yyy"
|
||||||
m2, err := g.Client().V1().KubeWatcher().Create(testWatch)
|
m2, err := g.Client().V1().KubeWatcher().Create(testWatch)
|
||||||
panicIf(err)
|
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)
|
ws, err := g.Client().V1().KubeWatcher().List(testNS)
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
@@ -318,7 +434,10 @@ func TestTimeTriggerApi(t *testing.T) {
|
|||||||
|
|
||||||
m, err := g.Client().V1().TimeTrigger().Create(testTrigger)
|
m, err := g.Client().V1().TimeTrigger().Create(testTrigger)
|
||||||
panicIf(err)
|
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)
|
_, err = g.Client().V1().TimeTrigger().Create(testTrigger)
|
||||||
assertNameReuseFailure(err, "trigger")
|
assertNameReuseFailure(err, "trigger")
|
||||||
@@ -348,10 +467,15 @@ func TestTimeTriggerApi(t *testing.T) {
|
|||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
|
||||||
|
logger := loggerfactory.GetLogger()
|
||||||
|
|
||||||
// skip test if no cluster available for testing
|
// skip test if no cluster available for testing
|
||||||
kubeconfig := os.Getenv("KUBECONFIG")
|
kubeconfig := os.Getenv("KUBECONFIG")
|
||||||
if len(kubeconfig) == 0 {
|
if len(kubeconfig) == 0 {
|
||||||
log.Println("Skipping test, no kubernetes cluster")
|
log.Println("Skipping test, no kubernetes cluster")
|
||||||
|
cancel()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,22 +486,14 @@ func TestMain(m *testing.M) {
|
|||||||
id, err := uuid.NewV4()
|
id, err := uuid.NewV4()
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
testNS = id.String()
|
testNS = id.String()
|
||||||
_, err = kubeClient.CoreV1().Namespaces().Create(context.TODO(), &v1.Namespace{
|
_, err = kubeClient.CoreV1().Namespaces().Create(ctx, &v1.Namespace{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: testNS,
|
Name: testNS,
|
||||||
},
|
},
|
||||||
}, metav1.CreateOptions{})
|
}, metav1.CreateOptions{})
|
||||||
panicIf(err)
|
panicIf(err)
|
||||||
defer panicIf(kubeClient.CoreV1().Namespaces().Delete(context.TODO(), testNS, metav1.DeleteOptions{}))
|
|
||||||
|
|
||||||
config := zap.NewDevelopmentConfig()
|
go Start(ctx, logger, 8888, true)
|
||||||
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
|
|
||||||
logger, err := config.Build()
|
|
||||||
|
|
||||||
panicIf(err)
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
go Start(ctx, logger, 8888, true, true)
|
|
||||||
|
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
|
|
||||||
@@ -400,5 +516,13 @@ func TestMain(m *testing.M) {
|
|||||||
_, err = io.ReadAll(resp.Body)
|
_, err = io.ReadAll(resp.Body)
|
||||||
panicIf(err)
|
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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/fission/fission/pkg/crd"
|
"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")
|
cLogger := logger.Named("controller")
|
||||||
|
|
||||||
fc, kc, apiExtClient, _, err := crd.MakeFissionClient()
|
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 {
|
if err != nil {
|
||||||
cLogger.Fatal("failed to start controller", zap.Error(err))
|
cLogger.Fatal("failed to start controller", zap.Error(err))
|
||||||
}
|
}
|
||||||
api.Serve(ctx, port, openTracingEnabled)
|
api.Serve(ctx, port)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/pkg/errors"
|
"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
|
// 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 {
|
if err != nil {
|
||||||
a.respondWithError(w, errors.Wrapf(err, "error getting container logs"))
|
a.respondWithError(w, errors.Wrapf(err, "error getting container logs"))
|
||||||
return
|
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)
|
seq := strings.Repeat("=", 35)
|
||||||
|
|
||||||
for _, container := range pod.Spec.Containers {
|
for _, container := range pod.Spec.Containers {
|
||||||
podLogOpts := apiv1.PodLogOptions{Container: container.Name} // Only the env container, not fetcher
|
podLogOpts := apiv1.PodLogOptions{Container: container.Name} // Only the env container, not fetcher
|
||||||
podLogsReq := kubernetesClient.CoreV1().Pods(pod.Namespace).GetLogs(pod.ObjectMeta.Name, &podLogOpts)
|
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 {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error streaming pod log")
|
return errors.Wrapf(err, "error streaming pod log")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -134,7 +134,7 @@ func (a *API) checkHTTPTriggerDuplicates(ctx context.Context, t *fv1.HTTPTrigger
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
urlMatch := false
|
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
|
urlMatch = true
|
||||||
}
|
}
|
||||||
methodMatch := false
|
methodMatch := false
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ package controller
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/dustin/go-humanize"
|
"github.com/dustin/go-humanize"
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/robfig/cron"
|
"github.com/robfig/cron"
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
restfulspec "github.com/emicklei/go-restful-openapi/v2"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restful "github.com/emicklei/go-restful/v3"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|||||||
+2
-9
@@ -28,7 +28,6 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
@@ -263,14 +262,8 @@ func (executor *Executor) GetHandler() http.Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Serve starts an HTTP server.
|
// Serve starts an HTTP server.
|
||||||
func (executor *Executor) Serve(ctx context.Context, port int, openTracingEnabled bool) {
|
func (executor *Executor) Serve(ctx context.Context, port int) {
|
||||||
var handler http.Handler
|
handler := otelUtils.GetHandlerWithOTEL(executor.GetHandler(), "fission-executor", otelUtils.UrlsToIgnore("/healthz"))
|
||||||
if openTracingEnabled {
|
|
||||||
handler = &ochttp.Handler{Handler: executor.GetHandler()}
|
|
||||||
} else {
|
|
||||||
handler = otelUtils.GetHandlerWithOTEL(executor.GetHandler(), "fission-executor", otelUtils.UrlsToIgnore("/healthz"))
|
|
||||||
}
|
|
||||||
|
|
||||||
httpserver.StartServer(ctx, executor.logger, "executor", fmt.Sprintf("%d", port), handler)
|
httpserver.StartServer(ctx, executor.logger, "executor", fmt.Sprintf("%d", port), handler)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,11 @@ import (
|
|||||||
|
|
||||||
"github.com/hashicorp/go-retryablehttp"
|
"github.com/hashicorp/go-retryablehttp"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
"github.com/fission/fission/pkg/utils/tracing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -57,10 +55,6 @@ type (
|
|||||||
// MakeClient initializes and returns a Client instance.
|
// MakeClient initializes and returns a Client instance.
|
||||||
func MakeClient(logger *zap.Logger, executorURL string) *Client {
|
func MakeClient(logger *zap.Logger, executorURL string) *Client {
|
||||||
hc := retryablehttp.NewClient()
|
hc := retryablehttp.NewClient()
|
||||||
if tracing.TracingEnabled(logger) {
|
|
||||||
hc.HTTPClient.Transport = &ochttp.Transport{Base: hc.HTTPClient.Transport}
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &Client{
|
c := &Client{
|
||||||
logger: logger.Named("executor_client"),
|
logger: logger.Named("executor_client"),
|
||||||
executorURL: strings.TrimSuffix(executorURL, "/"),
|
executorURL: strings.TrimSuffix(executorURL, "/"),
|
||||||
|
|||||||
@@ -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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ func (executor *Executor) getFunctionServiceFromCache(ctx context.Context, fn *f
|
|||||||
|
|
||||||
// StartExecutor Starts executor and the executor components such as Poolmgr,
|
// StartExecutor Starts executor and the executor components such as Poolmgr,
|
||||||
// deploymgr and potential future executor types
|
// 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()
|
fissionClient, kubernetesClient, _, metricsClient, err := crd.MakeFissionClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to get kubernetes client")
|
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 reaper.CleanupRoleBindings(ctx, logger, kubernetesClient, fissionClient, functionNamespace, envBuilderNamespace, time.Minute*30)
|
||||||
go metrics.ServeMetrics(ctx, logger)
|
go metrics.ServeMetrics(ctx, logger)
|
||||||
go api.Serve(ctx, port, openTracingEnabled)
|
go api.Serve(ctx, port)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ func TestExecutor(t *testing.T) {
|
|||||||
// create poolmgr
|
// create poolmgr
|
||||||
port := 9999
|
port := 9999
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
err = StartExecutor(ctx, logger, functionNs, "fission-builder", port, true)
|
err = StartExecutor(ctx, logger, functionNs, "fission-builder", port)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panicf("failed to start poolmgr: %v", err)
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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{
|
Env: []apiv1.EnvVar{
|
||||||
{
|
{
|
||||||
Name: fv1.ResourceVersionCount,
|
Name: fv1.ResourceVersionCount,
|
||||||
Value: fmt.Sprintf("%v", rvCount),
|
Value: fmt.Sprintf("%d", rvCount),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// https://istio.io/docs/setup/kubernetes/additional-setup/requirements/
|
// 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
|
// Ideally there should be only one deployment but for now we rely on label/selector to ensure that condition
|
||||||
for _, deployment := range dep.Items {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
patch := fmt.Sprintf(`{"spec" : {"template": {"spec":{"containers":[{"name": "%s", "env":[{"name": "%s", "value": "%v"}]}]}}}}`,
|
patch := fmt.Sprintf(`{"spec" : {"template": {"spec":{"containers":[{"name": "%s", "image": "%s", "env":[{"name": "%s", "value": "%d"}]}]}}}}`,
|
||||||
f.ObjectMeta.Name, fv1.ResourceVersionCount, rvCount)
|
env.ObjectMeta.Name, env.Spec.Runtime.Image, fv1.ResourceVersionCount, rvCount)
|
||||||
|
|
||||||
_, err = deploy.kubernetesClient.AppsV1().Deployments(deployment.ObjectMeta.Namespace).Patch(ctx, deployment.ObjectMeta.Name,
|
_, err = deploy.kubernetesClient.AppsV1().Deployments(deployment.ObjectMeta.Namespace).Patch(ctx, deployment.ObjectMeta.Name,
|
||||||
k8sTypes.StrategicMergePatchType,
|
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
|
||||||
|
}
|
||||||
@@ -278,11 +278,11 @@ func (gpm *GenericPoolManager) RefreshFuncPods(ctx context.Context, logger *zap.
|
|||||||
}
|
}
|
||||||
|
|
||||||
funcSvc, err := gp.fsCache.GetByFunction(&f.ObjectMeta)
|
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)
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
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 not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
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
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/ghodss/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetFeatureConfig reads the configMap file and unmarshals the config into a feature config struct
|
// GetFeatureConfig reads the configMap file and unmarshals the config into a feature config struct
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
|
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
"github.com/fission/fission/pkg/fetcher"
|
"github.com/fission/fission/pkg/fetcher"
|
||||||
"github.com/fission/fission/pkg/utils/tracing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -29,13 +27,7 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func MakeClient(logger *zap.Logger, fetcherUrl string) *Client {
|
func MakeClient(logger *zap.Logger, fetcherUrl string) *Client {
|
||||||
var hc *http.Client
|
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
||||||
if tracing.TracingEnabled(logger) {
|
|
||||||
hc = &http.Client{Transport: &ochttp.Transport{}}
|
|
||||||
} else {
|
|
||||||
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
|
||||||
}
|
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
logger: logger.Named("fetcher_client"),
|
logger: logger.Named("fetcher_client"),
|
||||||
url: strings.TrimSuffix(fetcherUrl, "/"),
|
url: strings.TrimSuffix(fetcherUrl, "/"),
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ type Config struct {
|
|||||||
sharedCfgMapPath string
|
sharedCfgMapPath string
|
||||||
|
|
||||||
serviceAccount string
|
serviceAccount string
|
||||||
|
|
||||||
jaegerCollectorEndpoint string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getFetcherResources() (apiv1.ResourceRequirements, error) {
|
func getFetcherResources() (apiv1.ResourceRequirements, error) {
|
||||||
@@ -82,14 +80,13 @@ func MakeFetcherConfig(sharedMountPath string) (*Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &Config{
|
return &Config{
|
||||||
resourceRequirements: resources,
|
resourceRequirements: resources,
|
||||||
fetcherImage: fetcherImage,
|
fetcherImage: fetcherImage,
|
||||||
fetcherImagePullPolicy: utils.GetImagePullPolicy(fetcherImagePullPolicy),
|
fetcherImagePullPolicy: utils.GetImagePullPolicy(fetcherImagePullPolicy),
|
||||||
sharedMountPath: sharedMountPath,
|
sharedMountPath: sharedMountPath,
|
||||||
sharedSecretPath: "/secrets",
|
sharedSecretPath: "/secrets",
|
||||||
sharedCfgMapPath: "/configs",
|
sharedCfgMapPath: "/configs",
|
||||||
jaegerCollectorEndpoint: os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT"),
|
serviceAccount: fv1.FissionFetcherSA,
|
||||||
serviceAccount: fv1.FissionFetcherSA,
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +166,6 @@ func (cfg *Config) fetcherCommand(extraArgs ...string) []string {
|
|||||||
command := []string{"/fetcher",
|
command := []string{"/fetcher",
|
||||||
"-secret-dir", cfg.sharedSecretPath,
|
"-secret-dir", cfg.sharedSecretPath,
|
||||||
"-cfgmap-dir", cfg.sharedCfgMapPath,
|
"-cfgmap-dir", cfg.sharedCfgMapPath,
|
||||||
"-jaeger-collector-endpoint", cfg.jaegerCollectorEndpoint,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
command = append(command, extraArgs...)
|
command = append(command, extraArgs...)
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import (
|
|||||||
"github.com/mholt/archiver/v3"
|
"github.com/mholt/archiver/v3"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
uuid "github.com/satori/go.uuid"
|
uuid "github.com/satori/go.uuid"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
@@ -53,7 +52,6 @@ import (
|
|||||||
storageSvcClient "github.com/fission/fission/pkg/storagesvc/client"
|
storageSvcClient "github.com/fission/fission/pkg/storagesvc/client"
|
||||||
"github.com/fission/fission/pkg/utils"
|
"github.com/fission/fission/pkg/utils"
|
||||||
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
otelUtils "github.com/fission/fission/pkg/utils/otel"
|
||||||
"github.com/fission/fission/pkg/utils/tracing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
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")
|
return nil, errors.Wrap(err, "error reading pod namespace from downward volume")
|
||||||
}
|
}
|
||||||
|
|
||||||
var hc *http.Client
|
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
||||||
if tracing.TracingEnabled(logger) {
|
|
||||||
hc = &http.Client{Transport: &ochttp.Transport{}}
|
|
||||||
} else {
|
|
||||||
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
|
|
||||||
}
|
|
||||||
|
|
||||||
return &Fetcher{
|
return &Fetcher{
|
||||||
logger: fLogger,
|
logger: fLogger,
|
||||||
sharedVolumePath: sharedVolumePath,
|
sharedVolumePath: sharedVolumePath,
|
||||||
|
|||||||
@@ -22,11 +22,9 @@ import (
|
|||||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
|
||||||
// Fission-Environment interface. The following types are not
|
// Fission-Environment interface. The following types are not
|
||||||
// exposed in the Fission API, but rather used by Fission to
|
// exposed in the Fission API, but rather used by Fission to
|
||||||
// talk to environments.
|
// talk to environments.
|
||||||
//
|
|
||||||
type (
|
type (
|
||||||
FetchRequestType int
|
FetchRequestType int
|
||||||
|
|
||||||
|
|||||||
@@ -61,15 +61,12 @@ func (opts *GetURLSubCommand) do(input cli.Input) error {
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
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"))
|
storageType := resp.Header.Get("X-FISSION-STORAGETYPE")
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if archiveURL.Scheme == "file" {
|
if storageType == "local" {
|
||||||
storageSvc, err := opts.Client().V1().Misc().GetSvcURL("application=fission-storage")
|
storageSvc, err := opts.Client().V1().Misc().GetSvcURL("application=fission-storage")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -77,8 +74,10 @@ func (opts *GetURLSubCommand) do(input cli.Input) error {
|
|||||||
storagesvcURL := "http://" + storageSvc
|
storagesvcURL := "http://" + storageSvc
|
||||||
client := storagesvcClient.MakeClient(storagesvcURL)
|
client := storagesvcClient.MakeClient(storagesvcURL)
|
||||||
fmt.Printf("URL: %s", client.GetUrl(archiveID))
|
fmt.Printf("URL: %s", client.GetUrl(archiveID))
|
||||||
} else {
|
} else if storageType == "s3" {
|
||||||
fmt.Printf("URL: %s", archiveURL.String())
|
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
|
return nil
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/fission/fission/pkg/fission-cli/flag"
|
"github.com/fission/fission/pkg/fission-cli/flag"
|
||||||
)
|
)
|
||||||
|
|
||||||
//Commands returns canary config commands
|
// Commands returns canary config commands
|
||||||
func Commands() *cobra.Command {
|
func Commands() *cobra.Command {
|
||||||
createCmd := &cobra.Command{
|
createCmd := &cobra.Command{
|
||||||
Use: "create",
|
Use: "create",
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user