Commit Graph
108 Commits
Author SHA1 Message Date
Ta-Ching ChenandGitHub cf2d35291e Drop unreleased features (record & replay) (#1406)
1. The records are stored in redis which is not migratable to another cluster for the testing purposes.
2. Some of the requests fields are not recorded.
3. People should consider using https://github.com/buger/goreplay which is an existing mature and well-tested solution for testing purposes.
2019-11-13 15:10:32 +08:00
Ta-Ching ChenandGitHub 1cda7e051b Build error formatting on fission spec apply --wait (#1403)
The character `\n` in buildlog stores in package status
are escaped and so when we have to replace them with
actual line breaker.
2019-11-12 21:00:55 +08:00
Ta-Ching ChenandGitHub a645a1e197 Refactor controller client package (#1402)
The function implementations of controller client package are
inconsistent. This PR lets functions reuse the functions
that already implemented and able to set additional headers to
request.
2019-11-12 18:27:52 +08:00
Ta-Ching ChenandGitHub d0276f1d52 Fix fn test failed to query logs from log database (#1401)
When `fn test` failed to retrieve logs from the function
pod, it turns to query logs from the log database. However,
the logdb type flag is not set to `fn test`, hence the logdb
type is empty (even without default value) and cause `fn logs`
returns an error due to unable to find the corresponding log
database type.

This PR adds logdb type flag to `fn test` to resolve the problem.
2019-11-12 03:05:22 +08:00
Ta-Ching ChenandGitHub 4474f5f813 Skip trace for router healthz endpoint (#1400)
Jaeger preserves the trace data of router healthz endpoints
which is not so helpful for monitoring function metrics and
consumes storage to store such trace data.

This PR uses `GetStartOptions` to examine the request's path and
check if it's a request to healthz endpoint. If yes, skip and not
to trace it.
2019-11-12 00:13:17 +08:00
Ta-Ching ChenandGitHub 19e693bf52 Set jaeger collector endpoint as an environment variable (#1399)
To follow 12-factor app rules, make jaeger collector endpoint
as an environment variable instead of CLI args. It's easier to
replace the value in different deployments. Also, we can utilize
valueFrom to get value from the configmap.
2019-11-11 22:41:40 +08:00
Ta-Ching ChenandGitHub 7640f1199d Prettify console output message (#1396) 2019-11-10 16:42:34 +08:00
Ta-Ching ChenandGitHub 7b6e4318d4 Reorder command flag and add missing flags (#1394) 2019-11-10 14:58:29 +08:00
MengZeLeeandTa-Ching Chen fcd1bc0356 fix typo (#1395) 2019-11-10 14:17:56 +08:00
Ta-Ching ChenandGitHub d443eb1c96 Fix CLI exits with status 0 when error occurs (#1393) 2019-11-10 02:43:22 +08:00
Ta-Ching ChenandGitHub c7d0c09f01 Poolmanager wait for function specialization timeout when specializing a pod (#1392) 2019-11-10 00:01:19 +08:00
Ta-Ching ChenandGitHub d3d8ff6c1b Replace flag text with const (#1391) 2019-11-09 22:13:35 +08:00
Ta-Ching ChenandGitHub 1888cd2ac7 Migrate from urfave/cli to cobra (#1385) 2019-11-08 21:22:00 +08:00
Ta-Ching ChenandGitHub b9a5588ca9 Update staticcheck version and fix all warnings (#1381) 2019-11-05 18:09:12 +08:00
Ta-Ching ChenandGitHub 93d4b88d84 Make CLI functions return error instead of fatal out (#1379)
Before this PR, CLI functions fatal out when encountering error
instead of returning it. Such behavior makes it hard to reuse 
the functions nor writing unit tests. This PR aims to make functions 
return errors instead of error out.
2019-11-05 16:50:13 +08:00
Ta-Ching ChenandGitHub b0d27ee5d2 Refactor record command (#1378) 2019-11-05 10:30:16 +08:00
Ta-Ching ChenandGitHub c33f1e112e Fix reverse proxy shows 404 not found when Istio enabled (#1377)
Istio sidecar proxy blocks all requests sent through the reverse proxy
to the target service if the request.Host is not properly set to the
internal target service host. This PR sets the target service hosts
before establishing the proxy for the client in order to pass the
Istio sidecar proxy check.
2019-11-04 21:59:40 +08:00
Ta-Ching ChenandGitHub f288f0f258 Refactor time trigger command (#1376) 2019-11-04 18:26:21 +08:00
Ta-Ching ChenandGitHub d1ed089c3e Refactor mqtrigger command (#1375) 2019-11-04 07:40:18 +08:00
Vivek SinghandTa-Ching Chen e1a64dd0c1 PodSpec support in environment builder (#1369) 2019-11-03 23:05:02 +08:00
Ta-Ching ChenandGitHub 3b6749dce9 Refactor function command (#1372) 2019-11-03 13:31:47 +08:00
Ta-Ching ChenandGitHub ef0a2fa340 Refactor canary config command (#1370) 2019-11-01 15:36:40 +08:00
Ta-Ching ChenandGitHub 2b616ec4e2 Fix utility function uses the wrong flag text to get value (#1368)
The utility function GetMetadata uses wrong flag text to get the resource namespace and could cause the wrong results returned from the API server. This PR changes the function signature that allows users to pass in the flag text in order to get the correct value.
2019-11-01 00:59:50 +08:00
Ta-Ching ChenandGitHub fe02bb1678 Refactor HTTP trigger command (#1367) 2019-10-31 23:40:37 +08:00
Ta-Ching ChenandGitHub e22cdee5f5 Refactor kubewatch command (#1365) 2019-10-31 10:48:27 +08:00
Vivek SinghandTa-Ching Chen 698d591788 Provide secrets and configmaps while updating the functions (#1358) 2019-10-31 00:19:06 +08:00
Ta-Ching ChenandGitHub 3b11ca87f1 Fix accidentally removed timestamp when listing package (#1364) 2019-10-30 23:47:00 +08:00
Chris CamelandTa-Ching Chen bbaf1b0c2d Replace AlwaysSample with ProbabilitySampler in router (#1348) 2019-10-30 20:05:55 +08:00
Ta-Ching ChenandGitHub a151f89eec Move route creation to independent function (#1362) 2019-10-30 05:47:51 +08:00
Ta-Ching ChenandGitHub d20dc9aa64 Allow using URL as archive source when creating functions (#1360)
In the case of large files, it takes a long time for the user to download
the source from the URL and upload it to StorgeSvc through CLI.

This PR allows a user to use URL as the function source when creating a function
and provides a new flag "--keeparchiveurl" to let the user to decided
whether the CLI should download the file first or store the file URL in the
archive directly. If "--keeparchiveurl" is true, then no checksum will be
generated, it's the user's responsibility to ensure the file won't be changed.
2019-10-28 22:37:13 +08:00
Ta-Ching ChenandGitHub 52b5cb0902 Remove UID from CLI output (#1361) 2019-10-28 19:34:02 +08:00
Ta-Ching ChenandGitHub fed30e1b24 Refactor plugin & version subcommands (#1359) 2019-10-22 17:57:56 +08:00
Vivek SinghandTa-Ching Chen 22de11190c Calling the function that handles kafka messages, asynchronously (#1355) 2019-10-19 14:41:46 +08:00
Ta-Ching ChenandGitHub e42f81a7a1 Refactor package CLI command (#1345) 2019-10-13 01:30:20 +08:00
Ta-Ching ChenandGitHub b8311d43ce Fix newdeploy failed to find serviceEntry in cache (#1349)
When a function with executor type newdeploy got created, Newdeploy
is expected to create deployment/HPA/service for it and insert serviceEntry
to the cache for later use. Once clients call the function, newdeploy returns
the serviceEntry to the router.

However, the log shows that the newdeploy was unable to find the entry and
prints "Resource not found - key 'xxx' not found". The root cause is that the
informer controller instead of processing items in parallel, it dispatches XXFunc
to process items one by one. So if there is any problem during the creation of the
kubernetes resource, it takes a longer time to process the next item and hence
the serviceEntry was not inserted before clients call the function.

This PR lets the newdeploy to process items in extra goroutines instead of blocking
the process loop. It's a workaround to solve the problem above, we should consider
using workqueue to solve it in the future.
2019-10-10 23:32:36 +08:00
Ta-Ching ChenandGitHub 1075c5da13 Support encoded path in router (#1347)
Encoded path means the URL path contains encoded string like "/foo%2Fbar".
Gorilla/Mux by default doesn't enable encoded path support, you need to enable
it when initializing the router.

This PR adds a new environment variable USE_ENCODED_PATH to the router
deployment to enable encoded path support.
2019-10-10 02:23:41 +08:00
Suraj BanakarandTa-Ching Chen 395a8adf37 Implement TLS authentication for kafka mqt (#1300)
* use secrets to store keys and certificates
2019-10-10 00:18:57 +08:00
Ta-Ching ChenandGitHub d358a29b17 Fix the namespace mismatch problem when deploying with a single YAML file (#1344)
If a user deploys fission in the namespace which is different from the one in the single YAML file generated by helm, fission components won't be able to talk to each other due to the wrong namespace appends after the service address.

This PR adds --namespace when generating the YAML file to prevent the mismatch problem.
2019-10-09 01:14:56 +08:00
MengZeLeeandTa-Ching Chen c1a3bdd895 Add package filter feature (#1341) 2019-10-05 01:47:17 +08:00
Ta-Ching ChenandGitHub b18462b10b Fix executor doesn't apply user-configured container spec correctly (#1339)
The merge function executor used wasn't merge container correctly, and it
didn't merge all fields in spec except volumeMount & Env which confused people.

To apply the user-configured container correctly, this PR changes the way of merge
and follows rules:

1. Slices are merged and return an error if the elements in the slice have name conflicts.
2. Maps are merged, the value of map of dst container are overridden if the key is the same.
3. The rest of the fields of dst container are overridden directly.
2019-10-04 05:16:04 +08:00
Ta-Ching ChenandGitHub c61442ee76 Remove too verbose and unhelpful debug log (#1336) 2019-10-02 01:35:23 +08:00
Vivek SinghandTa-Ching Chen 96ae708163 package will now be listed, sorted by lastupdatedtime (#1334) 2019-10-01 15:30:51 +08:00
Suraj BanakarandTa-Ching Chen b47b3ecb70 Fix kafka producer and consumer logs show empty objects (#1281) 2019-09-29 23:47:05 +08:00
Ta-Ching ChenandGitHub 7cdc146515 Move Deployment API group from extensions/v1beta1 to apps/v1 (#1331)
In 1.9, kubernetes prompted Deployment to apps/v1 and finally deprecated
extensions/v1beta1 support in 1.16. Users will see the following error message
in log when fission components try to submit Deployment to the k8s API server
and specify extensions/v1beta1 as API group.

error: unable to recognize "deployment": no matches for kind "Deployment" in version "extensions/v1beta1"

This PR updates call to k8s API server and apiKind in chart files to avoid fission failure in 1.16.
2019-09-29 22:16:33 +08:00
Ta-Ching ChenandGitHub e734fa3554 Fix router health route not found if no HTTP triggers created (#1333)
Router readiness probe failed due to kubelet cannot find router healthz endpoint.
This is caused that the healthz endpoint is added only when there is any update request
send to the updateRouterRequestChannel, and makes router failed.

This PR sends an update request right before the router is started to avoid the problem.
2019-09-28 17:43:04 +08:00
Ta-Ching ChenandGitHub 71b587b58e Use ErrorHandler to handle proxy error (#1310)
The router prints error no matter what error type it is.
It's useful for troubleshooting, however, it also prints
the context canceled error, which means that users abort
request before reply and its really normal nowadays. Also,
the router returns 502 if error is not nil and may confused
client if it's a timeout error.

To solve these problems, this PR adds an error handler to
reverse proxy to examine the return error and change the
status code when needed.
2019-09-28 14:22:20 +08:00
Ta-Ching ChenandGitHub 81ae6f38fc Fix spec doesn't update status of failed package when applying spec files (#1332)
Previously, the spec doesn't update the package status if nothing
in the spec file changed. Due to this, the failed package will
always stay in the failed state.

This PR adds a check to see whether a package is in the failed state.
If yes, then changes the state to pending for builder manager to rebuild it.
2019-09-28 04:35:57 +08:00
Ta-Ching ChenandGitHub 7fbb4098a4 Fix empty host value when list http triggers (#1328) 2019-09-28 00:28:14 +08:00
Ta-Ching ChenandGitHub f8af8b91f5 List/Delete HTTP triggers by function (#1327)
Previously, a user has to delete HTTP triggers point to
the same function one by one. This PR adds new flag --function
to list & delete commands. So that user can delete or list all
triggers with the same function. However, this feature is not
working for triggers with canary deployment setup.
2019-09-27 17:21:11 +08:00
Ta-Ching ChenandGitHub b5341edec0 Add Ingress TLS support (#1326)
This PR aims to add the Ingress TLS support by specifying the
TLS secret when creating/updating the HTTP trigger.

Command example:

fission route create --name foo \
    --url /foo/{bar} --function foofn --createingress \
    --ingressannotation "nginx.ingress.kubernetes.io/ssl-redirect=false" \
    --ingressannotation "nginx.ingress.kubernetes.io/use-regex=true" \
    --ingressrule "*=/foo/*"
    --ingresstls "foobartls"
2019-09-27 00:49:23 +08:00