Commit Graph
543 Commits
Author SHA1 Message Date
Erwin van EykandTa-Ching Chen a033d3c432 Removed limit on max number of channels in NATS Streaming deployment (#482) 2018-02-06 22:30:35 +08:00
Ta-Ching ChenandGitHub 3f81510729 Fix possible context leak problem (#483) 2018-02-06 21:34:01 +08:00
Soam VasaniandGitHub 07c7b759d2 Declarative application specifications for Fission (#422)
This change enables users to have declarative specifications for Fission resources. Users can specify their "app" in a set of spec files, and use a new fission CLI command to "apply" these specs to a running cluster.

The new "spec" CLI also includes archiving of local source files, and a file watcher that re-builds archives and uploads them on file changes, and a package build watcher that waits for package builds on the CLI. 

A "--spec" option is also added to "function create", and will be added to other resources in future changes.  This option causes a YAML to be outputted to the specs directory instead of the resource being created on the cluster.

The CLI "fission spec --help" outputs usage information.
2018-02-05 21:58:44 -08:00
Moritz Grosch (LittleFox)andSoam Vasani 6af13e7e29 Extend perl examples to use more http features (#479) 2018-02-05 14:37:13 -08:00
Ta-Ching ChenandGitHub cc62e62229 Add glide flag to strip nested vendor (#480)
Adds --strip-vendor (-v) to travis.yml when installing dependencies.
For more information about the flag, please check dependency flattening (https://glide.readthedocs.io/en/stable/getting-started/)
2018-02-06 02:31:06 +08:00
prithvirameshandTa-Ching Chen 1eb0453ce4 Functions have access to secrets/configmaps specified by the user (#399)
This commit solves part of the issue #52 , functions are able to access secrets/configmaps specified by the user. For now, CLI only accept one secret/configmap. For advanced users, it will be able to use YAML to declare multiple secrets/configmaps in later changes.
2018-02-05 17:49:26 +08:00
VishalandTa-Ching Chen 4cf195768e Newdeploy backend (#387)
A newdeploy backend which uses new deployment to serve requests. This is the second phase of #193 and builds on top of changes in #384 .

* Executor layer added on top of pool manager

* Removed the external server for executor

* Minor changes to keep existing semantics as much possible

* Separating the executor vs. poolmgr backend functionality and associated data members

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed references to poolmgr in tests

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Executor layer added on top of pool manager

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed podName to a generic objectReference in fscache (#391)

Changed podName to a generic objectReference in function service cache implementation.

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Merged from master with latest changes

* Executor layer added on top of pool manager

* Removed the external server for executor

* Minor changes to keep existing semantics as much possible

* Separating the executor vs. poolmgr backend functionality and associated data members

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed references to poolmgr in tests

* update compiling.md to use helm

* Compile instructions: changed pullPolicy to IfNotPresent (#378)

Containers will get stuck in ErrImagePull/ImagePullBackOff state otherwise

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Fetcher called when pod is created for newDeploy backend but also supports older way, this is WIP and still needs pod specialization and creating & exposing a service so the URL can be hit by end user

* WIP Specializing the POD as part of startup along with fetching

* Working specialization of a new deployment. Needs some work on caching, cleanup etc.

* Switched to service based address instead of POD address

* Minor formating issue fixed

* Added logging to pods and a readiness check, the readiness check is flaky though ATM

* Fixed some rebase issues that were failing build

* Better names for K8S objects and methods

* Switched usage of FuncSvc in backends from pod to api.ObjectReference

* Adding retry to fetcher request, for now just using default retry client which might need tweaking in future

* Switching to plain old retry, some issue in getting retryablehttp with glide import

* Removed stale executor service & deployment from previous merge

* Addressed review comments, still testing some areas

* Added types in FunctionSpec

* Resolved conflicts due to merge from executor_abstraction branch

* Added backend type on EnvironmentSpec along with operations for create/list/update, the pools are created/destroyed based on change in backend type

* Backend from types and a minor err return issue fixed

* Draft version of CPU and memory parameters added to environment

* Added resourceReq to newDeploy, though it has some issues

* Issue with resourceName fixed, now newdeploy pods also pick up resources from the environment config

* Adding scale params, removing validation on CPU params for now

* Fixed a formatting issue

* Checking if slight more delay helps in the test which is currently failing for internal routes

* The resourceList newly added in Env can not be compared by compiler, hence must use breakdown comparison instead

* Added strategy selection on client side

* Added caching, informers, delete operations for newdeploy backend functions

* Deleted a stale directory

* A simple HPA based on scale parameters, testing still WIP

* Fixed a small issue in delete function, added HPA delete too when deleting a function

* Previous merge missed the pkg flag for update fn command somehow, fixed that

* Fixed comments from review

* Changed poolmgr cleanup to be generic cleanup and moved to executor, added instanceID labels to newdeploy so that cleanup works

* Moved instanceIdLabel to types to avoid cyclic dependency

* More review fixes

* Tweaking sleep to see results

* If user does not provide poolsize, then it should not default to zero

* Switched to naming convention for now, fixed default poolsize if not provided

* Changed error return behaviour in delete fn, also changed cleanup to look based on obj type though support for additional type will need more work

* Changed check location so avoid false logging

* Test for newdeploy backend

* Adding tests for poolmgr backend

* Fixed an issue with glide dependency version, already fixed in master

* Added instanceId for NewDeploy, Initial cleanup now cleans older objects of newdeploy backend, removed eagercreate flag and instead using minScale to drive eager creation

* Moved cleanup to executor layer with cleanup for newDeploy backend, changes to use the new Cache impl

* Cleaning up pod & rs along with deployment for newdeploy backend

* Enhanced fn and env listing to show min/maxscale and resuorces respectively

* Added conditional heapster deployment and fixed a small issue with resources for fetcher container in function pod

* Addressed review comments from previous change

* Addressed some more review comments - majorly create only on NotFoundError

* Added TargetCPU as an input for scaling

* Bumped target CPU to be greater than 0 and added a default value

* Min replicas should be 1 even if the minScale is 0 when creating deployment

* Changed name from 'backend' to executorType, added additional test for minscale 0 case, changed TargetCPU to TargetCPUPercent
2018-02-03 01:02:28 +08:00
smruthi2187andTa-Ching Chen 31ba992726 Archive pruner (#471)
All functions have a pkg reference. This can be a package with either source and a deploy archives, or, a deploy archive. Everytime a function is updated, a new package is created. With archive pruner, the archives that are pointed to by old pkg reference can be deleted from the storage.

* High level spec for package pruning.
* Skeleton for archive pruning
* Adding meat 1 to skeleton.
* Adding meat #2. Separated storage service into a httpHandler component and
Storage Layer component.
* Adding meat #3. getOrphanedArchives in pruner and getItems on
stowClient.
* Restructured archivePruner methods.
* Commiting the day's work. Ready for testing #1.
* Fixing compile errors.
* Test ready. added a few logs for debugging.
* Adding a filter for getItems in stowClient.
* After testing.
* Added a test for archivePruner.
* Adding helm value pruneInterval for testing.
* Modified test.
* Final test.
* Fixing interval from seconds to minutes.
* Small change.
* Changing debugs to info.
* Removing the WIP design
* Ran gofmt on all these files.
* Fixing prune_interval as string in ENV var.

* Addressing all comments, but one.

* changing getFile method in stowClient to stream it into a response.

* All comments incorporated.
* Introducing a new flag for running archivePruner.
1. This flag is disabled for archivePruner to run in unit test.
2. This flag is enabled for archivePruner to run in production.
3. Also disabling test_archive_pruner.sh in this PR. Follow up with
next PR to enable it.

* Addressing review comments.

* Changing the command to generate a file dynamically.

* Enabling arching_pruner_test

* giving execute permissions to test_archive_pruner.sh

* Making changes of positional parameters after recent commit.
Change test case permission and removing kubectlPortForward.

* Adding debug to see why test_utils.sh passed junk pruneInterval.

* shell needs special handling for positional parameters from 10.
2018-02-01 18:13:36 +08:00
Erwin van EykandTa-Ching Chen 0c92f59c38 Installation instructions for Fission Workflows (#453) 2018-02-01 03:59:46 +08:00
VishalandTa-Ching Chen c00f76b561 Fix fluentd image tag issue in tests - an additional tag was appended (#469) 2018-02-01 03:03:15 +08:00
Soam VasaniandGitHub 91094cf659 Fix broken redirect (#467)
By default, flask turns redirects into absolute URLs. This is
undesired behaviour on Kubernetes, because the Pod's own IP address is
not really useful to any client that's not in the cluster (and even
within the cluster most clients will want to use the address of a
Service, not a Pod).
2018-01-30 12:00:30 -08:00
Ta-Ching ChenandGitHub 1935098404 Add readiness probe to go env (#461) 2018-01-30 21:36:13 +08:00
Soam VasaniandTa-Ching Chen 7d83859cfb Build and push fluentd image on release; update chart to use that image (#462)
* build and push logger image during release
* Update chart to get the right fluentd image
2018-01-30 21:35:13 +08:00
JustinandTa-Ching Chen 986b300b8c Convert build.sh to a multi-stage Dockerfile. (#452) 2018-01-28 11:49:31 +08:00
Ta-Ching ChenandSoam Vasani 4f7eb19b7c Show warning when user tries to create a function with a non-existent environment (#436)
Show warning when user try to create a function with non-existent environment
2018-01-26 16:35:17 -08:00
Ta-Ching ChenandGitHub 0a733b20c3 Block build requests until environment builder is ready (#437)
* Add readiness probe
* Remove builder manager http api interface since we don’t use/need it
* Check environment builder status and block build requests until builder is ready
* Replace deprecated api extension interface
* Add healthy check to python env
2018-01-26 01:13:36 +08:00
Ta-Ching Chen b7c97cec8c Fix fission bundle build failure 2018-01-24 15:38:52 +08:00
Wang GuoliangandTa-Ching Chen b578819202 Optimize code 2018-01-24 13:43:51 +08:00
Ta-Ching Chen 01bcfad44a Update docs-site 2018-01-23 13:27:10 +08:00
Ta-Ching ChenandSoam Vasani 8df520721c Add go vet check (#430)
* Add go vet check

* Replace go vet with go tool vet to avoid printing exit message
2018-01-22 09:28:16 -08:00
Soam Vasani db372c11eb Version -> 0.4.1 0.4.1 2018-01-20 06:15:11 -08:00
Ta-Ching ChenandSoam Vasani 6a1da19e73 Fix python environment failed to launch due to port needs integer not string (#451) 2018-01-20 06:06:50 -08:00
Soam Vasani 816fd25a6c Version -> 0.4.1 2018-01-20 06:05:19 -08:00
prithvirameshandSoam Vasani c03bb01bca Fix fission function logs (#448)
Remove hard coded field indices in influx query, instead searching for them by name.
2018-01-19 17:37:12 -08:00
VishalandSoam Vasani bed189c715 Fscache support for multiple kubernetes objects (#435)
Modifies the fsCache to support a list of arbitrary kubernetes objects instead of just one pod.  This allows better support for the newdeploy backend.

Also removes the byKubeObject cache index; cleanup is changed to use the byFunction index, and byKubeObject is no longer needed.
2018-01-16 13:05:24 -08:00
Soam VasaniandGitHub 80a4bcbcff Integration test improvements (#447)
A few improvements to the integration test:

* Search for test files recursively in the test dir
* Output a test report at the end for a quick summary of what tests passed/failed/were skipped
* Add support skipping test files; skip the logging test since it's broken (#446 is tracking this)
* Switch to latest helm version
* Cleanup namespace
2018-01-15 16:08:38 -08:00
Graham RoundsandSoam Vasani f420383882 Use storageClassName in Helm Charts (#444) (#445) 2018-01-13 00:24:44 -08:00
Soam Vasani fac508c7e0 Demo script bugfix 2018-01-02 14:10:23 +05:30
Ta-Ching ChenandSoam Vasani 64a82747a9 Improve travi-ci test scripts (#434)
Make our travis-based integration test less flaky:

* Wait for tiller ready before installation

* Remove all existing old releases before installation
2018-01-01 11:34:11 +05:30
Ta-Ching ChenandSoam Vasani 5f9e54bbeb Fix glide failed to check out github.com/dsnet/compress & update gorilla pkg version (#429) 2017-12-14 05:23:49 +05:30
Valentin OuvrardandSoam Vasani 8d6b33258d Format fetcher and specialize URLs correctly in case of IPv6 (#408) 2017-12-11 01:26:13 -06:00
Adam BouhenguelandSoam Vasani be84a864fb Add support for Host matching in HTTP triggers (#425)
Include Host in httptrigger output table and fix duplicate error detection to consider Host as well.
2017-12-11 01:22:05 -06:00
Soam Vasani dff34b08e9 Update install link 2017-12-07 17:33:24 -06:00
Soam VasaniandGitHub 1e6b7a4fc8 Golang v2 environment -- runtime and builder (#427)
v2 environment for Go; includes runtime and builder.
2017-12-06 23:03:05 -06:00
Ta-Ching ChenandSoam Vasani eed3018458 [Issue 423] build logs not saved on build error (#426)
* Fix builder return empty buildlogs when encounters errors

* Append error logs to build logs

* Builder manager updates package with build logs plus error log

* Fix potential nil pointer bug

* Replace numeric status code with built-in const

* Remove no use parameter

* Fix go fmt
2017-12-06 22:20:41 -06:00
Karim BoumedhelandSoam Vasani fa810e6f80 Removed openshift specifics as they are no longer necessary (#424)
tested fission on openshift 3.7.0 and installed fine, without having to use openshift variables
those variables were used prior to switching to custom resource definitions, and as such are obsolete
2017-12-04 13:25:39 -08:00
Soam Vasani b1483e5e78 minor comment update in fetcher 2017-12-01 10:45:31 -08:00
Ta-Ching ChenandSoam Vasani 43fea01bd9 Overwrite request host with internal host to prevent request rejection (#419) 2017-11-30 23:58:14 -08:00
Ta-Ching ChenandSoam Vasani 49169e672d Fix pool manager crash problem if failed at http call (#418) 2017-11-30 13:40:17 -08:00
Ta-Ching ChenandSoam Vasani 140b132c8e Update nats dependencies (#411) 2017-11-28 16:12:31 -08:00
Ta-Ching ChenandSoam Vasani 36008f28d8 Add package command (#385)
Add package command support: This PR adds package command to CLI. package provides some useful subcommands to use such as packages CRUD and display package detail information. Also it is able to reuse existing package at function creation.

* Check function existence before creating package

* Check package existence

* Add support for downloading archive from given url

The functionality was supported before e238776bf7. Add this functionality back for more flexible usage.

* Add output flag to save archive content in specific file

* Add logs when package create/update

* Fix fnCreate requires environment argument when a pkg is specified

* Fix fnUpdate failed to update function pkg info when a package is specified

* Add package command test

* Fix wrong python test image in test script

* Remove package description fields

* Fix package command not update package but creating a new one

* Set package as pending status only when there is no deploy archive

* Rename function from fetchArchiveFromArbitraryURL to downloadToTempFile

* Use io.Copy to prevent loading all body into memory

* Revise some messages

* Allow user to update package build command

* Allow user to update package content when using function update

* Retrieve pkgName from function packageref if it’s not specified

* Fix function failed to update due to resource conflict

* Fix test case failure due to single quote

* kick ci

* Fix failed to update function packageRef

* kick ci

* kick ci
2017-11-25 06:54:43 -08:00
Soam Vasani 8fc1bf4bc1 script to update and copy hugo site 2017-11-23 09:55:16 -08:00
prithvirameshandSoam Vasani 2247d3118a fission function logs returns logs in correct order now (#405)
Fix a bug in `fission function logs` due to which logs with the same timestamp were printed in the wrong order.
2017-11-22 18:05:49 -08:00
VishalandSoam Vasani 04531850d5 Executor API panics if there is err in getting function from backends (#407) 2017-11-22 14:06:36 -08:00
VishalandSoam Vasani 13a58e715d Fetcher retry (#403)
Before this change, poolmgr tried to hit fetcher just once.  However if the pod has just started, fetcher may not be up yet, causing the initial request to fail with a connection refused error.  This change adds a similar retry loop that we currently use on the specialize endpoint of the runtime environment container.
2017-11-22 11:27:37 -08:00
Erwin van EykandSoam Vasani b2678783b6 fission/builder image, log collection improvement in builder (#397)
Create a container image with the buidler, so we can avoid copying the builder binary into the env container during the env container build. 

Gather both stdout and stderr of a build into the logs.
 

* Add Dockerfile for builder + update release scripts

* Improve logging of buildermgr and builder

* Add support for environment-scoped buildcmd

* Fix fork/exec wd when package is a file

* Update tests to also include builder image

* Add logging to builder's fork/exec
2017-11-20 23:58:33 -08:00
VishalandSoam Vasani da820186f0 Executor abstraction (#384)
This change adds a layer of abstraction over poolmgr. Poolmgr is now just one of the ways to turn a function into a service; other implementations will be added. The executor abstraction is a uniform API over all these implementations.

* Executor layer added on top of pool manager

* Removed the external server for executor

* Minor changes to keep existing semantics as much possible

* Separating the executor vs. poolmgr backend functionality and associated data members

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed references to poolmgr in tests

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Executor layer added on top of pool manager

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed podName to a generic objectReference in fscache (#391)

Changed podName to a generic objectReference in function service cache implementation.

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Merged from master with latest changes

* Removed stale executor service & deployment from previous merge

* Addressed review comments, still testing some areas
2017-11-20 20:51:14 -08:00
VishalandSoam Vasani 7bb397dfee Changed podName to a generic objectReference in fscache (#391)
Changed podName to a generic objectReference in function service cache implementation.
2017-11-15 13:57:19 -08:00
Soam Vasani 8a097abf9b Chart version update 0.4.0 2017-11-15 13:25:28 -08:00
Soam Vasani 6d0ebfd881 update version to 0.4.0 in docs 2017-11-15 13:18:50 -08:00