Commit Graph
163 Commits
Author SHA1 Message Date
Sanket SudakeandGitHub 2e4825def0 Add function test CLI tests (#2871)
* Add function test CLI tests
* Add few more services to tests

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-11-13 14:34:56 +05:30
Vardhaman SuranaandGitHub 3fabf64b3c Add informers and internal go routines in manager (#2870)
* used manager's Add function in more places
* exit when ctx.Done is received in archivePruner go routines
* fix manager tests
* fix data race
* added more gpm function in manager and removed manager from a util function
* closed unused channel and stopped ticker after context is done
* added log statements
* used context.Done inside function instead of stopper channel
2023-11-10 12:42:21 +05:30
Vardhaman SuranaandGitHub 2a40b4538c added manger to keep track of go routines in the services (#2869)
- added manager to wait for all go routines to end before exit
- code refactor
- renamed Manafer to Interface and GoRoutineManager to GroupManager
- replaced some go routine calls with manager Add func
- added unit tests for manager
2023-11-07 15:30:48 +05:30
Sanket SudakeandGitHub 27132975c4 Add interfaces for executor/fetcher/storagesvc clients (#2867)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-11-06 16:09:51 +05:30
Sanket SudakeandGitHub 267f7faf18 Add cause for all context timeouts (#2862) 2023-10-29 13:19:06 +05:30
Sanket SudakeandGitHub 2223081c80 Test for httptrigger and functions container/newdeploy (#2861)
* Test for httptrigger and functions
* Fixes with multierror
* review changes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-10-27 15:05:20 +05:30
8a17d391c5 Envtest based integration tests for Fission (#2858)
* skeleton for envtest fission
* Refactor code and add CLI test
* hack
* Update server test
* remove skip-ci for lint tests
* Pass client go storagesvc
* Add clientGen interface across code
* Fix storagesvc test
* Fix cmd client
* add retry in server test
* Fix concurrenct access to pool deployment
* Remove old executor test
* get rid of ginkgo/gomega
* disable flaky test
* flaky test
* revert ci change
* handle err from ParseBool

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Pranoy Kundu <pranoy1998k@gmail.com>
2023-10-26 12:09:11 +05:30
Vardhaman SuranaandGitHub fc97b7609b added client generator inteface (#2854)
* added client generator inteface
* start router service asynchronously

Signed-off-by: Vardhaman Surana <vardhaman.surana@infracloud.io>
2023-10-18 18:59:28 +05:30
Sanket SudakeandGitHub c6329ee3db Switch to google/uuid from satori/go.uuid (#2852)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-10-17 12:19:17 +05:30
Guillaume MARTINEZandGitHub 3762ff80f2 Update the Kubernetes autoscaling API to v2 (#2722) (#2842)
* Update the Kubernetes autoscaling API to v2 (#2722)
  - k8s.io/api/autoscaling/v2
* generate all files
* fix missing v2beta ref

---------

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2023-10-11 11:04:45 +05:30
56b49dcee8 Ability to retain specialised pods for poolmanager functions (#2830)
- added retainPods flag to take in the number of specialized pods to retain
- add retainPods in both the create function and update function command
- modify crd keys to be typed instead of string
- keep track of function generation in case of update function operation
- add delete handler function to make sure specialized pods are deleted in case function is deleted

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Signed-off-by: Pranoy Kundu <pranoy1998k@gmail.com>
Co-authored-by: Pranoy Kundu <pranoy1998k@gmail.com>
2023-09-27 13:33:19 +05:30
Sanket SudakeandGitHub 657aee7cc2 Update go deps across project (#2837)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-09-24 11:14:43 +05:30
Sanket SudakeandGitHub 3bcda55aa8 Update kubernetes libs to latest (#2834)
- k8s.io/api v0.28.1
- k8s.io/apiextensions-apiserver v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- k8s.io/metrics v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
- sigs.k8s.io/controller-tools v0.13.0

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-09-23 09:10:51 +05:30
f99f10134c Executor: Dump function service cache for pool manager functions (#2789)
* dump function service cache for executor
* fix lint issue
* code refactor and lint fixes

---------

Signed-off-by: Shubham Bansal <shubhambansaliimtgn@gmail.com>
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2023-05-12 09:49:54 +05:30
6c431e4d9b Ensure handling for specialization failure in pool manager (#2788)
* Add fixes for failure in specialization
* reduce specialization in progress and remove expired requests from queue when specialization is timed out
* rename markSpecializationFailure and remove logger from the queue
* refactor clean up code in api.go and add test case for queue

Details:

- Cleanup svc waiting for the counter in the pool manager if specialization fails
- Cleanup active requests counter in pool manager if client exists the demand for function service while we have allocated function service
- Consider specialization timeout if pod ready timeout > specialization timeout in waiting for ready pod. We also consider if the request to choosePod is cancelled.
- We ensure if we have requests waiting for service requests but if there is no pod in the specialization we clean up those.
---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Pranoy Kundu <pranoy1998k@gmail.com>
2023-05-11 21:03:57 +05:30
31c81e132e fix: lose cold start error counter for the poolmgr functions (#2755)
* fix: lose cold start error counter for the poolmgr functions

Co-authored-by: ZhengHe-MD <ranchardzheng@gmail.com>
Co-authored-by: gw123 <iamakillerforyou@gmail.com>
Signed-off-by: saltbo <saltbo@foxmail.com>

* fix: miss code for the metric

Signed-off-by: saltbo <saltbo@foxmail.com>

---------

Signed-off-by: saltbo <saltbo@foxmail.com>
Co-authored-by: ZhengHe-MD <ranchardzheng@gmail.com>
Co-authored-by: gw123 <iamakillerforyou@gmail.com>
2023-05-09 12:37:58 +05:30
AmborandGitHub 117c383fac style: typo for the BuilderNamespace (#2776)
Signed-off-by: saltbo <saltbo@foxmail.com>
2023-04-11 08:39:42 +05:30
715ef8267e Improve poolmanager concurrency handling with virtual capacity (#2737)
* add functionality to wait for specialization by keeping track of incoming requests
* format executor package
* fix required capacity to specialise new pod condition
* move handling concurrency logic into pool cache from executor
* remove unused methods and structs
* implement queue in to store the svc wait
* create a queue struct and its methods to handle concurrent inputs
* use newly created queue to store waiting for svc requests
* add waiting requests in queue and use them when a svc is ready
* set function to request in queue if the context is still alive
* remove concurrency approach to set svc for waiting requests
* update the active requests whenever requests from pool are assigned a svc
* add doc to define why the conditions exist
* remove unwanted params in strcut and clean up code
* set error while getting svc value if sum of specialization in progress and specialized is only more than concurrency limit
* remove duplicate functions and unnecessary values in struct
* close svc channel on set value and create constants for default concurrency and rpp
* get next value in queue in case context is timed out for fetched value
* remove specializationInProgress counter from pool cache
* return in case the queue is empty wihle setting func to svc
* test getSvcVaue and setSvcValue in poolcache
* add unit tests for GetConcurrent and GetRequestsPerPod methods
* reorder imports
* add fuzzy testing for getSVCValue and setSVCValue in poolcache
* restructure go mod file and update pool cache test cases
* Add tests and bug fixes
* refactor code and add test cases
* add svcWaiting check while setting svc value

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2023-03-30 20:19:51 +05:30
a8e8cfb72d fix: websocket event listener (#2745)
Co-authored-by: 李霖 <lee@lilindeMacBook-Pro.local>
2023-03-23 11:52:20 +05:30
AmborandGitHub 963081e096 fix: ending retry loop when the request canceled for the choosePod (#2731)
Signed-off-by: saltbo <saltbo@foxmail.com>
2023-03-21 14:38:45 +05:30
Sanket SudakeandGitHub a96b92f41f Update Go version 1.20 (#2740)
* Update Go version 1.20
* Update golangci-lint version v1.51.1

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-03-12 08:45:43 +05:30
Nikhil SharmaandGitHub a93e9b4074 poolmgr: stop pod specialization when pod namespace and cm/secret namespace is mismatched (#2703)
Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
2023-03-11 16:24:52 +05:30
Pranoy Kumar KunduandGitHub 0de8923ea8 Add funcSvcGroup type in pool cache for grouping of function services (#2728)
* add specfic structs for function svc and group

* remove unused var in funcSvcGroup

* format poolcache
2023-02-28 09:06:16 +05:30
Nikhil SharmaandGitHub 5c3c55d52f allow users to set envGracePeriod to 0 (#2696)
Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>

Signed-off-by: Nikhl Sharma <nikhilsharma230303@gmail.com>
2023-01-18 10:57:30 +05:30
Sanket SudakeandGitHub 0edf2640b1 internal: Making poolcache typed and merged into fscache (#2693)
Merged pool cache package into fscache to avoid import cycle.
Also changed all types in pool cache from interface to specific
types.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2023-01-15 23:50:05 +05:30
AmborandGitHub 6667d7e383 fix: nil panic for the latestDepl.Name if not return in the for cycle (#2682)
Signed-off-by: saltbo <saltbo@foxmail.com>

Signed-off-by: saltbo <saltbo@foxmail.com>
2023-01-09 16:18:15 +05:30
Shubham BansalandGitHub 16cbb87eab Create role/role binding/service account required for builder/function pods (#2667)
* service account changes for fission-builder
* moved code into executor
* changed default timing to 30 min
* code refactor and add new roles for executor
* create role if serviceAccountCheck is enabled
2022-12-14 09:06:20 +05:30
Sanket SudakeandGitHub 5fae765323 Use client generator to generate all k8s clients and add respective client-go metrics (#2668)
* Define client generator to generate all k8s clients
* Increase QPS and burst values
* Capture client-go metrics
* Support for controller runtime metrics

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-13 14:19:36 +05:30
Sanket SudakeandGitHub 3ae1742953 Executor user informer factory in executors in place of informers (#2666)
* Use informerfactory across executor
* Run function informer for poolpodcontroller if istio enabled
* Use same namespace for secret as keda mqtriggers

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-11 20:41:12 +05:30
Sanket SudakeandGitHub 300739c031 Remove service account/role binding/role permissions from Fission services (#2655)
* Remove cluster role references
* Convert secret/package getter cluster roles to role
* Remove all cluster role binding permissions
* Remove unwanted permission
* Try removing all RBAC-related code
* Remove additional constants
* Add functionality for service account checks
* Restrict permission across services
* Remove package informer factory from the executor
* Revert service account check code for now
* Skip adding roles in place of cluster roles
* Remove additional permission from the router

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-08 16:15:19 +05:30
Sanket SudakeandGitHub 985d94b5b8 Consume podspec patch directly on executor/builder mounts (#2661)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-08 11:38:57 +05:30
Shubham BansalandGitHub ee623d31b2 Check pods events via infomer in user configured namespaces (#2653)
* informer changes for event checker in multi namespace

* run informers in wait group
2022-12-05 13:06:47 +05:30
Shubham BansalandGitHub 691feaa84f K8s informer to work with specific namespaces for executor (#2651)
Consider specific namespaces mentioned by the user in building informers in the executor
- Confimaps
- Secrets
- Deployments
- Services
- Pods
- Replicasets
2022-12-04 21:01:31 +05:30
526b5f0beb Deployments to work with specific namespaces instead of all namespaces (#2635)
* remove namespaceAll in deployments
* remove GetNamespace function from informer
* added logger and improvement for naming
* move reaper logic to utils

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-29 17:09:51 +05:30
Shubham BansalandGitHub 6d117ad43a Allow empty namespace for fission function and builder (#2621)
Currently, we create Fission resources in the default namespace, function-related resources are created in the fission-function namespace, whereas builder resources are created in the fission-builder namespace. This causes confusion for a lot of users.
In this fix, we allow the user to set the function and builder namespace empty so that function and builder resources are created in the same namespace as the function resource always.

If the user desires older behaviour they can functionNamespace and builderNamespace the same previous before the upgrade.

* use default namespace for fission  function and builder
* support for existing fission namespaces
* Replace builder and function namespace with template
* Fix namespace creation template

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-16 22:16:05 +05:30
Shubham BansalandGitHub 32bd874ab6 List fission resources in specific namespace instead of all namespace (#2604) 2022-11-08 10:25:09 +05:30
Sanket SudakeandGitHub 6af53807aa Monitor specific namespaces for configmap/secret updates (#2598)
We allow functions to refer to configmap/secrets. We are monitoring all namespaces for config maps and secrets and also allow cross-namespace references.
This fix monitors configmaps/secret updates in specific namespaces. Also, we ignore cross-namespace references for configmap/secret updates.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-03 14:12:22 +05:30
Shubham BansalandGitHub 9ff9a6e075 newdeploy executor to work with specific namespaces (#2590) 2022-10-31 12:55:57 +05:30
Shubham BansalandGitHub 47cbbef06f List Fission resource for specific namespace in executor reaper (#2587)
* pool manager to work with specific namespaces

* code review changes and revert changes for go.mod and values.yaml file
2022-10-28 20:39:08 +05:30
827baea974 Allow namespace configuration for different CRD resources in Fission (#2539)
* Allow multiple namespaces for builder manager
* Enable multiple namespaces for executor informers
* Added missing context
* helm chart support for multiple namespaces
* Directly consume map type from GetInformerForNamespaces fn
* Optimize function resolver by choosing namespace-specific informer
* helm chart support for multiple namespaces
* consider default namespace and move duplicate code to helm template
* Improve documentation for fission namespace values

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: shubham bansal <shubhambansaliimtgn@gmail.com>
2022-10-19 15:48:47 +05:30
Sanket SudakeandGitHub f2b790921b Remove unwanted permissions from Fission components (#2568)
* Remove unwanted permissions from Fission components
* Remove unwanted permission from buildermgr
* Remove rbac permissions from controller
* Remove unwanted namespace permission
* Remove unwanted fission resource permissions
* Add deployment list permission for buildermgr
* add deployment create permission for buildermgr
* Update action version
* Add rolebinding permission for buildermanager
* Reduce permissions for fetcher and builder components
* Aded deployment delete permission to buildermgr
* Add logger to wait crds function
* Revert "Grant CustomResourcedefintion read permission to specific components (#2567)"

This reverts commit 8fe62b755c.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-10-13 15:04:49 +05:30
Sanket SudakeandGitHub 3fa0f4bde3 Ensuring passing context across fission (#2555)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-26 16:05:45 +05:30
Andrey DudinandGitHub 1102999b4d Add ability to configure object reaper interval for different executor types (#2543)
Added properties to configure object reaper interval, global and specific to exec type.

OBJECT_REAPER_INTERVAL - global
NEWDEPLOY_OBJECT_REAPER_INTERVAL - for new deploy type
CONTAINER_OBJECT_REAPER_INTERVAL - for container type
POOLMGR_OBJECT_REAPER_INTERVAL - for poolmgr
2022-09-23 11:35:13 +05:30
AmborandGitHub da50c3759d feat: add the fn annotations to newdeploy function based deployment (#2554)
* feat: add copy the fn annotations to the deploy annotations

* feat: add copy the fn labels to the deploy labels
2022-09-22 14:21:27 +05:30
Sanket SudakeandGitHub e87c84ee2c Capture context from cobra CLI and pass forward (#2551)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-22 13:54:05 +05:30
Shubham BansalandGitHub d03395949b changes to inject of otelhttp transport in executor (#2552) 2022-09-22 10:47:47 +05:30
7dad7c8399 Ensure newdeploy function pod restart on referred configmap update (#2528)
Configmap inside pods for newdeploy and pool manager executor type were not being updated if the user update the configmap.
This fix will help to update the pods for both executor type with new configmap. As per the changes if there is any configmap update then pods will get restarted for both executor type and then it will refer new configmap.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-06 16:12:55 +05:30
Sanket SudakeandGitHub 3b4211b581 Update go dependencies to latest and actions used in workflows (#2510)
* Updated all Go language dependencies to latest version available
* Formatted all files as per gofmt
* Update Golangci-lint version to 1.48.0
* Updated action version wherer application in Github workflows
* Updated Kubernetes version to latest available
* Remove "io/ioutil" references and replace with "io"/"os"

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-19 13:36:37 +05:30
Sanket SudakeandGitHub 899e6e96d6 cleanup: Remove Opentracing support as no active users (#2196)
References:
[1] #2193
[2] https://fissionio.slack.com/archives/C3LUX6BBP/p1631706812069300

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-07-12 14:52:17 +05:30
Shubham BansalandGitHub c71867169b Pods immediately terminate for idletimeout in new deployment and container executer type (#2459)
* added waitgroup to handle multiple goroutine scenario
* changes for cache service
* changes to get function service from cache by UID
2022-06-29 11:49:34 +05:30