Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6a8734aae | ||
|
|
3ee98cd13a | ||
|
|
275da18cf6 | ||
|
|
3f3b11ffbf | ||
|
|
7f8cb69326 | ||
|
|
003c304105 | ||
|
|
763ab475f2 | ||
|
|
4b3f48b537 | ||
|
|
6301a78814 | ||
|
|
506b427124 | ||
|
|
19ae7d5ac6 | ||
|
|
47aaa85108 | ||
|
|
3067ecdee3 | ||
|
|
d9a0ee1e33 | ||
|
|
5cfc8dee5e | ||
|
|
1ad7ac2dcf | ||
|
|
86446c8879 | ||
|
|
df857e3194 | ||
|
|
ad7a3951c5 | ||
|
|
7e8e968013 | ||
|
|
e38baeec36 | ||
|
|
ca28f962d4 | ||
|
|
dfb2c073d2 | ||
|
|
51b264e8ca | ||
|
|
6d2fe08973 | ||
|
|
ccc551112b | ||
|
|
1a5537f4ba | ||
|
|
5c2f0c5f4a | ||
|
|
a66de4c601 | ||
|
|
af73d0ce1a | ||
|
|
04654ca465 | ||
|
|
af10579be9 | ||
|
|
30d24a85b5 | ||
|
|
d8b386a812 | ||
|
|
48e7a13c0f | ||
|
|
70803e37fa | ||
|
|
7a770b8627 | ||
|
|
8b0d99d65d | ||
|
|
3aca0edfcc | ||
|
|
81ece23bfe | ||
|
|
66b9dfa8e9 | ||
|
|
f8e98f9f14 | ||
|
|
b97a3c4b0a | ||
|
|
b5c8ea0e13 | ||
|
|
cf2d35291e | ||
|
|
1cda7e051b | ||
|
|
a645a1e197 | ||
|
|
d0276f1d52 | ||
|
|
4474f5f813 | ||
|
|
19e693bf52 | ||
|
|
825939c820 | ||
|
|
5a9138711b | ||
|
|
7640f1199d | ||
|
|
7b6e4318d4 | ||
|
|
fcd1bc0356 | ||
|
|
d443eb1c96 | ||
|
|
c7d0c09f01 | ||
|
|
d3d8ff6c1b | ||
|
|
6f5f6900b6 | ||
|
|
19753e07e0 | ||
|
|
1888cd2ac7 | ||
|
|
4b456db517 | ||
|
|
9272f0cb2c | ||
|
|
b9a5588ca9 | ||
|
|
93d4b88d84 | ||
|
|
b0d27ee5d2 | ||
|
|
c33f1e112e | ||
|
|
f288f0f258 | ||
|
|
e4f44ffa63 | ||
|
|
d1ed089c3e | ||
|
|
e1a64dd0c1 | ||
|
|
3b6749dce9 | ||
|
|
8f6887280c | ||
|
|
ef0a2fa340 | ||
|
|
2b616ec4e2 | ||
|
|
fe02bb1678 | ||
|
|
fc1aab2472 | ||
|
|
e22cdee5f5 | ||
|
|
698d591788 | ||
|
|
3b11ca87f1 | ||
|
|
bbaf1b0c2d | ||
|
|
a151f89eec | ||
|
|
d20dc9aa64 | ||
|
|
52b5cb0902 | ||
|
|
bc5c181fc2 | ||
|
|
fed30e1b24 | ||
|
|
22de11190c | ||
|
|
e42f81a7a1 | ||
|
|
f30e7df43d | ||
|
|
c930c69629 |
+158
-17
@@ -1,22 +1,163 @@
|
|||||||
# 1.5.0
|
# 1.7.0-rc.2
|
||||||
[Documentation](https://docs.fission.io/)
|
[Documentation](https://docs.fission.io/)
|
||||||
## Downloads for 1.5.0
|
## Downloads for 1.7.0-rc.2
|
||||||
|
|
||||||
|
|
||||||
filename | sha256 hash
|
filename | sha256 hash
|
||||||
-------- | -----------
|
-------- | -----------
|
||||||
[fission-core-1.5.0-minikube.yaml](https://github.com/fission/fission/releases/download/1.5.0/fission-core-1.5.0-minikube.yaml) | `bf804e8106f034b2cb5f7d577ca11a9267db43c4ce9c937af879b8a8f35f422a`
|
[fission-all-1.7.0-rc.2-openshift.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-all-1.7.0-rc.2-openshift.yaml) | `67c0ffcb0e156b87237cd3a712a1435f09365701f4c516d5e9a83cb3f1c73041`
|
||||||
[fission-all-1.5.0-minikube.yaml](https://github.com/fission/fission/releases/download/1.5.0/fission-all-1.5.0-minikube.yaml) | `fc526cde3f18d1cf5a86fa5f3612e0120cb1a0544012ec02292a666d9aed840b`
|
[fission-core-1.7.0-rc.2.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-core-1.7.0-rc.2.yaml) | `79e620b73b6a6b9f3f0290aa5b8b6daf7f77e938e34e839fc8b84cee00351b49`
|
||||||
[fission-all-1.5.0.yaml](https://github.com/fission/fission/releases/download/1.5.0/fission-all-1.5.0.yaml) | `c67b40869823f2ac436a02bb6d15dc68f531c1032c6af3bfdd4cee2a9d43399d`
|
[fission-core-1.7.0-rc.2-openshift.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-core-1.7.0-rc.2-openshift.yaml) | `a180331a308500cc6bc936b6c6f262bef69e6d75d5d0a1a54e5912845822ff51`
|
||||||
[fission-core-1.5.0.yaml](https://github.com/fission/fission/releases/download/1.5.0/fission-core-1.5.0.yaml) | `b15a1771955700c33abf63fe523d2c3393186a4d0f456b5a274aa1434cf7ba3b`
|
[fission-all-1.7.0-rc.2-minikube.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-all-1.7.0-rc.2-minikube.yaml) | `7c43a8acc3125e4a25444cedda15e045c90d911689cb18042ce7c4a0f7b6cc73`
|
||||||
[fission-all-1.5.0.tgz](https://github.com/fission/fission/releases/download/1.5.0/fission-all-1.5.0.tgz) | `07e6430f73d1eee0dfb4bd558bc05d51d828332ce2ec7d5b25a0b3722c175bc1`
|
[fission-core-1.7.0-rc.2-minikube.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-core-1.7.0-rc.2-minikube.yaml) | `9c052808104ae833e7d2ed23403f2c84a595f525ef7b9e53dee6b70a810cf032`
|
||||||
[fission-core-1.5.0.tgz](https://github.com/fission/fission/releases/download/1.5.0/fission-core-1.5.0.tgz) | `d13ac896f0ef480ede0cd505f3dd55370e2f16ed5dc1b5ad3bc67a2e06623aac`
|
[fission-all-1.7.0-rc.2.yaml](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-all-1.7.0-rc.2.yaml) | `594ebff290c13ad590a0fa44bbbd45a5b5e0ee6fac853d197e7bc756773c5089`
|
||||||
[fission-cli-osx](https://github.com/fission/fission/releases/download/1.5.0/fission-cli-osx) | `e3415e4c64d404b4065c420d7b62bf1b702e08b40b6018672545f2f2637a2d04`
|
[fission-core-1.7.0-rc.2.tgz](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-core-1.7.0-rc.2.tgz) | `8ba194e2bf9cf5ea95b851093675268d1bcb713bdf2f9f8ed0fae26fe7731718`
|
||||||
[fission-cli-windows.exe](https://github.com/fission/fission/releases/download/1.5.0/fission-cli-windows.exe) | `b539ab484fac6f7a9b513df1f652fc93f5a39cf9a44237c0ba7457b863a05c36`
|
[fission-all-1.7.0-rc.2.tgz](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-all-1.7.0-rc.2.tgz) | `76359916272b408ee21e18a74e230d5f344bea5d95a050fc931547760a8b52b1`
|
||||||
[fission-cli-linux](https://github.com/fission/fission/releases/download/1.5.0/fission-cli-linux) | `d399aa01dac007a69c74be99944767e76321b067d29be64edd73b45d2a23d002`
|
[fission-cli-osx](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-cli-osx) | `0b79ba3bd1d74e3fdac12f966753c5268df3f32f7fdab3d11431fdfbd8d3e5d2`
|
||||||
|
[fission-cli-windows.exe](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-cli-windows.exe) | `9f94e3ad7248b7f5883e78a8a7c0fb41ec7467680be445582e7e5fb1f6a62a50`
|
||||||
|
[fission-cli-linux](https://github.com/fission/fission/releases/download/1.7.0-rc.2/fission-cli-linux) | `0f37a1164df007c540e36dead66226fc9919ad5182aa479baabc46da2e9ee72f`
|
||||||
|
|
||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.7.0-rc.2](https://github.com/fission/fission/tree/1.7.0-rc.2) (2019-11-27)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/v1.7.0-rc.2...1.7.0-rc.2)
|
||||||
|
|
||||||
|
## [v1.7.0-rc.2](https://github.com/fission/fission/tree/v1.7.0-rc.2) (2019-11-27)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/1.7.0-rc.1...v1.7.0-rc.2)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Push extra tag to fit go module semver tag format [\#1444](https://github.com/fission/fission/pull/1444) ([life1347](https://github.com/life1347))
|
||||||
|
- Adopt existing orphan kubernetes resources when executor starts up [\#1443](https://github.com/fission/fission/pull/1443) ([life1347](https://github.com/life1347))
|
||||||
|
- Revert "Try to fix flaky canary test" [\#1442](https://github.com/fission/fission/pull/1442) ([life1347](https://github.com/life1347))
|
||||||
|
- Try to fix flaky canary test [\#1441](https://github.com/fission/fission/pull/1441) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix router tries to update ingress when createIngress is false [\#1440](https://github.com/fission/fission/pull/1440) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix poolmanager sets 0 timeout for function specialization [\#1439](https://github.com/fission/fission/pull/1439) ([life1347](https://github.com/life1347))
|
||||||
|
- Add huge response body test [\#1437](https://github.com/fission/fission/pull/1437) ([life1347](https://github.com/life1347))
|
||||||
|
- Return error when specialization failed [\#1436](https://github.com/fission/fission/pull/1436) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix poolmanager terminates running function pod periodically [\#1435](https://github.com/fission/fission/pull/1435) ([life1347](https://github.com/life1347))
|
||||||
|
- Allow to tap multiple function services at one time [\#1434](https://github.com/fission/fission/pull/1434) ([life1347](https://github.com/life1347))
|
||||||
|
- Collect function metrics after finishing request [\#1433](https://github.com/fission/fission/pull/1433) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix poolmanager crashes when failed to list environment [\#1432](https://github.com/fission/fission/pull/1432) ([life1347](https://github.com/life1347))
|
||||||
|
- Ability to pull builder image from private registry [\#1431](https://github.com/fission/fission/pull/1431) ([life1347](https://github.com/life1347))
|
||||||
|
- Add checksum and insecure flag for user to skip checksum generation [\#1430](https://github.com/fission/fission/pull/1430) ([life1347](https://github.com/life1347))
|
||||||
|
- Support to set imagePullSecret when creating environment [\#1429](https://github.com/fission/fission/pull/1429) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix no kubeobjs get created if fn created before env creation [\#1428](https://github.com/fission/fission/pull/1428) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix verbosity flag not found in subcommand [\#1425](https://github.com/fission/fission/pull/1425) ([life1347](https://github.com/life1347))
|
||||||
|
- Improve compatibility with Openshift [\#1424](https://github.com/fission/fission/pull/1424) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix truncated body returned from router [\#1420](https://github.com/fission/fission/pull/1420) ([life1347](https://github.com/life1347))
|
||||||
|
- Fission 1.7.0-rc.1 [\#1419](https://github.com/fission/fission/pull/1419) ([life1347](https://github.com/life1347))
|
||||||
|
|
||||||
|
## [1.7.0-rc.1](https://github.com/fission/fission/tree/1.7.0-rc.1) (2019-11-18)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/v1.7.0-rc.1...1.7.0-rc.1)
|
||||||
|
|
||||||
|
## [v1.7.0-rc.1](https://github.com/fission/fission/tree/v1.7.0-rc.1) (2019-11-18)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/1.6.0...v1.7.0-rc.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Update release-builder go and helm version [\#1418](https://github.com/fission/fission/pull/1418) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix failed to find init\_tools.sh [\#1417](https://github.com/fission/fission/pull/1417) ([life1347](https://github.com/life1347))
|
||||||
|
- Support semantic version tags [\#1416](https://github.com/fission/fission/pull/1416) ([life1347](https://github.com/life1347))
|
||||||
|
- Show warning when referencing nonexistent resources in spec [\#1415](https://github.com/fission/fission/pull/1415) ([life1347](https://github.com/life1347))
|
||||||
|
- Add resource info to output message when saving spec file [\#1414](https://github.com/fission/fission/pull/1414) ([life1347](https://github.com/life1347))
|
||||||
|
- Always embed given URL in the archive [\#1413](https://github.com/fission/fission/pull/1413) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix wrong command and flag usage description [\#1412](https://github.com/fission/fission/pull/1412) ([life1347](https://github.com/life1347))
|
||||||
|
- Add --spec to package command [\#1411](https://github.com/fission/fission/pull/1411) ([life1347](https://github.com/life1347))
|
||||||
|
- Drop unreleased features \(record & replay\) [\#1406](https://github.com/fission/fission/pull/1406) ([life1347](https://github.com/life1347))
|
||||||
|
- Build error formatting on fission spec apply --wait [\#1403](https://github.com/fission/fission/pull/1403) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor controller client package [\#1402](https://github.com/fission/fission/pull/1402) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix fn test failed to query logs from log database [\#1401](https://github.com/fission/fission/pull/1401) ([life1347](https://github.com/life1347))
|
||||||
|
- Skip trace for router healthz endpoint [\#1400](https://github.com/fission/fission/pull/1400) ([life1347](https://github.com/life1347))
|
||||||
|
- Set jaeger collector endpoint as an environment variable [\#1399](https://github.com/fission/fission/pull/1399) ([life1347](https://github.com/life1347))
|
||||||
|
- Replace deprecated serviceAccount with serviceAccountName [\#1398](https://github.com/fission/fission/pull/1398) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix helm pre-upgrade check failure problem [\#1397](https://github.com/fission/fission/pull/1397) ([life1347](https://github.com/life1347))
|
||||||
|
- Prettify console output message [\#1396](https://github.com/fission/fission/pull/1396) ([life1347](https://github.com/life1347))
|
||||||
|
- fix typo [\#1395](https://github.com/fission/fission/pull/1395) ([jjmengze](https://github.com/jjmengze))
|
||||||
|
- Reorder command flags and add missing flags [\#1394](https://github.com/fission/fission/pull/1394) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix CLI exits with status 0 when error occurs [\#1393](https://github.com/fission/fission/pull/1393) ([life1347](https://github.com/life1347))
|
||||||
|
- Poolmanager wait for function pod till specialization timeout [\#1392](https://github.com/fission/fission/pull/1392) ([life1347](https://github.com/life1347))
|
||||||
|
- Replace flag text with const [\#1391](https://github.com/fission/fission/pull/1391) ([life1347](https://github.com/life1347))
|
||||||
|
- Update prometheus version and disable it from the default installation [\#1389](https://github.com/fission/fission/pull/1389) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix helm shows "Not a table" issue when install Fission [\#1387](https://github.com/fission/fission/pull/1387) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix githook not aborting push if error occurs [\#1386](https://github.com/fission/fission/pull/1386) ([life1347](https://github.com/life1347))
|
||||||
|
- Migrate from urfave/cli to cobra [\#1385](https://github.com/fission/fission/pull/1385) ([life1347](https://github.com/life1347))
|
||||||
|
- Update maintainer info [\#1383](https://github.com/fission/fission/pull/1383) ([life1347](https://github.com/life1347))
|
||||||
|
- Update Makefile and add git pre-push hook [\#1382](https://github.com/fission/fission/pull/1382) ([life1347](https://github.com/life1347))
|
||||||
|
- Update staticcheck version and fix all warnings [\#1381](https://github.com/fission/fission/pull/1381) ([life1347](https://github.com/life1347))
|
||||||
|
- Make CLI functions return error instead of fatal out [\#1379](https://github.com/fission/fission/pull/1379) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor record command [\#1378](https://github.com/fission/fission/pull/1378) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix reverse proxy shows 404 not found when Istio enabled [\#1377](https://github.com/fission/fission/pull/1377) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor time trigger command [\#1376](https://github.com/fission/fission/pull/1376) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor mqtrigger command [\#1375](https://github.com/fission/fission/pull/1375) ([life1347](https://github.com/life1347))
|
||||||
|
- added example for builder podspec [\#1374](https://github.com/fission/fission/pull/1374) ([viveksinghggits](https://github.com/viveksinghggits))
|
||||||
|
- Refactor function command [\#1372](https://github.com/fission/fission/pull/1372) ([life1347](https://github.com/life1347))
|
||||||
|
- Allow to set API type for tensorflow serving environment [\#1371](https://github.com/fission/fission/pull/1371) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor canary config command [\#1370](https://github.com/fission/fission/pull/1370) ([life1347](https://github.com/life1347))
|
||||||
|
- PodSpec support in environment builder [\#1369](https://github.com/fission/fission/pull/1369) ([viveksinghggits](https://github.com/viveksinghggits))
|
||||||
|
- Fix utility function uses the wrong flag text to get value [\#1368](https://github.com/fission/fission/pull/1368) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor HTTP trigger command [\#1367](https://github.com/fission/fission/pull/1367) ([life1347](https://github.com/life1347))
|
||||||
|
- Update READEME link and add back the basic usage [\#1366](https://github.com/fission/fission/pull/1366) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor kubewatch command [\#1365](https://github.com/fission/fission/pull/1365) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix accidentally removed timestamp when listing package [\#1364](https://github.com/fission/fission/pull/1364) ([life1347](https://github.com/life1347))
|
||||||
|
- Move route creation to function [\#1362](https://github.com/fission/fission/pull/1362) ([life1347](https://github.com/life1347))
|
||||||
|
- Remove UID from CLI output [\#1361](https://github.com/fission/fission/pull/1361) ([life1347](https://github.com/life1347))
|
||||||
|
- Allow using URL as archive source when creating functions [\#1360](https://github.com/fission/fission/pull/1360) ([life1347](https://github.com/life1347))
|
||||||
|
- Refactor plugin & version subcommands [\#1359](https://github.com/fission/fission/pull/1359) ([life1347](https://github.com/life1347))
|
||||||
|
- Provide secrets and configmaps while updating the functions [\#1358](https://github.com/fission/fission/pull/1358) ([viveksinghggits](https://github.com/viveksinghggits))
|
||||||
|
- Update fission architecture doc [\#1356](https://github.com/fission/fission/pull/1356) ([life1347](https://github.com/life1347))
|
||||||
|
- calling the function that handles kafka messages, asynchronously [\#1355](https://github.com/fission/fission/pull/1355) ([viveksinghggits](https://github.com/viveksinghggits))
|
||||||
|
- Fix release script tags wrong image name & sed problem on Linux [\#1353](https://github.com/fission/fission/pull/1353) ([life1347](https://github.com/life1347))
|
||||||
|
- Update CHANGELOG for 1.6.0 [\#1352](https://github.com/fission/fission/pull/1352) ([life1347](https://github.com/life1347))
|
||||||
|
- Replace `AlwaysSample` with `ProbabilitySampler` in router \(\#1215\) [\#1348](https://github.com/fission/fission/pull/1348) ([ccamel](https://github.com/ccamel))
|
||||||
|
- Refactor package CLI command [\#1345](https://github.com/fission/fission/pull/1345) ([life1347](https://github.com/life1347))
|
||||||
|
|
||||||
|
## [1.6.0](https://github.com/fission/fission/tree/1.6.0) (2019-10-10)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/v1.6.0...1.6.0)
|
||||||
|
|
||||||
|
## [v1.6.0](https://github.com/fission/fission/tree/v1.6.0) (2019-10-10)
|
||||||
|
[Full Changelog](https://github.com/fission/fission/compare/1.5.0...v1.6.0)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fission 1.6.0 [\#1351](https://github.com/fission/fission/pull/1351) ([life1347](https://github.com/life1347))
|
||||||
|
- Move statefulset to apps/v1 [\#1350](https://github.com/fission/fission/pull/1350) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix newdeploy failed to find serviceEntry in cache [\#1349](https://github.com/fission/fission/pull/1349) ([life1347](https://github.com/life1347))
|
||||||
|
- Support encoded path in router [\#1347](https://github.com/fission/fission/pull/1347) ([life1347](https://github.com/life1347))
|
||||||
|
- Support custom private go vendor [\#1346](https://github.com/fission/fission/pull/1346) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix the namespace mismatch problem when deploying with a single YAML file [\#1344](https://github.com/fission/fission/pull/1344) ([life1347](https://github.com/life1347))
|
||||||
|
- Move charts executor service to the right place [\#1343](https://github.com/fission/fission/pull/1343) ([life1347](https://github.com/life1347))
|
||||||
|
- Allow to deploy router as DaemonSet [\#1342](https://github.com/fission/fission/pull/1342) ([life1347](https://github.com/life1347))
|
||||||
|
- add package filter feature [\#1341](https://github.com/fission/fission/pull/1341) ([jjmengze](https://github.com/jjmengze))
|
||||||
|
- Bump jvm builder JDK version [\#1340](https://github.com/fission/fission/pull/1340) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix executor doesn't apply user-configured container spec correctly [\#1339](https://github.com/fission/fission/pull/1339) ([life1347](https://github.com/life1347))
|
||||||
|
- Allow to add annotations to router service in helm chart [\#1338](https://github.com/fission/fission/pull/1338) ([prabhu43](https://github.com/prabhu43))
|
||||||
|
- Remove too verbose and unhelpful debug log [\#1336](https://github.com/fission/fission/pull/1336) ([life1347](https://github.com/life1347))
|
||||||
|
- package will now be listed, sorted by lastupdatedtime [\#1334](https://github.com/fission/fission/pull/1334) ([viveksinghggits](https://github.com/viveksinghggits))
|
||||||
|
- Fix router health route not found if no HTTP triggers created [\#1333](https://github.com/fission/fission/pull/1333) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix spec doesn't update status of failed package when applying spec files [\#1332](https://github.com/fission/fission/pull/1332) ([life1347](https://github.com/life1347))
|
||||||
|
- Move Deployment API group from extensions/v1beta1 to apps/v1 [\#1331](https://github.com/fission/fission/pull/1331) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix empty host value when list http triggers [\#1328](https://github.com/fission/fission/pull/1328) ([life1347](https://github.com/life1347))
|
||||||
|
- List/Delete HTTP triggers by function [\#1327](https://github.com/fission/fission/pull/1327) ([life1347](https://github.com/life1347))
|
||||||
|
- Add Ingress TLS support [\#1326](https://github.com/fission/fission/pull/1326) ([life1347](https://github.com/life1347))
|
||||||
|
- Add Ingress host, path and annotations support [\#1325](https://github.com/fission/fission/pull/1325) ([life1347](https://github.com/life1347))
|
||||||
|
- Set maxSurge to 20% for safe rolling upgrade [\#1321](https://github.com/fission/fission/pull/1321) ([life1347](https://github.com/life1347))
|
||||||
|
- Disable revision history for newdeploy [\#1319](https://github.com/fission/fission/pull/1319) ([life1347](https://github.com/life1347))
|
||||||
|
- Pre-built docker go module dependency cache image [\#1318](https://github.com/fission/fission/pull/1318) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix newdeploy doesn't handle error properly [\#1316](https://github.com/fission/fission/pull/1316) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix failed to update specialization timeout [\#1315](https://github.com/fission/fission/pull/1315) ([life1347](https://github.com/life1347))
|
||||||
|
- Add codecov config file [\#1314](https://github.com/fission/fission/pull/1314) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix potential nil pointer problem when using multierror pkg [\#1311](https://github.com/fission/fission/pull/1311) ([life1347](https://github.com/life1347))
|
||||||
|
- Use ErrorHandler to handle proxy error [\#1310](https://github.com/fission/fission/pull/1310) ([life1347](https://github.com/life1347))
|
||||||
|
- Integrate with Codecov [\#1308](https://github.com/fission/fission/pull/1308) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix executor unable to list secrets/configmaps [\#1307](https://github.com/fission/fission/pull/1307) ([life1347](https://github.com/life1347))
|
||||||
|
- Add specialization timeout default value to CLI [\#1305](https://github.com/fission/fission/pull/1305) ([life1347](https://github.com/life1347))
|
||||||
|
- Update CHANGELOG for 1.5.0 [\#1304](https://github.com/fission/fission/pull/1304) ([life1347](https://github.com/life1347))
|
||||||
|
- Fission 1.5.0 [\#1303](https://github.com/fission/fission/pull/1303) ([life1347](https://github.com/life1347))
|
||||||
|
- Implement TLS authentication for kafka mqt [\#1300](https://github.com/fission/fission/pull/1300) ([vadasambar](https://github.com/vadasambar))
|
||||||
|
- Issue 1229: Function level timeout [\#1284](https://github.com/fission/fission/pull/1284) ([parauliya](https://github.com/parauliya))
|
||||||
|
- Fix kafka producer and consumer logs show empty objects [\#1281](https://github.com/fission/fission/pull/1281) ([vadasambar](https://github.com/vadasambar))
|
||||||
|
|
||||||
## [1.5.0](https://github.com/fission/fission/tree/1.5.0) (2019-09-09)
|
## [1.5.0](https://github.com/fission/fission/tree/1.5.0) (2019-09-09)
|
||||||
[Full Changelog](https://github.com/fission/fission/compare/1.4.1...1.5.0)
|
[Full Changelog](https://github.com/fission/fission/compare/1.4.1...1.5.0)
|
||||||
|
|
||||||
@@ -113,6 +254,7 @@ filename | sha256 hash
|
|||||||
- V1.2.1 [\#1178](https://github.com/fission/fission/pull/1178) ([vishal-biyani](https://github.com/vishal-biyani))
|
- V1.2.1 [\#1178](https://github.com/fission/fission/pull/1178) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Skaffold for Fission [\#1172](https://github.com/fission/fission/pull/1172) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Skaffold for Fission [\#1172](https://github.com/fission/fission/pull/1172) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Add affinity support [\#1170](https://github.com/fission/fission/pull/1170) ([laurence-hudson-mindfoundry](https://github.com/laurence-hudson-mindfoundry))
|
- Add affinity support [\#1170](https://github.com/fission/fission/pull/1170) ([laurence-hudson-mindfoundry](https://github.com/laurence-hudson-mindfoundry))
|
||||||
|
- Using templated imagePullPolicy for containers in deployment.yaml [\#1137](https://github.com/fission/fission/pull/1137) ([msshroff](https://github.com/msshroff))
|
||||||
- Refactor test framework [\#1128](https://github.com/fission/fission/pull/1128) ([darkgerm](https://github.com/darkgerm))
|
- Refactor test framework [\#1128](https://github.com/fission/fission/pull/1128) ([darkgerm](https://github.com/darkgerm))
|
||||||
- Pod specs [\#1106](https://github.com/fission/fission/pull/1106) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Pod specs [\#1106](https://github.com/fission/fission/pull/1106) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Allow non-toplevel modules in python environment [\#1042](https://github.com/fission/fission/pull/1042) ([soamvasani](https://github.com/soamvasani))
|
- Allow non-toplevel modules in python environment [\#1042](https://github.com/fission/fission/pull/1042) ([soamvasani](https://github.com/soamvasani))
|
||||||
@@ -139,7 +281,6 @@ filename | sha256 hash
|
|||||||
- Fix TravisCI go environment version to avoid go bugs [\#1154](https://github.com/fission/fission/pull/1154) ([life1347](https://github.com/life1347))
|
- Fix TravisCI go environment version to avoid go bugs [\#1154](https://github.com/fission/fission/pull/1154) ([life1347](https://github.com/life1347))
|
||||||
- \#1132 nodejs environment, increase body size [\#1149](https://github.com/fission/fission/pull/1149) ([JannikZed](https://github.com/JannikZed))
|
- \#1132 nodejs environment, increase body size [\#1149](https://github.com/fission/fission/pull/1149) ([JannikZed](https://github.com/JannikZed))
|
||||||
- Added php builder to release script fixes \#1140 [\#1145](https://github.com/fission/fission/pull/1145) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Added php builder to release script fixes \#1140 [\#1145](https://github.com/fission/fission/pull/1145) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Using templated imagePullPolicy for containers in deployment.yaml [\#1137](https://github.com/fission/fission/pull/1137) ([msshroff](https://github.com/msshroff))
|
|
||||||
- Migrate from glide to official dependencies management tool: Go Module [\#1136](https://github.com/fission/fission/pull/1136) ([life1347](https://github.com/life1347))
|
- Migrate from glide to official dependencies management tool: Go Module [\#1136](https://github.com/fission/fission/pull/1136) ([life1347](https://github.com/life1347))
|
||||||
- Fix misleading log when setup portforward [\#1134](https://github.com/fission/fission/pull/1134) ([life1347](https://github.com/life1347))
|
- Fix misleading log when setup portforward [\#1134](https://github.com/fission/fission/pull/1134) ([life1347](https://github.com/life1347))
|
||||||
- V1.1.0 [\#1129](https://github.com/fission/fission/pull/1129) ([vishal-biyani](https://github.com/vishal-biyani))
|
- V1.1.0 [\#1129](https://github.com/fission/fission/pull/1129) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
@@ -284,6 +425,7 @@ filename | sha256 hash
|
|||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Print status with the get option. [\#907](https://github.com/fission/fission/pull/907) ([smruthi2187](https://github.com/smruthi2187))
|
- Print status with the get option. [\#907](https://github.com/fission/fission/pull/907) ([smruthi2187](https://github.com/smruthi2187))
|
||||||
|
- Fixed the spec validation UX issue [\#898](https://github.com/fission/fission/pull/898) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Check CRD creation error instead of doing return directly [\#897](https://github.com/fission/fission/pull/897) ([life1347](https://github.com/life1347))
|
- Check CRD creation error instead of doing return directly [\#897](https://github.com/fission/fission/pull/897) ([life1347](https://github.com/life1347))
|
||||||
- Fix failed to find release-builder dockerfile & push specific tag [\#870](https://github.com/fission/fission/pull/870) ([life1347](https://github.com/life1347))
|
- Fix failed to find release-builder dockerfile & push specific tag [\#870](https://github.com/fission/fission/pull/870) ([life1347](https://github.com/life1347))
|
||||||
- V0.10.0 [\#868](https://github.com/fission/fission/pull/868) ([life1347](https://github.com/life1347))
|
- V0.10.0 [\#868](https://github.com/fission/fission/pull/868) ([life1347](https://github.com/life1347))
|
||||||
@@ -304,7 +446,6 @@ filename | sha256 hash
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Fixed the spec validation UX issue [\#898](https://github.com/fission/fission/pull/898) ([vishal-biyani](https://github.com/vishal-biyani))
|
|
||||||
- Fix CLI failed to setup port-forward caused by \#712 [\#867](https://github.com/fission/fission/pull/867) ([life1347](https://github.com/life1347))
|
- Fix CLI failed to setup port-forward caused by \#712 [\#867](https://github.com/fission/fission/pull/867) ([life1347](https://github.com/life1347))
|
||||||
- Replay recorded requests by ReqUID [\#864](https://github.com/fission/fission/pull/864) ([Amusement](https://github.com/Amusement))
|
- Replay recorded requests by ReqUID [\#864](https://github.com/fission/fission/pull/864) ([Amusement](https://github.com/Amusement))
|
||||||
- Add cleanup function to test scripts [\#863](https://github.com/fission/fission/pull/863) ([life1347](https://github.com/life1347))
|
- Add cleanup function to test scripts [\#863](https://github.com/fission/fission/pull/863) ([life1347](https://github.com/life1347))
|
||||||
@@ -372,6 +513,7 @@ filename | sha256 hash
|
|||||||
- ArchiveLiteralSizeLimit: Use Constant Instead Hard Code [\#731](https://github.com/fission/fission/pull/731) ([xiekeyang](https://github.com/xiekeyang))
|
- ArchiveLiteralSizeLimit: Use Constant Instead Hard Code [\#731](https://github.com/fission/fission/pull/731) ([xiekeyang](https://github.com/xiekeyang))
|
||||||
- Environment warning message bugfix [\#725](https://github.com/fission/fission/pull/725) ([soamvasani](https://github.com/soamvasani))
|
- Environment warning message bugfix [\#725](https://github.com/fission/fission/pull/725) ([soamvasani](https://github.com/soamvasani))
|
||||||
- V0.8.0 [\#722](https://github.com/fission/fission/pull/722) ([vishal-biyani](https://github.com/vishal-biyani))
|
- V0.8.0 [\#722](https://github.com/fission/fission/pull/722) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
|
- Make fetcher resource requests and limits configurable [\#708](https://github.com/fission/fission/pull/708) ([xiekeyang](https://github.com/xiekeyang))
|
||||||
- Add steps to render & upload fission installation YAML [\#745](https://github.com/fission/fission/pull/745) ([life1347](https://github.com/life1347))
|
- Add steps to render & upload fission installation YAML [\#745](https://github.com/fission/fission/pull/745) ([life1347](https://github.com/life1347))
|
||||||
- Fix executor not reaps idle function pods for functions with executortype newdeploy [\#744](https://github.com/fission/fission/pull/744) ([life1347](https://github.com/life1347))
|
- Fix executor not reaps idle function pods for functions with executortype newdeploy [\#744](https://github.com/fission/fission/pull/744) ([life1347](https://github.com/life1347))
|
||||||
- Testing with keep alive settings for connections [\#742](https://github.com/fission/fission/pull/742) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Testing with keep alive settings for connections [\#742](https://github.com/fission/fission/pull/742) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
@@ -396,7 +538,6 @@ filename | sha256 hash
|
|||||||
- Pre-install/pre-upgrade hooks to verify func references and assign restricted role bindings [\#717](https://github.com/fission/fission/pull/717) ([smruthi2187](https://github.com/smruthi2187))
|
- Pre-install/pre-upgrade hooks to verify func references and assign restricted role bindings [\#717](https://github.com/fission/fission/pull/717) ([smruthi2187](https://github.com/smruthi2187))
|
||||||
- Logger daemonset's update strategy [\#714](https://github.com/fission/fission/pull/714) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Logger daemonset's update strategy [\#714](https://github.com/fission/fission/pull/714) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Check spec directory exists before reading spec files [\#709](https://github.com/fission/fission/pull/709) ([life1347](https://github.com/life1347))
|
- Check spec directory exists before reading spec files [\#709](https://github.com/fission/fission/pull/709) ([life1347](https://github.com/life1347))
|
||||||
- Make fetcher resource requests and limits configurable [\#708](https://github.com/fission/fission/pull/708) ([xiekeyang](https://github.com/xiekeyang))
|
|
||||||
- Formatted specifiers are not compatible with variables [\#706](https://github.com/fission/fission/pull/706) ([xiekeyang](https://github.com/xiekeyang))
|
- Formatted specifiers are not compatible with variables [\#706](https://github.com/fission/fission/pull/706) ([xiekeyang](https://github.com/xiekeyang))
|
||||||
- Indicate HTTP status code by library const [\#703](https://github.com/fission/fission/pull/703) ([xiekeyang](https://github.com/xiekeyang))
|
- Indicate HTTP status code by library const [\#703](https://github.com/fission/fission/pull/703) ([xiekeyang](https://github.com/xiekeyang))
|
||||||
- docker-distribution version bump for windows compatibility [\#691](https://github.com/fission/fission/pull/691) ([thejosephstevens](https://github.com/thejosephstevens))
|
- docker-distribution version bump for windows compatibility [\#691](https://github.com/fission/fission/pull/691) ([thejosephstevens](https://github.com/thejosephstevens))
|
||||||
@@ -582,7 +723,6 @@ filename | sha256 hash
|
|||||||
- Changed podName to a generic objectReference in cache implementation [\#391](https://github.com/fission/fission/pull/391) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Changed podName to a generic objectReference in cache implementation [\#391](https://github.com/fission/fission/pull/391) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Add package command [\#385](https://github.com/fission/fission/pull/385) ([life1347](https://github.com/life1347))
|
- Add package command [\#385](https://github.com/fission/fission/pull/385) ([life1347](https://github.com/life1347))
|
||||||
- Executor abstraction [\#384](https://github.com/fission/fission/pull/384) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Executor abstraction [\#384](https://github.com/fission/fission/pull/384) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Fix builder manager issues [\#367](https://github.com/fission/fission/pull/367) ([life1347](https://github.com/life1347))
|
|
||||||
|
|
||||||
## [0.4.0](https://github.com/fission/fission/tree/0.4.0) (2017-11-15)
|
## [0.4.0](https://github.com/fission/fission/tree/0.4.0) (2017-11-15)
|
||||||
[Full Changelog](https://github.com/fission/fission/compare/0.4.0rc...0.4.0)
|
[Full Changelog](https://github.com/fission/fission/compare/0.4.0rc...0.4.0)
|
||||||
@@ -601,9 +741,11 @@ filename | sha256 hash
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Use store to sync functions/triggers for fast synchronization [\#382](https://github.com/fission/fission/pull/382) ([life1347](https://github.com/life1347))
|
||||||
- Switch from ThirdPartyResources to CustomResourceDefinitions [\#381](https://github.com/fission/fission/pull/381) ([life1347](https://github.com/life1347))
|
- Switch from ThirdPartyResources to CustomResourceDefinitions [\#381](https://github.com/fission/fission/pull/381) ([life1347](https://github.com/life1347))
|
||||||
- changed helm install pullPolicy from Always to IfNotPresent when building local docker image [\#378](https://github.com/fission/fission/pull/378) ([prithviramesh](https://github.com/prithviramesh))
|
- changed helm install pullPolicy from Always to IfNotPresent when building local docker image [\#378](https://github.com/fission/fission/pull/378) ([prithviramesh](https://github.com/prithviramesh))
|
||||||
- Reduce function resolving time [\#376](https://github.com/fission/fission/pull/376) ([life1347](https://github.com/life1347))
|
- Reduce function resolving time [\#376](https://github.com/fission/fission/pull/376) ([life1347](https://github.com/life1347))
|
||||||
|
- Fix builder manager issues [\#367](https://github.com/fission/fission/pull/367) ([life1347](https://github.com/life1347))
|
||||||
- Test functions 236 [\#355](https://github.com/fission/fission/pull/355) ([vishal-biyani](https://github.com/vishal-biyani))
|
- Test functions 236 [\#355](https://github.com/fission/fission/pull/355) ([vishal-biyani](https://github.com/vishal-biyani))
|
||||||
- Make default node-env use alpine. List envs in documentation. [\#354](https://github.com/fission/fission/pull/354) ([rapitable](https://github.com/rapitable))
|
- Make default node-env use alpine. List envs in documentation. [\#354](https://github.com/fission/fission/pull/354) ([rapitable](https://github.com/rapitable))
|
||||||
- Update k8s client version to 4.0.0 [\#351](https://github.com/fission/fission/pull/351) ([life1347](https://github.com/life1347))
|
- Update k8s client version to 4.0.0 [\#351](https://github.com/fission/fission/pull/351) ([life1347](https://github.com/life1347))
|
||||||
@@ -613,7 +755,6 @@ filename | sha256 hash
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Use store to sync functions/triggers for fast synchronization [\#382](https://github.com/fission/fission/pull/382) ([life1347](https://github.com/life1347))
|
|
||||||
- dotnet20 build fixes [\#365](https://github.com/fission/fission/pull/365) ([soamvasani](https://github.com/soamvasani))
|
- dotnet20 build fixes [\#365](https://github.com/fission/fission/pull/365) ([soamvasani](https://github.com/soamvasani))
|
||||||
- Add experimental deploy script [\#364](https://github.com/fission/fission/pull/364) ([erwinvaneyk](https://github.com/erwinvaneyk))
|
- Add experimental deploy script [\#364](https://github.com/fission/fission/pull/364) ([erwinvaneyk](https://github.com/erwinvaneyk))
|
||||||
- Fix workflow apiserver proxy [\#363](https://github.com/fission/fission/pull/363) ([erwinvaneyk](https://github.com/erwinvaneyk))
|
- Fix workflow apiserver proxy [\#363](https://github.com/fission/fission/pull/363) ([erwinvaneyk](https://github.com/erwinvaneyk))
|
||||||
@@ -782,7 +923,6 @@ filename | sha256 hash
|
|||||||
- Primary Helm chart for fission [\#90](https://github.com/fission/fission/pull/90) ([sanketsudake](https://github.com/sanketsudake))
|
- Primary Helm chart for fission [\#90](https://github.com/fission/fission/pull/90) ([sanketsudake](https://github.com/sanketsudake))
|
||||||
- Wait for Pod IP while waiting for pod ready [\#89](https://github.com/fission/fission/pull/89) ([soamvasani](https://github.com/soamvasani))
|
- Wait for Pod IP while waiting for pod ready [\#89](https://github.com/fission/fission/pull/89) ([soamvasani](https://github.com/soamvasani))
|
||||||
- Added support for running C\# code in a dotnet core environment [\#84](https://github.com/fission/fission/pull/84) ([ktrance](https://github.com/ktrance))
|
- Added support for running C\# code in a dotnet core environment [\#84](https://github.com/fission/fission/pull/84) ([ktrance](https://github.com/ktrance))
|
||||||
- Poolmgr: fix pod leak bugs on specializePod failure [\#70](https://github.com/fission/fission/pull/70) ([soamvasani](https://github.com/soamvasani))
|
|
||||||
|
|
||||||
## [alpha20170124](https://github.com/fission/fission/tree/alpha20170124) (2017-01-24)
|
## [alpha20170124](https://github.com/fission/fission/tree/alpha20170124) (2017-01-24)
|
||||||
[Full Changelog](https://github.com/fission/fission/compare/kubecon...alpha20170124)
|
[Full Changelog](https://github.com/fission/fission/compare/kubecon...alpha20170124)
|
||||||
@@ -795,6 +935,7 @@ filename | sha256 hash
|
|||||||
- Bug fix for handling a route's HTTP method in router [\#79](https://github.com/fission/fission/pull/79) ([soamvasani](https://github.com/soamvasani))
|
- Bug fix for handling a route's HTTP method in router [\#79](https://github.com/fission/fission/pull/79) ([soamvasani](https://github.com/soamvasani))
|
||||||
- fission-bundle: allow setting the namespace [\#77](https://github.com/fission/fission/pull/77) ([frodenas](https://github.com/frodenas))
|
- fission-bundle: allow setting the namespace [\#77](https://github.com/fission/fission/pull/77) ([frodenas](https://github.com/frodenas))
|
||||||
- Delete generic pools when environments are deleted [\#75](https://github.com/fission/fission/pull/75) ([soamvasani](https://github.com/soamvasani))
|
- Delete generic pools when environments are deleted [\#75](https://github.com/fission/fission/pull/75) ([soamvasani](https://github.com/soamvasani))
|
||||||
|
- Poolmgr: fix pod leak bugs on specializePod failure [\#70](https://github.com/fission/fission/pull/70) ([soamvasani](https://github.com/soamvasani))
|
||||||
- Poolmgr: ensure orphaned resources are cleaned up [\#69](https://github.com/fission/fission/pull/69) ([soamvasani](https://github.com/soamvasani))
|
- Poolmgr: ensure orphaned resources are cleaned up [\#69](https://github.com/fission/fission/pull/69) ([soamvasani](https://github.com/soamvasani))
|
||||||
- Implement 'fission route update' [\#68](https://github.com/fission/fission/pull/68) ([soamvasani](https://github.com/soamvasani))
|
- Implement 'fission route update' [\#68](https://github.com/fission/fission/pull/68) ([soamvasani](https://github.com/soamvasani))
|
||||||
- Update router cache on new function version [\#67](https://github.com/fission/fission/pull/67) ([soamvasani](https://github.com/soamvasani))
|
- Update router cache on new function version [\#67](https://github.com/fission/fission/pull/67) ([soamvasani](https://github.com/soamvasani))
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported by contacting the project team at codeofconduct@platform9.com. All
|
reported by contacting the project team at slack channel. All
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
|||||||
+1
-2
@@ -34,9 +34,8 @@ If you choose a big chunk of work that involves design changes to
|
|||||||
Fission, please talk to us while planning the change; that way we can
|
Fission, please talk to us while planning the change; that way we can
|
||||||
all be on the same page before you invest too much work into it.
|
all be on the same page before you invest too much work into it.
|
||||||
|
|
||||||
* Drop by the [slack channel](http://slack.fission.io)
|
* Drop by the [slack channel](http://slack.fission.io).
|
||||||
* Say hi on [twitter](https://twitter.com/fissionio).
|
* Say hi on [twitter](https://twitter.com/fissionio).
|
||||||
* Email soamvasani@platform9.com
|
|
||||||
|
|
||||||
### Contribution Howto
|
### Contribution Howto
|
||||||
|
|
||||||
|
|||||||
+148
-92
@@ -1,105 +1,186 @@
|
|||||||
|
# A high-level view of the internals of Fission.
|
||||||
|
|
||||||
A high level view of the internals of Fission.
|
## How it works
|
||||||
|
|
||||||
How it works
|
|
||||||
============
|
|
||||||
|
|
||||||
Fission is a FaaS -- users create functions (source level), register
|
Fission is a FaaS -- users create functions (source level), register
|
||||||
them with fission using a CLI, and associate functions with triggers.
|
them with Fission using a CLI, and associate functions with triggers.
|
||||||
|
|
||||||
Fission wraps those functions into a service, and runs them on
|
Fission wraps those functions into a service and runs them on
|
||||||
Kubernetes on demand.
|
Kubernetes on demand.
|
||||||
|
|
||||||
Here's an overview of the services that make up fission.
|
Here's an overview of the services that make up Fission.
|
||||||
|
|
||||||
Components
|
## Components
|
||||||
==========
|
|
||||||
|
|
||||||
Language-neutral components:
|
Core Components:
|
||||||
|
* Controller
|
||||||
|
* Executor
|
||||||
|
* Environment Container (language-specific)
|
||||||
|
* Router
|
||||||
|
* Builder Manager
|
||||||
|
* Storage Service
|
||||||
|
|
||||||
* controller
|
Optional Components:
|
||||||
* poolmgr
|
* Logger
|
||||||
* router
|
* Kubewatcher
|
||||||
* kubewatcher
|
* Message Queue Trigger
|
||||||
|
* Timer
|
||||||
|
|
||||||
Language-specific components:
|
Third-party components:
|
||||||
|
* InfluxDB: To store function logs.
|
||||||
|
* Prometheus: For metric collection and canary deployment.
|
||||||
|
* NATS Streaming: For message queue trigger. (Kafka, Azure are not included in charts deployment.)
|
||||||
|
|
||||||
* Environment container(s)
|
## Core Components
|
||||||
|
|
||||||
|
### Controller
|
||||||
|
|
||||||
Controller
|
The controller contains CRUD APIs for functions, triggers, environments,
|
||||||
----------
|
Kubernetes event watches, etc. This is the component that the client talks to.
|
||||||
|
|
||||||
The controller contains CRUD APIs for functions, http triggers,
|
All fission resources are stored in kubernetes CRDs. It needs to be able to
|
||||||
environments, Kubernetes event watches. This is the component that
|
talk to kubernetes API service.
|
||||||
the client talks to.
|
|
||||||
|
|
||||||
This is the only stateful component. It needs to be configured with a
|
### Executor
|
||||||
URL to an etcd cluster and a path to a persistent volume. The volume
|
|
||||||
is used to store the functions' source code. Etcd is used as the DB.
|
|
||||||
|
|
||||||
[Work to extend to other storage backends is planned, see issue #83.]
|
The executor has two simple APIs; the router calls both these endpoints.
|
||||||
|
|
||||||
Pool Manager
|
* GetFunctionService takes function metadata and dispatches the corresponding executor
|
||||||
------------
|
type to get the address of a service/pod and returns it to the router.
|
||||||
|
|
||||||
Poolmgr manages pools of generic containers and function containers.
|
* TapService lets executor know a service/pod is being used; if it's not
|
||||||
|
called for a few minutes the pod(s) backing the service are killed.
|
||||||
|
|
||||||
It has a simple API; both these endpoints are called by the router.
|
It now supports two different executor types:
|
||||||
|
|
||||||
* GetFunctionService takes function metadata and returns the address
|
* PoolManager
|
||||||
of a service.
|
* NewDeploy
|
||||||
|
|
||||||
* TapService lets poolmgr know a service is being used; if it's not
|
These two executor types have different strategies to launch, specialize, and manage pod(s).
|
||||||
called for a few minutes the pod(s) backing the service are killed.
|
You should choose one of the executor types wisely based on the scenario.
|
||||||
|
|
||||||
Poolmgr watches the controller API and eagerly creates generic pools
|
#### PoolManager
|
||||||
for environments. It uses Kubernetes deployments to do that. The
|
|
||||||
|
PoolManager manages pools of generic containers and function containers.
|
||||||
|
|
||||||
|
PoolManager watches the environment CRD changes and eagerly creates generic pools
|
||||||
|
for environments. It uses Kubernetes deployments to do that. The
|
||||||
environment container runs in a pod with the 'fetcher' container.
|
environment container runs in a pod with the 'fetcher' container.
|
||||||
Fetcher is a very simple utility that downloads a URL sent to it and
|
Fetcher is a straightforward utility that downloads a URL sent to it
|
||||||
saves it at a configured location.
|
and saves it at a configured location (shared volume).
|
||||||
|
|
||||||
GetFunctionService "specializes" a pod. The implementation chooses a
|
The implementation chooses a generic pod from the pool, relabels it to
|
||||||
pod from the pool, relabels it to "orphan" the pod from the
|
"orphan". The pod from the deployment invokes fetcher to copy the function
|
||||||
deployment, invokes fetcher to copy the function into the pod, and
|
into the pod and hits the specialize endpoint on the environment container.
|
||||||
hits the the specialize endpoint on the environment container. This
|
This causes the function to be loaded. The pod is now specific to that
|
||||||
causes the function to be loaded. The pod is now specific to that
|
function. This function pod is cached; it's cleaned up if it's unused for a few minutes.
|
||||||
function.
|
|
||||||
|
|
||||||
This function pod is cached; it's cleaned up if it's unused for a few
|
PoolManager selects a generic pod from the warm pool, specializes it,
|
||||||
minutes.
|
and recycles the pod if there are no further requests to the function after a few minutes.
|
||||||
|
It makes PoolManager suitable for functions that are short-living
|
||||||
|
and requires a short cold start time [1].
|
||||||
|
|
||||||
Router
|
However, PoolManager only selects one pod per function, which is not
|
||||||
------
|
suitable for serving massive traffic. In such cases, you should consider
|
||||||
|
using NewDeploy as executor type of function.
|
||||||
|
|
||||||
The router forwards HTTP requests to function pods. If there's no
|
[1] The cold start time depends on the package size of the function. If it's
|
||||||
running service for a function, it requests one from poolmgr, while
|
a snippet of code, the cold start time usually is less then 100ms.
|
||||||
holding on to the request; when the function's service is ready it
|
|
||||||
forwards the request.
|
|
||||||
|
|
||||||
The router is stateless and can be scaled up if needed, according to
|
#### NewDeploy
|
||||||
|
|
||||||
|
NewDeploy creates deployment, service, and HPA for functions in order to handle
|
||||||
|
massive traffic.
|
||||||
|
|
||||||
|
NewDeploy watches the function CRD changes and creates a Kubernetes deployment,
|
||||||
|
service, and HPA for a function. NewDeploy will scale the replicas of a function
|
||||||
|
deployment to the minimum feasible scale setting, if the minimum scale setting of
|
||||||
|
a function is greater than 0. The 'fetcher' inside the pod uses a URL in the
|
||||||
|
JSON payload, which is attached as a parameter to start fetcher, to download the
|
||||||
|
function package instead of waiting for calls from NewDeploy.
|
||||||
|
|
||||||
|
When a function experiences a traffic spike, the service helps to distribute the requests to
|
||||||
|
pods belonging to the function for better workload distribution and lower latency. Also,
|
||||||
|
the HPA scales the replicas of the deployment based on the conditions set by the user.
|
||||||
|
|
||||||
|
This approach though increases the cold time of a function, but also makes NewDeploy
|
||||||
|
suitable for functions designed to serve massive traffic.
|
||||||
|
|
||||||
|
### Environment Container
|
||||||
|
|
||||||
|
Environment containers run user-defined functions and are language-specific.
|
||||||
|
Each environment container must contain an HTTP server and a loader for functions.
|
||||||
|
|
||||||
|
The pool manager deploys the environment container into a pod with fetcher
|
||||||
|
(fetcher is a simple utility that can fetch an HTTP URL to a file at a
|
||||||
|
configured location). This pod forms a "generic pod" because it can
|
||||||
|
be loaded with any function in that coding language.
|
||||||
|
|
||||||
|
When the pool manager needs to create a service for a function, it calls
|
||||||
|
fetcher to fetch the function. Fetcher downloads the function into a
|
||||||
|
volume shared between fetcher and this environment container. Poolmgr
|
||||||
|
then requests the container to load the function.
|
||||||
|
|
||||||
|
### Router
|
||||||
|
|
||||||
|
The router forwards HTTP requests to function pods. If there's no
|
||||||
|
running service for a function, it requests one from executor, while
|
||||||
|
holding on to the request; the router will forward the request to
|
||||||
|
the pod once the function service is ready.
|
||||||
|
|
||||||
|
The router is the only stateless component and can be scaled up if needed, according to
|
||||||
load.
|
load.
|
||||||
|
|
||||||
Kubewatcher
|
### Builder Manager
|
||||||
-----------
|
|
||||||
|
The builder manager watches the package & environments CRD changes and manages
|
||||||
|
the builds of function source code. Once an environment that contains a builder
|
||||||
|
image is created, the builder manager will then creates the Kubernetes service
|
||||||
|
and deployment under the fission-builder namespace to start the environment
|
||||||
|
builder. And once a package that contains a source archive is created, the
|
||||||
|
builder manager talks to the environment builder to build the function's source
|
||||||
|
archive into a deploy archive for function deployment.
|
||||||
|
|
||||||
|
After the build, the builder manager asks Builder to upload the deploy archive to the
|
||||||
|
Storage Service once the build succeeded, and updates the package status attached with build logs.
|
||||||
|
|
||||||
|
### Storage Service
|
||||||
|
|
||||||
|
The storage service is the home for all archives of packages with sizes larger than 256KB.
|
||||||
|
The Builder pulls the source archive from the storage service and uploads deploy archive to it.
|
||||||
|
The fetcher inside the function pod also pulls the deploy archive for function specialization.
|
||||||
|
|
||||||
|
## Optional Components
|
||||||
|
|
||||||
|
### Logger
|
||||||
|
|
||||||
|
Logger is deployed as DaemonSet to help to forward function logs to a centralized
|
||||||
|
database service for log persistence. Currently, only InfluxDB is supported to store logs.
|
||||||
|
|
||||||
|
Following is a diagram describe how log service works:
|
||||||
|
1. Logger watches pod changes and creates a symlink to the container log if the pod runs on the same node.
|
||||||
|
2. Fluentd reads logs from symlink and pipes them to InfluxDB
|
||||||
|
3. `fission function logs ...` retrieve event logs from InfluxDB with optional log filter
|
||||||
|
4. Logger removes the symlink if the pod no longer exists.
|
||||||
|
|
||||||
|
### Kubewatcher
|
||||||
|
|
||||||
Kubewatcher watches the Kubernetes API and invokes functions
|
Kubewatcher watches the Kubernetes API and invokes functions
|
||||||
associated with watches, sending the watch event to the function.
|
associated with watches, sending the watch event to the function.
|
||||||
|
|
||||||
The controller keeps track of user's requested watches and associated
|
The controller keeps track of the user's requested watches and associated
|
||||||
functions. Kubewatcher watches the API based on these requests; when
|
functions. Kubewatcher watches the API based on these requests; when
|
||||||
a watch event occurs, it serializes the object and calls the function
|
a watch event occurs, it serializes the object and calls the function
|
||||||
via the router.
|
via the router.
|
||||||
|
|
||||||
While a few simple retries are done, there isn't yet a reliable
|
While a few simple retries are done, there isn't yet a reliable
|
||||||
message bus between Kubewatcher and the function. Work for this is
|
message bus between Kubewatcher and the function. Work for this is
|
||||||
tracked in issue #64.
|
tracked in issue #64.
|
||||||
|
|
||||||
Message Queue Trigger
|
### Message Queue Trigger
|
||||||
---------------------
|
|
||||||
|
|
||||||
A message queue trigger binds a message queue topic to a function:
|
A message queue trigger binds a message queue topic to a function:
|
||||||
events from that topic cause the function to be invoked with the
|
Events from that topic cause the function to be invoked with the
|
||||||
message as the body of the request. The trigger may also contain a
|
message as the body of the request. The trigger may also contain a
|
||||||
response topic: if specified, the function's output is sent to this
|
response topic: if specified, the function's output is sent to this
|
||||||
response.
|
response.
|
||||||
@@ -108,37 +189,12 @@ Here's a diagram of the components:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Environment Container
|
### Timer
|
||||||
---------------------
|
|
||||||
|
|
||||||
Environment containers run user-defined functions. Environment
|
The timer works like kubernetes CronJob but instead of creating a pod to do the task,
|
||||||
containers are language specific. Each environment container must
|
it sends a request to router to invoke the function. It's suitable for the background tasks that
|
||||||
contain an HTTP server and a loader for functions.
|
need to executor periodically.
|
||||||
|
|
||||||
Poolmgr deploys the environment container into a pod with fetcher
|
The timer works like a Kubernetes CronJob, but instead of creating a
|
||||||
(fetcher is a simple utility that can fetch an HTTP url to a file at a
|
pod to do the task, it sends a request to the router to invoke the
|
||||||
configured location). This pod forms a "generic pod", because it can
|
function. It is suitable for background tasks that need to execute periodically.
|
||||||
be loaded with any function in that language.
|
|
||||||
|
|
||||||
When poolmgr needs to create a service for a function, it calls
|
|
||||||
fetcher to fetch the function. Fetcher downloads the function into a
|
|
||||||
volume shared between fetcher and this environment container. Poolmgr
|
|
||||||
then requests the container to load the function.
|
|
||||||
|
|
||||||
Logger
|
|
||||||
------
|
|
||||||
|
|
||||||
Logger helps to forward function logs to centralized db service for log
|
|
||||||
persistence. Currently only influxdb is supported to store logs.
|
|
||||||
Following is a diagram describe how log service works:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
1. Pool manager chooses a pod from the pool to execute user function
|
|
||||||
2. Pool manager makes a HTTP POST to logger helper, once helper receives
|
|
||||||
the request it creates a symlink to container log for fluentd.
|
|
||||||
3. Fluentd reads log from symlink and pipes to influxdb
|
|
||||||
4. `fission function logs ...` retrieve event logs from influxdb with
|
|
||||||
optional log filter
|
|
||||||
5. Pool manager removes function pod from pool
|
|
||||||
6. Pool manager asks logger helper to stop piping logs, logger removes symlink.
|
|
||||||
|
|||||||
@@ -11,36 +11,38 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
.PHONY: test
|
|
||||||
.DEFAULT_GOAL := build
|
|
||||||
|
|
||||||
IMAGE ?= fission/fission-bundle
|
.DEFAULT_GOAL := check
|
||||||
VERSION ?= latest
|
|
||||||
ARCH ?= amd64
|
|
||||||
OS ?= linux
|
|
||||||
|
|
||||||
test:
|
check: test-run build clean
|
||||||
go test -v $(go list ./... | grep -v /examples/ | grep -v /environments/)
|
|
||||||
|
|
||||||
build: build-bundle build-client
|
# run basic check scripts
|
||||||
|
test-run:
|
||||||
|
hack/verify-gofmt.sh
|
||||||
|
hack/verify-govet.sh
|
||||||
|
hack/verify-staticcheck.sh
|
||||||
|
hack/runtests.sh
|
||||||
|
@rm -f coverage.txt
|
||||||
|
|
||||||
build-client:
|
# ensure the changes are buildable
|
||||||
|
build:
|
||||||
|
go build -o cmd/fission-bundle/fission-bundle ./cmd/fission-bundle/
|
||||||
go build -o cmd/fission-cli/fission ./cmd/fission-cli/
|
go build -o cmd/fission-cli/fission ./cmd/fission-cli/
|
||||||
|
go build -o cmd/fetcher/fetcher ./cmd/fetcher/
|
||||||
|
go build -o cmd/fetcher/builder ./cmd/builder/
|
||||||
|
|
||||||
build-bundle:
|
# install CLI binary to $PATH
|
||||||
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o cmd/fission-bundle/fission-bundle ./cmd/fission-bundle/
|
install: build
|
||||||
|
mv cmd/fission-cli/fission $(GOPATH)/bin
|
||||||
|
|
||||||
build-image:
|
# build images (environment images are not included)
|
||||||
docker build --rm --tag "$(IMAGE):$(VERSION)" cmd/fission-bundle/
|
image:
|
||||||
|
docker build -t fission-bundle -f cmd/fission-bundle/Dockerfile.fission-bundle .
|
||||||
install:
|
docker build -t fetcher -f cmd/fetcher/Dockerfile.fission-fetcher .
|
||||||
go install ./cmd/fission-cli/
|
docker build -t builder -f cmd/builder/Dockerfile.fission-builder .
|
||||||
|
|
||||||
image: build-bundle build-image
|
|
||||||
|
|
||||||
image-push: image
|
|
||||||
docker push "$(IMAGE):$(VERSION)"
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f fission-bundle/fission-bundle
|
@rm -f cmd/fission-bundle/fission-bundle
|
||||||
@rm -f fission/fission
|
@rm -f cmd/fission-cli/fission
|
||||||
|
@rm -f cmd/fetcher/fetcher
|
||||||
|
@rm -f cmd/fetcher/builder
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Fission: Serverless Functions for Kubernetes
|
# Fission: Serverless Functions for Kubernetes
|
||||||
============================================
|
|
||||||
[](https://travis-ci.org/fission/fission)
|
[](https://travis-ci.org/fission/fission)
|
||||||
[](https://goreportcard.com/report/github.com/fission/fission)
|
[](https://goreportcard.com/report/github.com/fission/fission)
|
||||||
[](http://slack.fission.io)
|
[](http://slack.fission.io)
|
||||||
@@ -18,7 +18,7 @@ language-specific parts are isolated in something called
|
|||||||
_environments_ (more below). Fission currently supports NodeJS, Python, Ruby, Go,
|
_environments_ (more below). Fission currently supports NodeJS, Python, Ruby, Go,
|
||||||
PHP, Bash, and any Linux executable, with more languages coming soon.
|
PHP, Bash, and any Linux executable, with more languages coming soon.
|
||||||
|
|
||||||
### Performance: 100msec cold start
|
# Performance: 100msec cold start
|
||||||
|
|
||||||
Fission maintains a pool of "warm" containers that each contain a
|
Fission maintains a pool of "warm" containers that each contain a
|
||||||
small dynamic loader. When a function is first called,
|
small dynamic loader. When a function is first called,
|
||||||
@@ -26,7 +26,7 @@ i.e. "cold-started", a running container is chosen and the function is
|
|||||||
loaded. This pool is what makes Fission fast: cold-start latencies
|
loaded. This pool is what makes Fission fast: cold-start latencies
|
||||||
are typically about 100msec.
|
are typically about 100msec.
|
||||||
|
|
||||||
### Kubernetes is the right place for Serverless
|
# Kubernetes is the right place for Serverless
|
||||||
|
|
||||||
We're built on Kubernetes because we think any non-trivial app will
|
We're built on Kubernetes because we think any non-trivial app will
|
||||||
use a combination of serverless functions and more conventional
|
use a combination of serverless functions and more conventional
|
||||||
@@ -37,30 +37,53 @@ Building on Kubernetes also means that anything you do for operations
|
|||||||
on your Kubernetes cluster — such as monitoring or log
|
on your Kubernetes cluster — such as monitoring or log
|
||||||
aggregation — also helps with ops on your Fission deployment.
|
aggregation — also helps with ops on your Fission deployment.
|
||||||
|
|
||||||
Getting started and documentation
|
# Getting started and documentation
|
||||||
===============================
|
|
||||||
|
|
||||||
You can learn more about Fission and get started from [Fission Docs](https://docs.fission.io).
|
## Fission Concepts
|
||||||
* See the [installation guide](https://docs.fission.io/installation/) for installing and running Fission.
|
|
||||||
* See the [troubleshooting guide](https://docs.fission.io/trouble-shooting/) for debugging your functions and Fission installation.
|
|
||||||
|
|
||||||
Contributing
|
Visit [concepts](https://docs.fission.io/docs/concepts/) for more details.
|
||||||
=================
|
|
||||||
|
|
||||||
### Building Fission
|
## Documentations
|
||||||
See the [compilation guide](https://docs.fission.io/contributing/).
|
|
||||||
|
|
||||||
### Contact
|
You can learn more about Fission and get started from [Fission Docs](https://docs.fission.io/docs).
|
||||||
Reach us on [slack](http://slack.fission.io) or
|
* See the [installation guide](https://docs.fission.io/docs/installation/) for installing and running Fission.
|
||||||
[twitter](https://twitter.com/fissionio).
|
* See the [troubleshooting guide](https://docs.fission.io/docs/trouble-shooting/) for debugging your functions and Fission installation.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Add the stock NodeJS env to your Fission deployment
|
||||||
|
$ fission env create --name nodejs --image fission/node-env
|
||||||
|
|
||||||
|
# A javascript one-liner that prints "hello world"
|
||||||
|
$ curl https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js > hello.js
|
||||||
|
|
||||||
|
# Upload your function code to fission
|
||||||
|
$ fission function create --name hello --env nodejs --code hello.js
|
||||||
|
|
||||||
|
# Map GET /hello to your new function
|
||||||
|
$ fission route create --method GET --url /hello --function hello
|
||||||
|
|
||||||
|
# Run the function. This takes about 100msec the first time.
|
||||||
|
$ fission function test --name hello
|
||||||
|
Hello, world!
|
||||||
|
```
|
||||||
|
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Building Fission
|
||||||
|
See the [compilation guide](https://docs.fission.io/docs/contributing/).
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
Reach us on [slack](http://slack.fission.io) or [twitter](https://twitter.com/fissionio).
|
||||||
|
|
||||||
Fission is a project by [many contributors](https://github.com/fission/fission/graphs/contributors).
|
Fission is a project by [many contributors](https://github.com/fission/fission/graphs/contributors).
|
||||||
|
|
||||||
### Community meeting
|
## Community meeting
|
||||||
|
|
||||||
A regular community meeting takes place every other Thursday at 08:30 AM PT (Pacific Time). [Convert to your local timezone](http://www.thetimezoneconverter.com/?t=08:30&tz=PT%20%28Pacific%20Time%29).
|
A regular community meeting takes place every other Thursday at 08:30 AM PT (Pacific Time). [Convert to your local timezone](http://www.thetimezoneconverter.com/?t=08:30&tz=PT%20%28Pacific%20Time%29).
|
||||||
|
|
||||||
## Official Releases
|
# Official Releases
|
||||||
|
|
||||||
Official releases of Fission can be found on [the releases page](https://github.com/fission/fission/releases).
|
Official releases of Fission can be found on [the releases page](https://github.com/fission/fission/releases).
|
||||||
Please note that it is strongly recommended that you use official releases of Fission, as unreleased versions from
|
Please note that it is strongly recommended that you use official releases of Fission, as unreleased versions from
|
||||||
@@ -68,6 +91,6 @@ the master branch are subject to changes and incompatibilities that will not be
|
|||||||
Builds from the master branch can have functionality changed and even removed at any time without compatibility support
|
Builds from the master branch can have functionality changed and even removed at any time without compatibility support
|
||||||
and without prior notice.
|
and without prior notice.
|
||||||
|
|
||||||
## Licensing
|
# Licensing
|
||||||
|
|
||||||
Fission is under the Apache 2.0 license.
|
Fission is under the Apache 2.0 license.
|
||||||
|
|||||||
+6
-3
@@ -43,10 +43,10 @@ Parameter | Description | Default
|
|||||||
`routerServiceType` | Type of Fission Router service to use. For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. | `LoadBalancer`
|
`routerServiceType` | Type of Fission Router service to use. For minikube, set this to NodePort, elsewhere use LoadBalancer or ClusterIP. | `LoadBalancer`
|
||||||
`repository` | Image base repository | `index.docker.io`
|
`repository` | Image base repository | `index.docker.io`
|
||||||
`image` | Fission image repository | `fission/fission-bundle`
|
`image` | Fission image repository | `fission/fission-bundle`
|
||||||
`imageTag` | Fission image tag | `1.6.0`
|
`imageTag` | Fission image tag | `1.7.0`
|
||||||
`pullPolicy` | Image pull policy | `IfNotPresent`
|
`pullPolicy` | Image pull policy | `IfNotPresent`
|
||||||
`fetcherImage` | Fission fetcher repository | `fission/fetcher`
|
`fetcherImage` | Fission fetcher repository | `fission/fetcher`
|
||||||
`fetcherImageTag` | Fission fetcher image tag | `1.6.0`
|
`fetcherImageTag` | Fission fetcher image tag | `1.7.0`
|
||||||
`controllerPort` | Fission Controller service port | `31313`
|
`controllerPort` | Fission Controller service port | `31313`
|
||||||
`routerPort` | Fission Router service port | ` 31314`
|
`routerPort` | Fission Router service port | ` 31314`
|
||||||
`functionNamespace` | Namespace in which to run fission functions (this is different from the release namespace) | `fission-function`
|
`functionNamespace` | Namespace in which to run fission functions (this is different from the release namespace) | `fission-function`
|
||||||
@@ -62,14 +62,17 @@ Parameter | Description | Default
|
|||||||
`pruneInterval` | The frequency of archive pruner (in minutes) | `60`
|
`pruneInterval` | The frequency of archive pruner (in minutes) | `60`
|
||||||
`preUpgradeChecksImage` | Fission pre-install/pre-upgrade checks live in this image | `fission/pre-upgrade-checks`
|
`preUpgradeChecksImage` | Fission pre-install/pre-upgrade checks live in this image | `fission/pre-upgrade-checks`
|
||||||
`debugEnv` | If there are any pod specialization errors when a function is triggered and this flag is set to true, the error summary is returned as part of http response | `true`
|
`debugEnv` | If there are any pod specialization errors when a function is triggered and this flag is set to true, the error summary is returned as part of http response | `true`
|
||||||
`prometheusDeploy` | Set to true if prometheus needs to be deployed along with fission | `true` in `fission-all`, `false` in `fission-core`
|
`prometheus.enabled` | Set to true if prometheus needs to be deployed along with fission | `true` in `fission-all`, `false` in `fission-core`
|
||||||
|
`prometheus.serviceEndpoint` | If prometheus.enabled is false, please assign the prometheus service URL that is accessible by components. | `nil`
|
||||||
`canaryDeployment.enabled` | Set to true if you need canary deployment feature | `true` in `fission-all`, `false` in `fission-core`
|
`canaryDeployment.enabled` | Set to true if you need canary deployment feature | `true` in `fission-all`, `false` in `fission-core`
|
||||||
`extraCoreComponentPodConfig` | Extend the container specs for the core fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. | None
|
`extraCoreComponentPodConfig` | Extend the container specs for the core fission pods. Can be used to add things like affinty/tolerations/nodeSelectors/etc. | None
|
||||||
|
`executor.adoptExistingResources` | If true, executor will try to adopt existing resources created by the old executor instance. | `false`
|
||||||
`router.deployAsDaemonSet` | Deploy router as DaemonSet instead of Deployment | `false`
|
`router.deployAsDaemonSet` | Deploy router as DaemonSet instead of Deployment | `false`
|
||||||
`router.svcAddressMaxRetries` | Max retries times for router to retry on a certain service URL returns from cache/executor | `5`
|
`router.svcAddressMaxRetries` | Max retries times for router to retry on a certain service URL returns from cache/executor | `5`
|
||||||
`router.svcAddressUpdateTimeout` | The length of update lock expiry time for router to get a service URL returns from executor | `30`
|
`router.svcAddressUpdateTimeout` | The length of update lock expiry time for router to get a service URL returns from executor | `30`
|
||||||
`router.svcAnnotations` | Annotations for router service | None
|
`router.svcAnnotations` | Annotations for router service | None
|
||||||
`router.useEncodedPath` | For router to match encoded path. If true, "/foo%2Fbar" will match the path "/{var}"; Otherwise, it will match the path "/foo/bar". | `false`
|
`router.useEncodedPath` | For router to match encoded path. If true, "/foo%2Fbar" will match the path "/{var}"; Otherwise, it will match the path "/foo/bar". | `false`
|
||||||
|
`router.traceSamplingRate` | Uniformly sample traces with the given probabilistic sampling rate | `0.5`
|
||||||
`router.roundTrip.disableKeepAlive` | Disable transport keep-alive for fast switching function version | `true`
|
`router.roundTrip.disableKeepAlive` | Disable transport keep-alive for fast switching function version | `true`
|
||||||
`router.roundTrip.keepAliveTime` | The keep-alive period for an active network connection to function pod | `30s`
|
`router.roundTrip.keepAliveTime` | The keep-alive period for an active network connection to function pod | `30s`
|
||||||
`router.roundTrip.timeout` | HTTP transport request timeout | `50ms`
|
`router.roundTrip.timeout` | HTTP transport request timeout | `50ms`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: fission-all
|
name: fission-all
|
||||||
version: 1.6.0
|
version: 1.7.0
|
||||||
description: Fission is a fast serverless framework for Kubernetes.
|
description: Fission is a fast serverless framework for Kubernetes.
|
||||||
keywords:
|
keywords:
|
||||||
- fission
|
- fission
|
||||||
@@ -8,8 +8,8 @@ keywords:
|
|||||||
home: http://fission.io/
|
home: http://fission.io/
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Soam Vasani
|
- name: Soam Vasani
|
||||||
email: soamvasani@platform9.com
|
email: soamvasani+1@gmail.com
|
||||||
- name: Ta Ching Chen
|
- name: Ta Ching Chen
|
||||||
email: contact@tachingchen.com
|
email: hello@tachingchen.com
|
||||||
engine: gotpl
|
engine: gotpl
|
||||||
appVersion: 1.6.0
|
appVersion: 1.7.0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
repository: https://kubernetes-charts.storage.googleapis.com
|
repository: https://kubernetes-charts.storage.googleapis.com
|
||||||
version: 7.1.0
|
version: 9.3.1
|
||||||
digest: sha256:867c8666d4dee6ae36b0e418f132f3187fd189bcbb36875f2c06e3fbe2402cfe
|
digest: sha256:89a63a5f01c08032106a94c59fc7a5929e449458bf5fd06d86c8b048ac628bf4
|
||||||
generated: 2019-01-03T16:29:53.158684+01:00
|
generated: "2019-11-18T10:16:20.334338911Z"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
version: 7.1.0
|
version: 9.3.1
|
||||||
repository: https://kubernetes-charts.storage.googleapis.com
|
repository: https://kubernetes-charts.storage.googleapis.com
|
||||||
condition: prometheusDeploy
|
condition: prometheus.enabled
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
1. Install the client CLI.
|
1. Install the client CLI.
|
||||||
|
|
||||||
Mac:
|
Mac:
|
||||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/1.6.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||||
|
|
||||||
Linux:
|
Linux:
|
||||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/1.6.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/1.6.0/fission-cli-windows.exe
|
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-windows.exe
|
||||||
|
|
||||||
2. You're ready to use Fission!
|
2. You're ready to use Fission!
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,10 @@ controller/config.go
|
|||||||
{{- define "config" -}}
|
{{- define "config" -}}
|
||||||
canary:
|
canary:
|
||||||
enabled: {{ .Values.canaryDeployment.enabled }}
|
enabled: {{ .Values.canaryDeployment.enabled }}
|
||||||
{{- if .Values.prometheusDeploy }}
|
{{- if .Values.prometheus.enabled }}
|
||||||
prometheusSvc: "http://{{ .Release.Name }}-prometheus-server.{{ .Release.Namespace }}"
|
prometheusSvc: "http://{{ .Release.Name }}-prometheus-server.{{ .Release.Namespace }}"
|
||||||
|
{{- else }}
|
||||||
|
prometheusSvc: {{ .Values.prometheus.serviceEndpoint | default "" | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- printf "\n" -}}
|
{{- printf "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -137,10 +137,12 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--controllerPort", "8888", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--controllerPort", "8888"]
|
||||||
env:
|
env:
|
||||||
- name: FISSION_FUNCTION_NAMESPACE
|
- name: FISSION_FUNCTION_NAMESPACE
|
||||||
value: "{{ .Values.functionNamespace }}"
|
value: "{{ .Values.functionNamespace }}"
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
@@ -169,7 +171,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
volumes:
|
volumes:
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
configMap:
|
configMap:
|
||||||
@@ -205,7 +207,7 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
||||||
@@ -213,10 +215,14 @@ spec:
|
|||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: RUNTIME_IMAGE_PULL_POLICY
|
- name: RUNTIME_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
- name: ADOPT_EXISTING_RESOURCES
|
||||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
value: {{ .Values.executor.adoptExistingResources | default false | quote }}
|
||||||
- name: ENABLE_ISTIO
|
- name: ENABLE_ISTIO
|
||||||
value: "{{ .Values.enableIstio }}"
|
value: "{{ .Values.enableIstio }}"
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
|
- name: TRACING_SAMPLING_RATE
|
||||||
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: FETCHER_MINCPU
|
- name: FETCHER_MINCPU
|
||||||
value: {{ .Values.fetcherMinCpu | default "10m" | quote }}
|
value: {{ .Values.fetcherMinCpu | default "10m" | quote }}
|
||||||
- name: FETCHER_MINMEM
|
- name: FETCHER_MINMEM
|
||||||
@@ -225,8 +231,6 @@ spec:
|
|||||||
value: {{ .Values.fetcherMaxCpu | default "1000m" | quote }}
|
value: {{ .Values.fetcherMaxCpu | default "1000m" | quote }}
|
||||||
- name: FETCHER_MAXMEM
|
- name: FETCHER_MAXMEM
|
||||||
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
||||||
- name: TRACING_SAMPLING_RATE
|
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
@@ -247,7 +251,7 @@ spec:
|
|||||||
name: metrics
|
name: metrics
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -275,7 +279,7 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
||||||
@@ -283,10 +287,10 @@ spec:
|
|||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: BUILDER_IMAGE_PULL_POLICY
|
- name: BUILDER_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
|
||||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
|
||||||
- name: ENABLE_ISTIO
|
- name: ENABLE_ISTIO
|
||||||
value: "{{ .Values.enableIstio }}"
|
value: "{{ .Values.enableIstio }}"
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: FETCHER_MINCPU
|
- name: FETCHER_MINCPU
|
||||||
@@ -299,7 +303,7 @@ spec:
|
|||||||
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -327,13 +331,15 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -438,7 +444,7 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- /heapster
|
- /heapster
|
||||||
- --source=kubernetes:https://kubernetes.default
|
- --source=kubernetes:https://kubernetes.default
|
||||||
serviceAccount: {{ .Release.Namespace }}/fission-svc
|
serviceAccountName: {{ .Release.Namespace }}/fission-svc
|
||||||
{{- end }}
|
{{- end }}
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
@@ -467,7 +473,7 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -498,7 +504,7 @@ spec:
|
|||||||
# - name: kubectl-proxy
|
# - name: kubectl-proxy
|
||||||
# image: {{ .Values.repository }}/lachlanevenson/k8s-kubectl
|
# image: {{ .Values.repository }}/lachlanevenson/k8s-kubectl
|
||||||
# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"]
|
# args: ["proxy", "--port", "8001", "--address", "127.0.0.1"]
|
||||||
# serviceAccount: fission-svc
|
# serviceAccountName: fission-svc
|
||||||
|
|
||||||
{{- if .Values.nats.enabled }}
|
{{- if .Values.nats.enabled }}
|
||||||
---
|
---
|
||||||
@@ -530,10 +536,8 @@ spec:
|
|||||||
]
|
]
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 4222
|
- containerPort: 4222
|
||||||
hostPort: 4222
|
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- containerPort: 4223
|
- containerPort: 4223
|
||||||
hostPort: 4223
|
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
@@ -577,17 +581,19 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: MESSAGE_QUEUE_TYPE
|
- name: MESSAGE_QUEUE_TYPE
|
||||||
value: nats-streaming
|
value: nats-streaming
|
||||||
- name: MESSAGE_QUEUE_URL
|
- name: MESSAGE_QUEUE_URL
|
||||||
value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222
|
value: nats://{{ .Values.nats.authToken }}@nats-streaming:4222
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -620,7 +626,7 @@ spec:
|
|||||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: MESSAGE_QUEUE_TYPE
|
- name: MESSAGE_QUEUE_TYPE
|
||||||
value: kafka
|
value: kafka
|
||||||
@@ -628,6 +634,8 @@ spec:
|
|||||||
value: "{{.Values.kafka.brokers}}"
|
value: "{{.Values.kafka.brokers}}"
|
||||||
- name: MESSAGE_QUEUE_KAFKA_VERSION
|
- name: MESSAGE_QUEUE_KAFKA_VERSION
|
||||||
value: "{{.Values.kafka.version}}"
|
value: "{{.Values.kafka.version}}"
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
@@ -643,7 +651,7 @@ spec:
|
|||||||
- name: kafka-secrets
|
- name: kafka-secrets
|
||||||
mountPath: /etc/fission/secrets
|
mountPath: /etc/fission/secrets
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.kafka.authentication.tls.enabled }}
|
{{- if .Values.kafka.authentication.tls.enabled }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: kafka-secrets
|
- name: kafka-secrets
|
||||||
@@ -708,8 +716,10 @@ spec:
|
|||||||
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--mqt", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: MESSAGE_QUEUE_TYPE
|
- name: MESSAGE_QUEUE_TYPE
|
||||||
@@ -723,7 +733,7 @@ spec:
|
|||||||
key: key
|
key: key
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -754,8 +764,10 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--storageServicePort", "8000", "--filePath", "/fission", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--storageServicePort", "8000", "--filePath", "/fission"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: PRUNE_INTERVAL
|
- name: PRUNE_INTERVAL
|
||||||
@@ -781,7 +793,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
volumes:
|
volumes:
|
||||||
- name: fission-storage
|
- name: fission-storage
|
||||||
{{- if .Values.persistence.enabled }}
|
{{- if .Values.persistence.enabled }}
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ spec:
|
|||||||
- name: container-log
|
- name: container-log
|
||||||
mountPath: /var/log/
|
mountPath: /var/log/
|
||||||
readOnly: false
|
readOnly: false
|
||||||
|
{{- if .Values.logger.enableSecurityContext }}
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: logger
|
- name: logger
|
||||||
{{ if .Values.repository }}
|
{{ if .Values.repository }}
|
||||||
@@ -68,6 +72,10 @@ spec:
|
|||||||
- name: docker-log
|
- name: docker-log
|
||||||
mountPath: /var/lib/docker/containers
|
mountPath: /var/lib/docker/containers
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{{- if .Values.logger.enableSecurityContext }}
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
{{- end }}
|
||||||
- name: fluentbit
|
- name: fluentbit
|
||||||
{{- if .Values.repository }}
|
{{- if .Values.repository }}
|
||||||
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
image: "{{ .Values.logger.fluentdImageRepository }}/{{ .Values.logger.fluentdImage }}:{{ .Values.logger.fluentdImageTag }}"
|
||||||
@@ -96,6 +104,10 @@ spec:
|
|||||||
key: password
|
key: password
|
||||||
- name: LOG_PATH
|
- name: LOG_PATH
|
||||||
value: /var/log/fission/*.log
|
value: /var/log/fission/*.log
|
||||||
|
{{- if .Values.logger.enableSecurityContext }}
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: container-log
|
- name: container-log
|
||||||
mountPath: /var/log/
|
mountPath: /var/log/
|
||||||
@@ -106,7 +118,7 @@ spec:
|
|||||||
- name: fluentbit-config
|
- name: fluentbit-config
|
||||||
mountPath: /fluent-bit/etc/
|
mountPath: /fluent-bit/etc/
|
||||||
readOnly: true
|
readOnly: true
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
volumes:
|
volumes:
|
||||||
- name: container-log
|
- name: container-log
|
||||||
hostPath:
|
hostPath:
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ spec:
|
|||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: [ "/pre-upgrade-checks" ]
|
command: [ "/pre-upgrade-checks" ]
|
||||||
args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: redis
|
|
||||||
labels:
|
|
||||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 6379
|
|
||||||
targetPort: 6379
|
|
||||||
protocol: TCP
|
|
||||||
name: redis
|
|
||||||
selector:
|
|
||||||
app: redis
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: redis
|
|
||||||
labels:
|
|
||||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: redis
|
|
||||||
serviceName: redis
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: redis
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: redis
|
|
||||||
image: redis:3.2-alpine
|
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
|
||||||
ports:
|
|
||||||
- containerPort: 6379
|
|
||||||
name: redis
|
|
||||||
@@ -33,7 +33,7 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: POD_NAMESPACE
|
- name: POD_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@@ -53,12 +53,16 @@ spec:
|
|||||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.router.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: USE_ENCODED_PATH
|
- name: USE_ENCODED_PATH
|
||||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
|
- name: DISPLAY_ACCESS_LOG
|
||||||
|
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||||
{{- if .Values.analytics }}
|
{{- if .Values.analytics }}
|
||||||
- name: ANALYTICS_URL
|
- name: ANALYTICS_URL
|
||||||
value: "https://g.fission.sh/metrics"
|
value: "https://g.fission.sh/metrics"
|
||||||
@@ -84,7 +88,7 @@ spec:
|
|||||||
name: metrics
|
name: metrics
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ image: fission/fission-bundle
|
|||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
## Fission image version
|
## Fission image version
|
||||||
imageTag: 1.6.0
|
imageTag: 1.7.0
|
||||||
|
|
||||||
## Fission fetcher repository
|
## Fission fetcher repository
|
||||||
fetcherImage: fission/fetcher
|
fetcherImage: fission/fetcher
|
||||||
|
|
||||||
## Fission fetcher image version
|
## Fission fetcher image version
|
||||||
fetcherImageTag: 1.6.0
|
fetcherImageTag: 1.7.0
|
||||||
|
|
||||||
## Port at which Fission controller service should be exposed
|
## Port at which Fission controller service should be exposed
|
||||||
controllerPort: 31313
|
controllerPort: 31313
|
||||||
@@ -58,11 +58,27 @@ logger:
|
|||||||
fluentdImage: fluent/fluent-bit
|
fluentdImage: fluent/fluent-bit
|
||||||
fluentdImageTag: 1.0.4
|
fluentdImageTag: 1.0.4
|
||||||
|
|
||||||
|
## Fluent-bit writes/reads it’s own sqlite database to record a history of tracked
|
||||||
|
## files and a state of offsets, this is very useful to resume a state if the ser-
|
||||||
|
## vice is restarted. For Kubernetes environment with constraints like OpenShift,
|
||||||
|
## the containers are limited to write hostPath volume. Hence, we have to enable
|
||||||
|
## security context and set privileged to true.
|
||||||
|
enableSecurityContext: false
|
||||||
|
|
||||||
|
executor:
|
||||||
|
adoptExistingResources: false
|
||||||
|
|
||||||
## Router config
|
## Router config
|
||||||
router:
|
router:
|
||||||
deployAsDaemonSet: false
|
deployAsDaemonSet: false
|
||||||
svcAddressMaxRetries: 5
|
svcAddressMaxRetries: 5
|
||||||
svcAddressUpdateTimeout: 30s
|
svcAddressUpdateTimeout: 30s
|
||||||
|
|
||||||
|
## Display endpoint access logs
|
||||||
|
## To be aware of enabling logging endpoint access log, it increases
|
||||||
|
## router resource utilization when under heavy workloads.
|
||||||
|
displayAccessLog: false
|
||||||
|
|
||||||
## Add annotations for router
|
## Add annotations for router
|
||||||
# svcAnnotations:
|
# svcAnnotations:
|
||||||
# cloud.google.com/load-balancer-type: Internal
|
# cloud.google.com/load-balancer-type: Internal
|
||||||
@@ -98,6 +114,9 @@ router:
|
|||||||
## Max retries times of a failed request
|
## Max retries times of a failed request
|
||||||
maxRetries: 10
|
maxRetries: 10
|
||||||
|
|
||||||
|
## Sample with a rate per time window (traces/second)
|
||||||
|
traceSamplingRate: 0.5
|
||||||
|
|
||||||
## Message queue trigger config
|
## Message queue trigger config
|
||||||
### NATS Streaming, enabled by default
|
### NATS Streaming, enabled by default
|
||||||
nats:
|
nats:
|
||||||
@@ -178,7 +197,7 @@ persistence:
|
|||||||
## operator: In
|
## operator: In
|
||||||
## values:
|
## values:
|
||||||
## - app
|
## - app
|
||||||
extraCoreComponentPodConfig:
|
#extraCoreComponentPodConfig:
|
||||||
# affinity:
|
# affinity:
|
||||||
# tolerations:
|
# tolerations:
|
||||||
# nodeSelector:
|
# nodeSelector:
|
||||||
@@ -205,8 +224,14 @@ preUpgradeChecksImage: fission/pre-upgrade-checks
|
|||||||
## summary is returned as part of http response
|
## summary is returned as part of http response
|
||||||
debugEnv: false
|
debugEnv: false
|
||||||
|
|
||||||
## set this flag to true if prometheus needs to be deployed along with fission
|
## Prometheus for scrapping service metrics
|
||||||
prometheusDeploy: true
|
prometheus:
|
||||||
|
## set this flag to true if prometheus needs to be deployed along with fission
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
## If enabled is false, please assign the prometheus service URL
|
||||||
|
## that is accessible by components.
|
||||||
|
serviceEndpoint: ""
|
||||||
|
|
||||||
## set this flag to false if you dont need canary deployment feature
|
## set this flag to false if you dont need canary deployment feature
|
||||||
canaryDeployment:
|
canaryDeployment:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
name: fission-core
|
name: fission-core
|
||||||
version: 1.6.0
|
version: 1.7.0
|
||||||
description: Fission is a fast serverless framework for Kubernetes.
|
description: Fission is a fast serverless framework for Kubernetes.
|
||||||
keywords:
|
keywords:
|
||||||
- fission
|
- fission
|
||||||
@@ -8,8 +8,8 @@ keywords:
|
|||||||
home: http://fission.io/
|
home: http://fission.io/
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Soam Vasani
|
- name: Soam Vasani
|
||||||
email: soamvasani@platform9.com
|
email: soamvasani+1@gmail.com
|
||||||
- name: Ta Ching Chen
|
- name: Ta Ching Chen
|
||||||
email: contact@tachingchen.com
|
email: hello@tachingchen.com
|
||||||
engine: gotpl
|
engine: gotpl
|
||||||
appVersion: 1.6.0
|
appVersion: 1.7.0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
repository: https://kubernetes-charts.storage.googleapis.com
|
repository: https://kubernetes-charts.storage.googleapis.com
|
||||||
version: 7.1.0
|
version: 9.3.1
|
||||||
digest: sha256:867c8666d4dee6ae36b0e418f132f3187fd189bcbb36875f2c06e3fbe2402cfe
|
digest: sha256:89a63a5f01c08032106a94c59fc7a5929e449458bf5fd06d86c8b048ac628bf4
|
||||||
generated: 2019-06-03T10:47:50.335101619Z
|
generated: "2019-11-18T10:16:25.945208326Z"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
version: 7.1.0
|
version: 9.3.1
|
||||||
repository: https://kubernetes-charts.storage.googleapis.com
|
repository: https://kubernetes-charts.storage.googleapis.com
|
||||||
condition: prometheusDeploy
|
condition: prometheus.enabled
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
1. Install the client CLI.
|
1. Install the client CLI.
|
||||||
|
|
||||||
Mac:
|
Mac:
|
||||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/1.6.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||||
|
|
||||||
Linux:
|
Linux:
|
||||||
$ curl -Lo fission https://github.com/fission/fission/releases/download/1.6.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
$ curl -Lo fission https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/1.6.0/fission-cli-windows.exe
|
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/{{ .Chart.Version }}/fission-cli-windows.exe
|
||||||
|
|
||||||
2. You're ready to use Fission!
|
2. You're ready to use Fission!
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ controller/config.go
|
|||||||
{{- define "config" -}}
|
{{- define "config" -}}
|
||||||
canary:
|
canary:
|
||||||
enabled: {{ .Values.canaryDeployment.enabled }}
|
enabled: {{ .Values.canaryDeployment.enabled }}
|
||||||
{{- if .Values.prometheusDeploy }}
|
{{- if .Values.prometheus.enabled }}
|
||||||
prometheusSvc: "http://{{ .Release.Name }}-prometheus-server.{{ .Release.Namespace }}"
|
prometheusSvc: "http://{{ .Release.Name }}-prometheus-server.{{ .Release.Namespace }}"
|
||||||
|
{{- else }}
|
||||||
|
prometheusSvc: {{ .Values.prometheus.serviceEndpoint | default "" | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- printf "\n" -}}
|
{{- printf "\n" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -138,8 +138,10 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--controllerPort", "8888", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--controllerPort", "8888"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: FISSION_FUNCTION_NAMESPACE
|
- name: FISSION_FUNCTION_NAMESPACE
|
||||||
@@ -168,7 +170,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
volumes:
|
volumes:
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
configMap:
|
configMap:
|
||||||
@@ -205,18 +207,20 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--executorPort", "8888", "--namespace", "{{ .Values.functionNamespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
||||||
- name: FETCHER_IMAGE_PULL_POLICY
|
- name: FETCHER_IMAGE_PULL_POLICY
|
||||||
value: "{{ .Values.pullPolicy }}"
|
value: "{{ .Values.pullPolicy }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
|
||||||
- name: ENABLE_ISTIO
|
|
||||||
value: "{{ .Values.enableIstio }}"
|
|
||||||
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
value: "{{ .Values.traceCollectorEndpoint }}"
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
|
- name: TRACING_SAMPLING_RATE
|
||||||
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
|
- name: ADOPT_EXISTING_RESOURCES
|
||||||
|
value: {{ .Values.executor.adoptExistingResources | default false | quote }}
|
||||||
|
- name: ENABLE_ISTIO
|
||||||
|
value: "{{ .Values.enableIstio }}"
|
||||||
- name: FETCHER_MINCPU
|
- name: FETCHER_MINCPU
|
||||||
value: {{ .Values.fetcherMinCpu | default "10m" | quote }}
|
value: {{ .Values.fetcherMinCpu | default "10m" | quote }}
|
||||||
- name: FETCHER_MINMEM
|
- name: FETCHER_MINMEM
|
||||||
@@ -243,7 +247,7 @@ spec:
|
|||||||
name: metrics
|
name: metrics
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -271,7 +275,7 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--builderMgr", "--storageSvcUrl", "http://storagesvc.{{ .Release.Namespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: FETCHER_IMAGE
|
- name: FETCHER_IMAGE
|
||||||
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
value: "{{ .Values.fetcherImage }}:{{ .Values.fetcherImageTag }}"
|
||||||
@@ -293,7 +297,7 @@ spec:
|
|||||||
value: {{ .Values.fetcherMaxCpu | default "1000m" | quote }}
|
value: {{ .Values.fetcherMaxCpu | default "1000m" | quote }}
|
||||||
- name: FETCHER_MAXMEM
|
- name: FETCHER_MAXMEM
|
||||||
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
value: {{ .Values.fetcherMaxMem | default "128Mi" | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -321,11 +325,13 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--kubewatcher", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -353,11 +359,13 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--timer", "--routerUrl", "http://router.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -388,10 +396,12 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--storageServicePort", "8000", "--filePath", "/fission", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--storageServicePort", "8000", "--filePath", "/fission"]
|
||||||
env:
|
env:
|
||||||
- name: PRUNE_INTERVAL
|
- name: PRUNE_INTERVAL
|
||||||
value: "{{.Values.pruneInterval}}"
|
value: "{{.Values.pruneInterval}}"
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
@@ -400,7 +410,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
volumes:
|
volumes:
|
||||||
- name: fission-storage
|
- name: fission-storage
|
||||||
{{- if .Values.persistence.enabled }}
|
{{- if .Values.persistence.enabled }}
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ spec:
|
|||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: [ "/pre-upgrade-checks" ]
|
command: [ "/pre-upgrade-checks" ]
|
||||||
args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
args: ["--fn-pod-namespace", "{{ .Values.functionNamespace }}", "--envbuilder-namespace", "{{ .Values.builderNamespace }}"]
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ spec:
|
|||||||
image: {{ include "fission-bundleImage" . | quote }}
|
image: {{ include "fission-bundleImage" . | quote }}
|
||||||
imagePullPolicy: {{ .Values.pullPolicy }}
|
imagePullPolicy: {{ .Values.pullPolicy }}
|
||||||
command: ["/fission-bundle"]
|
command: ["/fission-bundle"]
|
||||||
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}", "--collectorEndpoint", "{{ .Values.traceCollectorEndpoint }}"]
|
args: ["--routerPort", "8888", "--executorUrl", "http://executor.{{ .Release.Namespace }}"]
|
||||||
env:
|
env:
|
||||||
- name: POD_NAMESPACE
|
- name: POD_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@@ -53,12 +53,16 @@ spec:
|
|||||||
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
value: {{ .Values.router.svcAddressMaxRetries | default 5 | quote }}
|
||||||
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
- name: ROUTER_SVC_ADDRESS_UPDATE_TIMEOUT
|
||||||
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
value: {{ .Values.router.svcAddressUpdateTimeout | default "30s" | quote }}
|
||||||
|
- name: TRACE_JAEGER_COLLECTOR_ENDPOINT
|
||||||
|
value: "{{ .Values.traceCollectorEndpoint }}"
|
||||||
- name: TRACING_SAMPLING_RATE
|
- name: TRACING_SAMPLING_RATE
|
||||||
value: {{ .Values.traceSamplingRate | default "0.5" | quote }}
|
value: {{ .Values.router.traceSamplingRate | default "0.5" | quote }}
|
||||||
- name: USE_ENCODED_PATH
|
- name: USE_ENCODED_PATH
|
||||||
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
value: {{ .Values.router.useEncodedPath | default false | quote }}
|
||||||
- name: DEBUG_ENV
|
- name: DEBUG_ENV
|
||||||
value: {{ .Values.debugEnv | quote }}
|
value: {{ .Values.debugEnv | quote }}
|
||||||
|
- name: DISPLAY_ACCESS_LOG
|
||||||
|
value: {{ .Values.router.displayAccessLog | default false | quote }}
|
||||||
{{- if .Values.analytics }}
|
{{- if .Values.analytics }}
|
||||||
- name: ANALYTICS_URL
|
- name: ANALYTICS_URL
|
||||||
value: "https://g.fission.sh/metrics"
|
value: "https://g.fission.sh/metrics"
|
||||||
@@ -84,7 +88,7 @@ spec:
|
|||||||
name: metrics
|
name: metrics
|
||||||
- containerPort: 8888
|
- containerPort: 8888
|
||||||
name: http
|
name: http
|
||||||
serviceAccount: fission-svc
|
serviceAccountName: fission-svc
|
||||||
{{- if .Values.extraCoreComponentPodConfig }}
|
{{- if .Values.extraCoreComponentPodConfig }}
|
||||||
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
{{ toYaml .Values.extraCoreComponentPodConfig | indent 6 -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ repository: index.docker.io
|
|||||||
image: fission/fission-bundle
|
image: fission/fission-bundle
|
||||||
|
|
||||||
## Fission image version
|
## Fission image version
|
||||||
imageTag: 1.6.0
|
imageTag: 1.7.0
|
||||||
|
|
||||||
## Image pull policy
|
## Image pull policy
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: IfNotPresent
|
||||||
@@ -26,7 +26,7 @@ pullPolicy: IfNotPresent
|
|||||||
fetcherImage: fission/fetcher
|
fetcherImage: fission/fetcher
|
||||||
|
|
||||||
## Fission fetcher image version
|
## Fission fetcher image version
|
||||||
fetcherImageTag: 1.6.0
|
fetcherImageTag: 1.7.0
|
||||||
|
|
||||||
## Port at which Fission controller service should be exposed
|
## Port at which Fission controller service should be exposed
|
||||||
controllerPort: 31313
|
controllerPort: 31313
|
||||||
@@ -45,11 +45,20 @@ builderNamespace: fission-builder
|
|||||||
## Enable istio integration
|
## Enable istio integration
|
||||||
enableIstio: false
|
enableIstio: false
|
||||||
|
|
||||||
|
executor:
|
||||||
|
adoptExistingResources: false
|
||||||
|
|
||||||
## Router config
|
## Router config
|
||||||
router:
|
router:
|
||||||
deployAsDaemonSet: false
|
deployAsDaemonSet: false
|
||||||
svcAddressMaxRetries: 5
|
svcAddressMaxRetries: 5
|
||||||
svcAddressUpdateTimeout: 30s
|
svcAddressUpdateTimeout: 30s
|
||||||
|
|
||||||
|
## Display endpoint access logs
|
||||||
|
## To be aware of enabling logging endpoint access log, it increases
|
||||||
|
## router resource utilization when under heavy workloads.
|
||||||
|
displayAccessLog: false
|
||||||
|
|
||||||
## Add annotations for router
|
## Add annotations for router
|
||||||
# svcAnnotations:
|
# svcAnnotations:
|
||||||
# cloud.google.com/load-balancer-type: Internal
|
# cloud.google.com/load-balancer-type: Internal
|
||||||
@@ -85,6 +94,9 @@ router:
|
|||||||
## Max retries times of a failed request
|
## Max retries times of a failed request
|
||||||
maxRetries: 10
|
maxRetries: 10
|
||||||
|
|
||||||
|
## Sample with a rate per time window (traces/second)
|
||||||
|
traceSamplingRate: 0.5
|
||||||
|
|
||||||
## Persist data to a persistent volume.
|
## Persist data to a persistent volume.
|
||||||
persistence:
|
persistence:
|
||||||
## If true, fission will create/use a Persistent Volume Claim
|
## If true, fission will create/use a Persistent Volume Claim
|
||||||
@@ -122,7 +134,7 @@ persistence:
|
|||||||
## operator: In
|
## operator: In
|
||||||
## values:
|
## values:
|
||||||
## - app
|
## - app
|
||||||
extraCoreComponentPodConfig:
|
#extraCoreComponentPodConfig:
|
||||||
# affinity:
|
# affinity:
|
||||||
# tolerations:
|
# tolerations:
|
||||||
# nodeSelector:
|
# nodeSelector:
|
||||||
@@ -146,8 +158,14 @@ preUpgradeChecksImage: fission/pre-upgrade-checks
|
|||||||
## summary is returned as part of http response
|
## summary is returned as part of http response
|
||||||
debugEnv: false
|
debugEnv: false
|
||||||
|
|
||||||
## set this flag to true if prometheus needs to be deployed along with fission
|
## Prometheus for scrapping service metrics
|
||||||
prometheusDeploy: false
|
prometheus:
|
||||||
|
## set this flag to true if prometheus needs to be deployed along with fission
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
## If enabled is false, please assign the prometheus service URL
|
||||||
|
## that is accessible by components.
|
||||||
|
serviceEndpoint: ""
|
||||||
|
|
||||||
## set this flag to false if you dont need canary deployment feature
|
## set this flag to false if you dont need canary deployment feature
|
||||||
canaryDeployment:
|
canaryDeployment:
|
||||||
|
|||||||
+10
-11
@@ -118,8 +118,8 @@ func getStringArgWithDefault(arg interface{}, defaultValue string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func registerTraceExporter(logger *zap.Logger, arguments map[string]interface{}) error {
|
func registerTraceExporter(logger *zap.Logger, arguments map[string]interface{}) error {
|
||||||
collectorEndpoint := getStringArgWithDefault(arguments["--collectorEndpoint"], "")
|
collectorEndpoint := os.Getenv("TRACE_JAEGER_COLLECTOR_ENDPOINT")
|
||||||
if collectorEndpoint == "" {
|
if len(collectorEndpoint) == 0 {
|
||||||
logger.Info("skipping trace exporter registration")
|
logger.Info("skipping trace exporter registration")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -196,18 +196,17 @@ Use it to start one or more of the fission servers:
|
|||||||
backends.
|
backends.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
fission-bundle --controllerPort=<port> [--collectorEndpoint=<url>]
|
fission-bundle --controllerPort=<port>
|
||||||
fission-bundle --routerPort=<port> [--executorUrl=<url>] [--collectorEndpoint=<url>]
|
fission-bundle --routerPort=<port> [--executorUrl=<url>]
|
||||||
fission-bundle --executorPort=<port> [--namespace=<namespace>] [--fission-namespace=<namespace>] [--collectorEndpoint=<url>]
|
fission-bundle --executorPort=<port> [--namespace=<namespace>] [--fission-namespace=<namespace>]
|
||||||
fission-bundle --kubewatcher [--routerUrl=<url>] [--collectorEndpoint=<url>]
|
fission-bundle --kubewatcher [--routerUrl=<url>]
|
||||||
fission-bundle --storageServicePort=<port> --filePath=<filePath> [--collectorEndpoint=<url>]
|
fission-bundle --storageServicePort=<port> --filePath=<filePath>
|
||||||
fission-bundle --builderMgr [--storageSvcUrl=<url>] [--envbuilder-namespace=<namespace>] [--collectorEndpoint=<url>]
|
fission-bundle --builderMgr [--storageSvcUrl=<url>] [--envbuilder-namespace=<namespace>]
|
||||||
fission-bundle --timer [--routerUrl=<url>] [--collectorEndpoint=<url>]
|
fission-bundle --timer [--routerUrl=<url>]
|
||||||
fission-bundle --mqt [--routerUrl=<url>] [--collectorEndpoint=<url>]
|
fission-bundle --mqt [--routerUrl=<url>]
|
||||||
fission-bundle --logger
|
fission-bundle --logger
|
||||||
fission-bundle --version
|
fission-bundle --version
|
||||||
Options:
|
Options:
|
||||||
--collectorEndpoint=<url> Jaeger HTTP Thrift collector URL.
|
|
||||||
--controllerPort=<port> Port that the controller should listen on.
|
--controllerPort=<port> Port that the controller should listen on.
|
||||||
--routerPort=<port> Port that the router should listen on.
|
--routerPort=<port> Port that the router should listen on.
|
||||||
--executorPort=<port> Port that the executor should listen on.
|
--executorPort=<port> Port that the executor should listen on.
|
||||||
|
|||||||
@@ -0,0 +1,72 @@
|
|||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
|
||||||
|
wrapper "github.com/fission/fission/pkg/fission-cli/cliwrapper/driver/cobra"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cliwrapper/driver/cobra/helptemplate"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/canaryconfig"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/environment"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/function"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/httptrigger"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/kubewatch"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/mqtrigger"
|
||||||
|
_package "github.com/fission/fission/pkg/fission-cli/cmd/package"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/spec"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/support"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/timetrigger"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/cmd/version"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/console"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/flag"
|
||||||
|
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
usage = `Fission: Fast and Simple Serverless Functions for Kubernetes
|
||||||
|
|
||||||
|
* Github: https://github.com/fission/fission
|
||||||
|
* Documentation: https://docs.fission.io/docs
|
||||||
|
`
|
||||||
|
)
|
||||||
|
|
||||||
|
func App() *cobra.Command {
|
||||||
|
cobra.EnableCommandSorting = false
|
||||||
|
|
||||||
|
rootCmd := &cobra.Command{
|
||||||
|
Use: "fission",
|
||||||
|
Long: usage,
|
||||||
|
//SilenceUsage: true,
|
||||||
|
PersistentPreRunE: wrapper.Wrapper(
|
||||||
|
func(input cli.Input) error {
|
||||||
|
console.Verbosity = input.Int(flagkey.Verbosity)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
|
||||||
|
// Workaround fix for not to show help command
|
||||||
|
// https://github.com/spf13/cobra/issues/587
|
||||||
|
rootCmd.SetHelpCommand(&cobra.Command{
|
||||||
|
Use: "no-help",
|
||||||
|
Hidden: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
wrapper.SetFlags(rootCmd, flag.FlagSet{
|
||||||
|
Global: []flag.Flag{flag.GlobalServer, flag.GlobalVerbosity},
|
||||||
|
})
|
||||||
|
|
||||||
|
groups := helptemplate.CommandGroups{}
|
||||||
|
groups = append(groups, helptemplate.CreateCmdGroup("Basic Commands", environment.Commands(), _package.Commands(), function.Commands()))
|
||||||
|
groups = append(groups, helptemplate.CreateCmdGroup("Trigger Commands", httptrigger.Commands(), mqtrigger.Commands(), timetrigger.Commands(), kubewatch.Commands()))
|
||||||
|
groups = append(groups, helptemplate.CreateCmdGroup("Deploy Strategies Commands", canaryconfig.Commands()))
|
||||||
|
groups = append(groups, helptemplate.CreateCmdGroup("Declarative Application Commands", spec.Commands()))
|
||||||
|
groups = append(groups, helptemplate.CreateCmdGroup("Other Commands", support.Commands(), version.Commands()))
|
||||||
|
groups.Add(rootCmd)
|
||||||
|
|
||||||
|
flagExposer := helptemplate.ActsAsRootCommand(rootCmd, nil, groups...)
|
||||||
|
// show global options in usage
|
||||||
|
flagExposer.ExposeFlags(rootCmd, flagkey.Server, flagkey.Verbosity)
|
||||||
|
|
||||||
|
return rootCmd
|
||||||
|
}
|
||||||
+11
-2
@@ -19,9 +19,18 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
fcli "github.com/fission/fission/pkg/fission-cli"
|
"github.com/fission/fission/cmd/fission-cli/app"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/console"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fcli.NewCliApp().Run(os.Args)
|
cmd := app.App()
|
||||||
|
cmd.SilenceErrors = true // use our own error message printer
|
||||||
|
|
||||||
|
err := cmd.Execute()
|
||||||
|
if err != nil {
|
||||||
|
// let program exit with non-zero code when error occurs
|
||||||
|
console.Error(err.Error())
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ func (client *PreUpgradeTaskClient) IsFissionReInstall() bool {
|
|||||||
func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences() {
|
func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences() {
|
||||||
client.logger.Info("verifying function spec references for all functions in the cluster")
|
client.logger.Info("verifying function spec references for all functions in the cluster")
|
||||||
|
|
||||||
result := &multierror.Error{}
|
|
||||||
var err error
|
var err error
|
||||||
var fList *fv1.FunctionList
|
var fList *fv1.FunctionList
|
||||||
|
|
||||||
@@ -103,28 +102,30 @@ func (client *PreUpgradeTaskClient) VerifyFunctionSpecReferences() {
|
|||||||
zap.Int("max_retries", maxRetries))
|
zap.Int("max_retries", maxRetries))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errs := &multierror.Error{}
|
||||||
|
|
||||||
// check that all secrets, configmaps, packages are in the same namespace
|
// check that all secrets, configmaps, packages are in the same namespace
|
||||||
for _, fn := range fList.Items {
|
for _, fn := range fList.Items {
|
||||||
secrets := fn.Spec.Secrets
|
secrets := fn.Spec.Secrets
|
||||||
for _, secret := range secrets {
|
for _, secret := range secrets {
|
||||||
if secret.Namespace != fn.Metadata.Namespace {
|
if secret.Namespace != fn.Metadata.Namespace {
|
||||||
result = multierror.Append(result, fmt.Errorf("function : %s.%s cannot reference a secret : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, secret.Name, secret.Namespace))
|
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a secret : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, secret.Name, secret.Namespace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configmaps := fn.Spec.ConfigMaps
|
configmaps := fn.Spec.ConfigMaps
|
||||||
for _, configmap := range configmaps {
|
for _, configmap := range configmaps {
|
||||||
if configmap.Namespace != fn.Metadata.Namespace {
|
if configmap.Namespace != fn.Metadata.Namespace {
|
||||||
result = multierror.Append(result, fmt.Errorf("function : %s.%s cannot reference a configmap : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, configmap.Name, configmap.Namespace))
|
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a configmap : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, configmap.Name, configmap.Namespace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if fn.Spec.Package.PackageRef.Namespace != fn.Metadata.Namespace {
|
if fn.Spec.Package.PackageRef.Namespace != fn.Metadata.Namespace {
|
||||||
result = multierror.Append(result, fmt.Errorf("function : %s.%s cannot reference a package : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, fn.Spec.Package.PackageRef.Name, fn.Spec.Package.PackageRef.Namespace))
|
errs = multierror.Append(errs, fmt.Errorf("function : %s.%s cannot reference a package : %s in namespace : %s", fn.Metadata.Name, fn.Metadata.Namespace, fn.Spec.Package.PackageRef.Name, fn.Spec.Package.PackageRef.Namespace))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if result != nil {
|
if errs.ErrorOrNil() != nil {
|
||||||
client.logger.Fatal("installation failed",
|
client.logger.Fatal("installation failed",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("summary", "a function cannot reference secrets, configmaps and packages outside it's own namespace"))
|
zap.String("summary", "a function cannot reference secrets, configmaps and packages outside it's own namespace"))
|
||||||
@@ -218,5 +219,4 @@ func (client *PreUpgradeTaskClient) SetupRoleBindings() {
|
|||||||
|
|
||||||
client.logger.Info("created rolebindings in default namespace",
|
client.logger.Info("created rolebindings in default namespace",
|
||||||
zap.Strings("role_bindings", []string{types.PackageGetterRB, types.SecretConfigMapGetterRB}))
|
zap.Strings("role_bindings", []string{types.PackageGetterRB, types.SecretConfigMapGetterRB}))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,11 +81,6 @@ clear
|
|||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#
|
|
||||||
# Record replay
|
|
||||||
#
|
|
||||||
clear
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Canary Deployments
|
# Canary Deployments
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
fission fn delete --name hi-py
|
|
||||||
fission route delete --name $(fission route list|grep hi|cut -f1 -d' ')
|
|
||||||
fission recorder delete --name my-recorder
|
|
||||||
kubectl -n fission delete pod redis-0
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
from flask import request
|
|
||||||
from flask import current_app
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
name=request.args["name"]
|
|
||||||
return "Hello, %s" % name
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
DEMO_RUN_FAST=1
|
|
||||||
ROOT_DIR=$(dirname $0)/..
|
|
||||||
. $ROOT_DIR/util.sh
|
|
||||||
|
|
||||||
desc "A simple function that takes inputs"
|
|
||||||
run "cat hi.py"
|
|
||||||
|
|
||||||
desc "Set up function"
|
|
||||||
run "fission function create --name hi-py --env python --code hi.py --entrypoint hi.main"
|
|
||||||
|
|
||||||
desc "Set up route"
|
|
||||||
run "fission route create --function hi-py --url /hi --method GET"
|
|
||||||
|
|
||||||
desc "Set up recorder"
|
|
||||||
run "fission recorder create --name my-recorder --function hi-py"
|
|
||||||
|
|
||||||
desc "Run function"
|
|
||||||
run "curl http://$FISSION_ROUTER/hi?name=world"
|
|
||||||
|
|
||||||
desc "View recording"
|
|
||||||
run "fission records view -v"
|
|
||||||
|
|
||||||
requid=$(fission records view -v|tail -1|cut -f1 -d' ')
|
|
||||||
|
|
||||||
desc "Replay recording"
|
|
||||||
run "fission replay --reqUID $requid"
|
|
||||||
@@ -38,10 +38,8 @@ func (e *Env) ToStringEnv() []string {
|
|||||||
|
|
||||||
func NewEnv(stringEnv []string) *Env {
|
func NewEnv(stringEnv []string) *Env {
|
||||||
env := &Env{}
|
env := &Env{}
|
||||||
if stringEnv != nil {
|
for _, rawEnvVar := range stringEnv {
|
||||||
for _, rawEnvVar := range stringEnv {
|
env.SetEnv(FromString(rawEnvVar))
|
||||||
env.SetEnv(FromString(rawEnvVar))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return env
|
return env
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Soam Vasani",
|
"name": "Soam Vasani",
|
||||||
"email": "soamvasani@platform9.com"
|
"email": "soamvasani+1@gmail.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Gary Yeap",
|
"name": "Gary Yeap",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var (
|
|||||||
|
|
||||||
// for tensorflow serving to use
|
// for tensorflow serving to use
|
||||||
MODEL_NAME = ""
|
MODEL_NAME = ""
|
||||||
|
API_TYPE = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -77,8 +78,26 @@ func specializeHandlerV2(logger *zap.Logger) func(http.ResponseWriter, *http.Req
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tensorflow-serving supports three types of API: classify, regress, predict
|
||||||
|
// To get the API type, we need to split the entry point with separator ":"
|
||||||
|
// POST http://host:port/v1/models/${MODEL_NAME}:(classify|regress:predict)
|
||||||
|
entrypoint := strings.Split(loadreq.FunctionName, ":")
|
||||||
|
modelDir, apiType := "", ""
|
||||||
|
|
||||||
|
if len(entrypoint) == 0 {
|
||||||
|
logger.Error("unable to load model due to empty entrypoint")
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
} else if len(entrypoint) == 1 {
|
||||||
|
modelDir = entrypoint[0]
|
||||||
|
apiType = "predict" // assign default API type
|
||||||
|
} else {
|
||||||
|
modelDir = entrypoint[0]
|
||||||
|
apiType = entrypoint[1]
|
||||||
|
}
|
||||||
|
|
||||||
// To ensure we load model from the expected path
|
// To ensure we load model from the expected path
|
||||||
basePath := fmt.Sprintf("%v/%v", loadreq.FilePath, loadreq.FunctionName)
|
basePath := fmt.Sprintf("%v/%v", loadreq.FilePath, modelDir)
|
||||||
basePath, err = filepath.Abs(basePath)
|
basePath, err = filepath.Abs(basePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := "error getting absolute path of model"
|
msg := "error getting absolute path of model"
|
||||||
@@ -104,6 +123,7 @@ func specializeHandlerV2(logger *zap.Logger) func(http.ResponseWriter, *http.Req
|
|||||||
|
|
||||||
// get directory name that holds model
|
// get directory name that holds model
|
||||||
MODEL_NAME = filepath.Base(basePath)
|
MODEL_NAME = filepath.Base(basePath)
|
||||||
|
API_TYPE = apiType
|
||||||
|
|
||||||
argModelBasePath := fmt.Sprintf("--model_base_path=%v", basePath)
|
argModelBasePath := fmt.Sprintf("--model_base_path=%v", basePath)
|
||||||
argModelName := fmt.Sprintf("--model_name=%v", MODEL_NAME)
|
argModelName := fmt.Sprintf("--model_name=%v", MODEL_NAME)
|
||||||
@@ -191,7 +211,8 @@ func main() {
|
|||||||
director := func(req *http.Request) {
|
director := func(req *http.Request) {
|
||||||
req.URL.Scheme = "http"
|
req.URL.Scheme = "http"
|
||||||
req.URL.Host = "localhost:8501"
|
req.URL.Host = "localhost:8501"
|
||||||
req.URL.Path = fmt.Sprintf("/v1/models/%v:predict", MODEL_NAME)
|
req.URL.Path = fmt.Sprintf("/v1/models/%v:%v", MODEL_NAME, API_TYPE)
|
||||||
|
req.Host = "localhost:8501"
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy := &httputil.ReverseProxy{
|
proxy := &httputil.ReverseProxy{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"name": "Soam Vasani",
|
"name": "Soam Vasani",
|
||||||
"email": "soamvasani@platform9.com"
|
"email": "soamvasani+1@gmail.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Gary Yeap",
|
"name": "Gary Yeap",
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Adding podspec for builder of environment
|
||||||
|
|
||||||
|
If you see the files in the `specs` directory you will get to know that we have just generated the
|
||||||
|
environment spec using the command
|
||||||
|
```
|
||||||
|
fission env create --name python --image fission/python-env --builder fission/python-builder --spec
|
||||||
|
```
|
||||||
|
and changed the env-python.yaml file to have below `podspec` for builder for the environment.
|
||||||
|
|
||||||
|
```
|
||||||
|
nodeSelector:
|
||||||
|
machinecap: high
|
||||||
|
tolerations:
|
||||||
|
- key: "env"
|
||||||
|
value: "prod"
|
||||||
|
operator: "Equal"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
If we create this environment, the builder pod that will be created will have the `PodSpec` that
|
||||||
|
we have mentioned for builder in the environment spec.
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
Fission Specs
|
||||||
|
=============
|
||||||
|
|
||||||
|
This is a set of specifications for a Fission app. This includes functions,
|
||||||
|
environments, and triggers; we collectively call these things "resources".
|
||||||
|
|
||||||
|
How to use these specs
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
These specs are handled with the 'fission spec' command. See 'fission spec --help'.
|
||||||
|
|
||||||
|
'fission spec apply' will "apply" all resources specified in this directory to your
|
||||||
|
cluster. That means it checks what resources exist on your cluster, what resources are
|
||||||
|
specified in the specs directory, and reconciles the difference by creating, updating or
|
||||||
|
deleting resources on the cluster.
|
||||||
|
|
||||||
|
'fission spec apply' will also package up your source code (or compiled binaries) and
|
||||||
|
upload the archives to the cluster if needed. It uses 'ArchiveUploadSpec' resources in
|
||||||
|
this directory to figure out which files to archive.
|
||||||
|
|
||||||
|
You can use 'fission spec apply --watch' to watch for file changes and continuously keep
|
||||||
|
the cluster updated.
|
||||||
|
|
||||||
|
You can add YAMLs to this directory by writing them manually, but it's easier to generate
|
||||||
|
them. Use 'fission function create --spec' to generate a function spec,
|
||||||
|
'fission environment create --spec' to generate an environment spec, and so on.
|
||||||
|
|
||||||
|
You can edit any of the files in this directory, except 'fission-deployment-config.yaml',
|
||||||
|
which contains a UID that you should never change. To apply your changes simply use
|
||||||
|
'fission spec apply'.
|
||||||
|
|
||||||
|
fission-deployment-config.yaml
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
fission-deployment-config.yaml contains a UID. This UID is what fission uses to correlate
|
||||||
|
resources on the cluster to resources in this directory.
|
||||||
|
|
||||||
|
All resources created by 'fission spec apply' are annotated with this UID. Resources on
|
||||||
|
the cluster that are _not_ annotated with this UID are never modified or deleted by
|
||||||
|
fission.
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: Environment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: python
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
builder:
|
||||||
|
command: build
|
||||||
|
image: fission/python-builder
|
||||||
|
podspec:
|
||||||
|
nodeSelector:
|
||||||
|
machinecap: high
|
||||||
|
tolerations:
|
||||||
|
- key: "env"
|
||||||
|
value: "prod"
|
||||||
|
operator: "Equal"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
keeparchive: false
|
||||||
|
poolsize: 3
|
||||||
|
resources: {}
|
||||||
|
runtime:
|
||||||
|
image: fission/python-env
|
||||||
|
terminationGracePeriod: 360
|
||||||
|
version: 2
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is generated by the 'fission spec init' command.
|
||||||
|
# See the README in this directory for background and usage information.
|
||||||
|
# Do not edit the UID below: that will break 'fission spec apply'
|
||||||
|
apiVersion: fission.io/v1
|
||||||
|
kind: DeploymentConfig
|
||||||
|
name: podspec-example
|
||||||
|
uid: c0803d62-03a2-4934-b9b2-82f2a221a333
|
||||||
@@ -15,9 +15,10 @@ $ fission pkg create --env tensorflow --deploy half_plus_two.zip
|
|||||||
|
|
||||||
## Create Function
|
## Create Function
|
||||||
|
|
||||||
Here, the `--entrypoint` represents the name of top directory contains trained model.
|
Here, the `--entrypoint` represents the name of the top directory contains the trained model and what kind of API the model supports.
|
||||||
|
Currently, three API are supported: `predict`, `classify`, `regress`. `predict` API will be used if no API kind was given.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ fission fn create --name t1 --pkg <pkg name> --env tensorflow --entrypoint "half_plus_two"
|
$ fission fn create --name t1 --pkg <pkg name> --env tensorflow --entrypoint "half_plus_two:predict"
|
||||||
$ fission fn test --name t1 --body '{"instances": [1.0, 2.0, 0.0]}' --method POST
|
$ fission fn test --name t1 --body '{"instances": [1.0, 2.0, 0.0]}' --method POST
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Git hooks
|
||||||
|
|
||||||
|
* pre-push: Check, build and test the changes.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cp githooks/* .git/hooks/
|
||||||
|
```
|
||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ROOT=`realpath $(dirname $0)/../..`
|
||||||
|
pushd $ROOT
|
||||||
|
make
|
||||||
|
popd
|
||||||
@@ -40,7 +40,10 @@ require (
|
|||||||
github.com/imdario/mergo v0.3.5
|
github.com/imdario/mergo v0.3.5
|
||||||
github.com/influxdata/influxdb v1.2.0
|
github.com/influxdata/influxdb v1.2.0
|
||||||
github.com/kr/pretty v0.1.0 // indirect
|
github.com/kr/pretty v0.1.0 // indirect
|
||||||
|
github.com/life1347/color v1.7.0
|
||||||
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c // indirect
|
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.4 // indirect
|
||||||
|
github.com/mattn/go-isatty v0.0.10 // indirect
|
||||||
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0
|
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0
|
||||||
github.com/nats-io/gnatsd v1.4.1 // indirect
|
github.com/nats-io/gnatsd v1.4.1 // indirect
|
||||||
github.com/nats-io/go-nats v1.6.0 // indirect
|
github.com/nats-io/go-nats v1.6.0 // indirect
|
||||||
@@ -56,7 +59,8 @@ require (
|
|||||||
github.com/prometheus/common v0.4.1
|
github.com/prometheus/common v0.4.1
|
||||||
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967
|
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967
|
||||||
github.com/satori/go.uuid v1.2.0
|
github.com/satori/go.uuid v1.2.0
|
||||||
github.com/spf13/pflag v1.0.3
|
github.com/spf13/cobra v0.0.5
|
||||||
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/stretchr/testify v1.3.0
|
github.com/stretchr/testify v1.3.0
|
||||||
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670 // indirect
|
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670 // indirect
|
||||||
github.com/urfave/cli v1.20.0
|
github.com/urfave/cli v1.20.0
|
||||||
@@ -69,7 +73,6 @@ require (
|
|||||||
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443 // indirect
|
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443 // indirect
|
||||||
golang.org/x/image v0.0.0-20190618124811-92942e4437e2 // indirect
|
golang.org/x/image v0.0.0-20190618124811-92942e4437e2 // indirect
|
||||||
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b
|
golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b
|
||||||
golang.org/x/sys v0.0.0-20190619183051-17bc6164aac4 // indirect
|
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
||||||
google.golang.org/appengine v1.6.1 // indirect
|
google.golang.org/appengine v1.6.1 // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
|
|||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs=
|
github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs=
|
||||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||||
|
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
|
||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||||
@@ -46,11 +47,15 @@ github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyV
|
|||||||
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
|
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||||
|
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
|
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||||
github.com/coreos/go-oidc v0.0.0-20180117170138-065b426bd416/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
|
github.com/coreos/go-oidc v0.0.0-20180117170138-065b426bd416/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
|
||||||
github.com/coreos/go-semver v0.0.0-20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
github.com/coreos/go-semver v0.0.0-20180108230905-e214231b295a/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
|
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||||
|
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
@@ -188,12 +193,14 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
|
|||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/hashicorp/raft v1.0.0 h1:htBVktAOtGs4Le5Z7K8SF5H2+oWsQFYVmOgH5loro7Y=
|
github.com/hashicorp/raft v1.0.0 h1:htBVktAOtGs4Le5Z7K8SF5H2+oWsQFYVmOgH5loro7Y=
|
||||||
github.com/hashicorp/raft v1.0.0/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcbNAQLkI=
|
github.com/hashicorp/raft v1.0.0/go.mod h1:DVSAWItjLjTOkVbSpWQ0j0kUADIvDaCtBxIcbNAQLkI=
|
||||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
|
github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
|
||||||
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||||
github.com/influxdata/influxdb v1.2.0 h1:ZSB1cdZP9/8yyFzZhyaHimPL55Qo2kRDv2VhgnCePJ4=
|
github.com/influxdata/influxdb v1.2.0 h1:ZSB1cdZP9/8yyFzZhyaHimPL55Qo2kRDv2VhgnCePJ4=
|
||||||
github.com/influxdata/influxdb v1.2.0/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=
|
github.com/influxdata/influxdb v1.2.0/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=
|
||||||
@@ -214,15 +221,24 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
|||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
|
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
|
||||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
|
github.com/life1347/color v1.7.0 h1:Csr56ts64td/iG9T9o4p9cXNK46YB1/ZSq3V+qDwD4Y=
|
||||||
|
github.com/life1347/color v1.7.0/go.mod h1:yXW8vSPZhOJLmveaa6cN+24V2xrX2Cuf3X7nVpiRidw=
|
||||||
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
github.com/mailru/easyjson v0.0.0-20180323154445-8b799c424f57/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
github.com/mailru/easyjson v0.0.0-20180323154445-8b799c424f57/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
|
||||||
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c h1:N7uWGS2fTwH/4BwxbHiJZNAFTSJ5yPU0emHsQWvkxEY=
|
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c h1:N7uWGS2fTwH/4BwxbHiJZNAFTSJ5yPU0emHsQWvkxEY=
|
||||||
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
||||||
|
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
|
||||||
|
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
|
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=
|
||||||
|
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0 h1:581DnhoG2Q33rqM3X6Is+8agf17B2vlzV/H52/Xvcd0=
|
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0 h1:581DnhoG2Q33rqM3X6Is+8agf17B2vlzV/H52/Xvcd0=
|
||||||
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU=
|
github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
@@ -257,6 +273,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
|
|||||||
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
||||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||||
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
|
github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||||
@@ -288,14 +305,24 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
|
|||||||
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
|
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
|
||||||
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967 h1:x7xEyJDP7Hv3LVgvWhzioQqbC/KtuUhTigKlH/8ehhE=
|
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967 h1:x7xEyJDP7Hv3LVgvWhzioQqbC/KtuUhTigKlH/8ehhE=
|
||||||
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
||||||
|
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||||
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
|
github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937 h1:+ryWjMVzFAkEz5zT+Ms49aROZwxlJce3x3zLTFpkz3Y=
|
||||||
github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||||
|
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
|
||||||
|
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||||
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
|
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
@@ -303,6 +330,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
|||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||||
|
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||||
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670 h1:HQWT4ta3wW5GZ790GaqLCS+w1dvuA3rMfEQxLi+UOYU=
|
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670 h1:HQWT4ta3wW5GZ790GaqLCS+w1dvuA3rMfEQxLi+UOYU=
|
||||||
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
|
github.com/ulikunitz/xz v0.0.0-20180703112113-636d36a76670/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
|
||||||
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
|
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
|
||||||
@@ -310,6 +338,7 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
|
|||||||
github.com/wcharczuk/go-chart v2.0.1+incompatible h1:0pz39ZAycJFF7ju/1mepnk26RLVLBCWz1STcD3doU0A=
|
github.com/wcharczuk/go-chart v2.0.1+incompatible h1:0pz39ZAycJFF7ju/1mepnk26RLVLBCWz1STcD3doU0A=
|
||||||
github.com/wcharczuk/go-chart v2.0.1+incompatible/go.mod h1:PF5tmL4EIx/7Wf+hEkpCqYi5He4u90sw+0+6FhrryuE=
|
github.com/wcharczuk/go-chart v2.0.1+incompatible/go.mod h1:PF5tmL4EIx/7Wf+hEkpCqYi5He4u90sw+0+6FhrryuE=
|
||||||
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||||
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk=
|
go.etcd.io/bbolt v1.3.2 h1:Z/90sZLPOeCy2PwprqkFa25PdkusRzaj9P8zm/KNyvk=
|
||||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||||
@@ -327,6 +356,7 @@ go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o=
|
|||||||
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
@@ -379,15 +409,17 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190619183051-17bc6164aac4 h1:FFQWNXvutleFrNfNdz+TAJiRUdRxjFpjBtDMQ2y3psA=
|
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
|
||||||
golang.org/x/sys v0.0.0-20190619183051-17bc6164aac4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.11.6
|
FROM golang:1.12.13
|
||||||
ENV GO111MODULE on
|
ENV GO111MODULE on
|
||||||
RUN wget -qO- https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz | tar xvz -C /usr/local/bin/ --strip 1
|
RUN wget -qO- https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz | tar xvz -C /usr/local/bin/ --strip 1
|
||||||
RUN wget -qO- https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz | tar xvz -C /usr/local/bin/ --strip 1
|
RUN wget -qO- https://storage.googleapis.com/kubernetes-helm/helm-v2.16.1-linux-amd64.tar.gz | tar xvz -C /usr/local/bin/ --strip 1
|
||||||
|
|||||||
+10
-8
@@ -44,7 +44,7 @@ Updating Fission Repo (https://github.com/fission/fission)
|
|||||||
|
|
||||||
1. cd to the top of the fission repo, create a branch:
|
1. cd to the top of the fission repo, create a branch:
|
||||||
|
|
||||||
git checkout -b vX.Y.Z
|
git checkout -b release-X.Y.Z
|
||||||
|
|
||||||
2. Change references of old version to new version in charts directory. You use replace and find all with a quick preview in your IDE.
|
2. Change references of old version to new version in charts directory. You use replace and find all with a quick preview in your IDE.
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ Updating Fission Repo (https://github.com/fission/fission)
|
|||||||
|
|
||||||
`./hack/release.sh <VERSION>`
|
`./hack/release.sh <VERSION>`
|
||||||
|
|
||||||
This script checks to make sure you're releasing from the vX.Y.Z
|
This script checks to make sure you're releasing from the release-X.Y.Z
|
||||||
branch, and that your repo is clean (no modified/staged files).
|
branch, and that your repo is clean (no modified/staged files).
|
||||||
|
|
||||||
This will take a while as it builds and pushes all images (Approx ~2-3 hours)
|
This will take a while as it builds and pushes all images (Approx ~2-3 hours)
|
||||||
@@ -61,10 +61,13 @@ Updating Fission Repo (https://github.com/fission/fission)
|
|||||||
|
|
||||||
5. As part of release script, changelog.md has been modified. Take a look at it, correct it if you want and then commit it, discard other directories etc. produced by builders after inspection.
|
5. As part of release script, changelog.md has been modified. Take a look at it, correct it if you want and then commit it, discard other directories etc. produced by builders after inspection.
|
||||||
|
|
||||||
6. Now push this vx.y.z branch to remote repo. Create a PR and merge it into master branch.
|
6. Push this release-x.y.z branch to remote repo. Create a PR and wait for CI passed.
|
||||||
|
|
||||||
a. Test build from master branch for sanity check
|
7. Now manually merge the release-x.y.z branch into master branch with Git command to prevent the commit SHA from being changed.
|
||||||
b. Make sure the master build is green
|
|
||||||
|
`git checkout master && git merge --ff-only release-<VERSION>`
|
||||||
|
|
||||||
|
8. Test build from master branch for sanity check and make sure the master build is green
|
||||||
|
|
||||||
Updating Fission Charts (https://github.com/fission/fission-charts)
|
Updating Fission Charts (https://github.com/fission/fission-charts)
|
||||||
------------------------------
|
------------------------------
|
||||||
@@ -72,8 +75,7 @@ a. Switch to fission/fission-charts repo and run `index.sh` in that repo. (Don'
|
|||||||
|
|
||||||
b. You should have index.yaml and fission-core-*, fission-all-* charts as change, add, commit and push it to repo.
|
b. You should have index.yaml and fission-core-*, fission-all-* charts as change, add, commit and push it to repo.
|
||||||
|
|
||||||
|
9. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created.
|
||||||
8. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created.
|
|
||||||
|
|
||||||
Edit it and add links to:
|
Edit it and add links to:
|
||||||
|
|
||||||
@@ -85,7 +87,7 @@ Before you save the release - UNCHECK the "This is a pre-release" checkbox. This
|
|||||||
Updating Fission Docs (https://github.com/fission/docs.fission.io)
|
Updating Fission Docs (https://github.com/fission/docs.fission.io)
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
9. Documentatin Update
|
10. 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 master locally.
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ build_env_builder_image() {
|
|||||||
else
|
else
|
||||||
# variant specified - append variant to image name and assume dockerfile
|
# variant specified - append variant to image name and assume dockerfile
|
||||||
# exists with same suffix (e.g. image node-env-debian built from Dockerfile-debian)
|
# exists with same suffix (e.g. image node-env-debian built from Dockerfile-debian)
|
||||||
imgname="$imgname-$imgvariant"
|
imgname="$imgnamebase-$imgvariant"
|
||||||
dockerfile="Dockerfile-$imgvariant"
|
dockerfile="Dockerfile-$imgvariant"
|
||||||
fi
|
fi
|
||||||
echo "Building $envdir -> $imgname:$version using $dockerfile"
|
echo "Building $envdir -> $imgname:$version using $dockerfile"
|
||||||
@@ -198,8 +198,8 @@ build_charts() {
|
|||||||
do
|
do
|
||||||
# https://github.com/kubernetes/helm/issues/1732
|
# https://github.com/kubernetes/helm/issues/1732
|
||||||
helm init --client-only
|
helm init --client-only
|
||||||
helm package -u $c/
|
helm package -u $c/
|
||||||
mv *.tgz $BUILDDIR/charts/
|
mv *.tgz $BUILDDIR/charts/
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
@@ -226,6 +226,8 @@ build_yamls() {
|
|||||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,serviceType=NodePort,routerServiceType=NodePort > ${c}-${version}-minikube.yaml
|
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,serviceType=NodePort,routerServiceType=NodePort > ${c}-${version}-minikube.yaml
|
||||||
# for environments that support LoadBalancer
|
# for environments that support LoadBalancer
|
||||||
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true > ${c}-${version}.yaml
|
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true > ${c}-${version}.yaml
|
||||||
|
# for OpenShift
|
||||||
|
helm template ${c} -n ${releaseName} --namespace fission --set analytics=false,analyticsNonHelmInstall=true,logger.enableSecurityContext=true,prometheus.enabled=false > ${c}-${version}-openshift.yaml
|
||||||
|
|
||||||
# copy yaml files to build directory
|
# copy yaml files to build directory
|
||||||
mv *.yaml ${BUILDDIR}/yamls/
|
mv *.yaml ${BUILDDIR}/yamls/
|
||||||
|
|||||||
+33
-14
@@ -6,14 +6,16 @@ set -e
|
|||||||
DIR=$(realpath $(dirname $0))/../
|
DIR=$(realpath $(dirname $0))/../
|
||||||
BUILDDIR=$(realpath $DIR)/build
|
BUILDDIR=$(realpath $DIR)/build
|
||||||
|
|
||||||
|
source $(realpath ${DIR}/test/init_tools.sh)
|
||||||
|
|
||||||
# Ensure we're on the master branch
|
# Ensure we're on the master branch
|
||||||
check_branch() {
|
check_branch() {
|
||||||
local version=$1
|
local version=$1
|
||||||
curr_branch=$(git rev-parse --abbrev-ref HEAD)
|
curr_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||||
if [ $curr_branch != "v${version}" ]
|
if [ $curr_branch != "release-${version}" ]
|
||||||
then
|
then
|
||||||
echo "Not on v${version} branch."
|
echo "Not on release-${version} branch."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,8 +23,8 @@ check_branch() {
|
|||||||
check_clean() {
|
check_clean() {
|
||||||
if ! git diff-index --quiet HEAD --
|
if ! git diff-index --quiet HEAD --
|
||||||
then
|
then
|
||||||
echo "Unclean tree"
|
echo "Unclean tree"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,9 +50,9 @@ push_builder_image() {
|
|||||||
|
|
||||||
push_env_image() {
|
push_env_image() {
|
||||||
local version=$1
|
local version=$1
|
||||||
envdir=$2
|
local envdir=$2
|
||||||
imgnamebase=$3
|
local imgnamebase=$3
|
||||||
imgvariant=$4
|
local imgvariant=$4
|
||||||
|
|
||||||
if [ -z "$imgvariant" ]
|
if [ -z "$imgvariant" ]
|
||||||
then
|
then
|
||||||
@@ -59,7 +61,7 @@ push_env_image() {
|
|||||||
else
|
else
|
||||||
# variant specified - append variant to image name and assume dockerfile
|
# variant specified - append variant to image name and assume dockerfile
|
||||||
# exists with same suffix (e.g. image node-env-debian built from Dockerfile-debian)
|
# exists with same suffix (e.g. image node-env-debian built from Dockerfile-debian)
|
||||||
imgname="$imgname-$imgvariant"
|
imgname="$imgnamebase-$imgvariant"
|
||||||
fi
|
fi
|
||||||
echo "Pushing $envdir -> $imgname:$version"
|
echo "Pushing $envdir -> $imgname:$version"
|
||||||
|
|
||||||
@@ -149,12 +151,21 @@ push_all() {
|
|||||||
tag_and_release() {
|
tag_and_release() {
|
||||||
local version=$1
|
local version=$1
|
||||||
local gittag=$version
|
local gittag=$version
|
||||||
|
local prefix="v"
|
||||||
|
local gopkgtag=${version/#/${prefix}}
|
||||||
|
|
||||||
|
if [[ ${version} == v* ]]; # if version starts with "v", don't append prefix.
|
||||||
|
then
|
||||||
|
gopkgtag=${version}
|
||||||
|
fi
|
||||||
|
|
||||||
# tag the release
|
# tag the release
|
||||||
git tag $gittag
|
git tag $gittag
|
||||||
|
git tag -a $gopkgtag -m "Fission $gopkgtag"
|
||||||
|
|
||||||
# push tag
|
# push tag
|
||||||
git push origin $gittag
|
git push origin $gittag
|
||||||
|
git push origin $gopkgtag
|
||||||
|
|
||||||
# create gh release
|
# create gh release
|
||||||
gothub release \
|
gothub release \
|
||||||
@@ -193,7 +204,7 @@ attach_github_release_cli() {
|
|||||||
--replace \
|
--replace \
|
||||||
--user fission \
|
--user fission \
|
||||||
--repo fission \
|
--repo fission \
|
||||||
--tag $gittag \
|
--tag $gittag \
|
||||||
--name fission-cli-windows.exe \
|
--name fission-cli-windows.exe \
|
||||||
--file $BUILDDIR/cli/windows/fission-cli-windows.exe
|
--file $BUILDDIR/cli/windows/fission-cli-windows.exe
|
||||||
}
|
}
|
||||||
@@ -207,7 +218,7 @@ attach_github_release_charts() {
|
|||||||
--replace \
|
--replace \
|
||||||
--user fission \
|
--user fission \
|
||||||
--repo fission \
|
--repo fission \
|
||||||
--tag $gittag \
|
--tag $gittag \
|
||||||
--name fission-all-$version.tgz \
|
--name fission-all-$version.tgz \
|
||||||
--file $BUILDDIR/charts/fission-all-$version.tgz
|
--file $BUILDDIR/charts/fission-all-$version.tgz
|
||||||
|
|
||||||
@@ -215,7 +226,7 @@ attach_github_release_charts() {
|
|||||||
--replace \
|
--replace \
|
||||||
--user fission \
|
--user fission \
|
||||||
--repo fission \
|
--repo fission \
|
||||||
--tag $gittag \
|
--tag $gittag \
|
||||||
--name fission-core-$version.tgz \
|
--name fission-core-$version.tgz \
|
||||||
--file $BUILDDIR/charts/fission-core-$version.tgz
|
--file $BUILDDIR/charts/fission-core-$version.tgz
|
||||||
|
|
||||||
@@ -243,6 +254,14 @@ attach_github_release_yamls() {
|
|||||||
--tag $gittag \
|
--tag $gittag \
|
||||||
--name ${c}-${version}.yaml \
|
--name ${c}-${version}.yaml \
|
||||||
--file $BUILDDIR/yamls/${c}-${version}.yaml
|
--file $BUILDDIR/yamls/${c}-${version}.yaml
|
||||||
|
|
||||||
|
gothub upload \
|
||||||
|
--replace \
|
||||||
|
--user fission \
|
||||||
|
--repo fission \
|
||||||
|
--tag $gittag \
|
||||||
|
--name ${c}-${version}-openshift.yaml \
|
||||||
|
--file $BUILDDIR/yamls/${c}-${version}-openshift.yaml
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +288,7 @@ generate_changelog() {
|
|||||||
|
|
||||||
# generate changelog from github
|
# generate changelog from github
|
||||||
github_changelog_generator fission/fission -t ${GITHUB_TOKEN} --future-release ${version} --no-issues -o tmp_CHANGELOG.md
|
github_changelog_generator fission/fission -t ${GITHUB_TOKEN} --future-release ${version} --no-issues -o tmp_CHANGELOG.md
|
||||||
sed -i '' -e '$ d' tmp_CHANGELOG.md
|
sed -i '$ d' tmp_CHANGELOG.md
|
||||||
|
|
||||||
# concatenate two files
|
# concatenate two files
|
||||||
cat tmp_CHANGELOG.md >> new_CHANGELOG.md
|
cat tmp_CHANGELOG.md >> new_CHANGELOG.md
|
||||||
@@ -335,7 +354,7 @@ docker build -t fission-release-builder -f $GOPATH/src/github.com/fission/fissio
|
|||||||
# Build all binaries & container images in docker
|
# Build all binaries & container images in docker
|
||||||
# Here we mount docker.sock into container so that docker client can communicate with host docker daemon.
|
# Here we mount docker.sock into container so that docker client can communicate with host docker daemon.
|
||||||
# For more detail please visit https://docs.docker.com/machine/overview/
|
# For more detail please visit https://docs.docker.com/machine/overview/
|
||||||
docker run --rm -v $GOPATH/src:/go/src -v /var/run/docker.sock:/var/run/docker.sock \
|
docker run --rm -it -v $GOPATH/src:/go/src -v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-e VERSION=$version -w "/go/src/github.com/fission/fission/hack" fission-release-builder sh -c "./release-build.sh"
|
-e VERSION=$version -w "/go/src/github.com/fission/fission/hack" fission-release-builder sh -c "./release-build.sh"
|
||||||
|
|
||||||
push_all $version
|
push_all $version
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Get staticcheck
|
# Get staticcheck
|
||||||
STATICCHECK_VERSION=2019.1.1
|
STATICCHECK_VERSION=2019.2.3
|
||||||
if [ ! -f $TOOL_DIR/staticcheck ]
|
if [ ! -f $TOOL_DIR/staticcheck ] || (staticcheck -version | grep -v $STATICCHECK_VERSION)
|
||||||
then
|
then
|
||||||
curl -LO https://github.com/dominikh/go-tools/releases/download/${STATICCHECK_VERSION}/staticcheck_linux_amd64
|
curl -LO https://github.com/dominikh/go-tools/releases/download/${STATICCHECK_VERSION}/staticcheck_linux_amd64.tar.gz
|
||||||
chmod +x staticcheck_linux_amd64
|
tar xzvf staticcheck_linux_amd64.tar.gz
|
||||||
mv staticcheck_linux_amd64 $TOOL_DIR/staticcheck
|
mv staticcheck/staticcheck $TOOL_DIR/staticcheck
|
||||||
fi
|
fi
|
||||||
|
|
||||||
K8SCLI_DIR=$HOME/k8scli
|
K8SCLI_DIR=$HOME/k8scli
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
go vet -v $(go list ./...| grep -v vendor)
|
go vet -v $(go list ./...| grep -v "vendor" | grep -v "examples" | grep -v "demos" | grep -v "test")
|
||||||
|
|||||||
@@ -4,14 +4,4 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
ROOT=`realpath $(dirname $0)/..`
|
go list ./...| grep -v vendor | grep -v "examples" | grep -v "demos" | grep -v "test" | xargs -I@ staticcheck @
|
||||||
|
|
||||||
# Currently here only lists the packages that already addressed all warnings for gradual code repair.
|
|
||||||
# That means we don't allow adding new warnings to any of package in list. And eventually, the
|
|
||||||
# list will be replaced by find command.
|
|
||||||
declare -a pkgs=("pkg/builder" "pkg/builder" "pkg/crd" "pkg/logger" "pkg/buildermgr" "pkg/fission-cli" "cmd/fission-cli")
|
|
||||||
|
|
||||||
for pkg in "${pkgs[@]}"
|
|
||||||
do
|
|
||||||
find ${ROOT}/${pkg} -type d |grep -v influxdb | xargs -I@ staticcheck @
|
|
||||||
done
|
|
||||||
|
|||||||
@@ -18,13 +18,12 @@ package v1
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
EXECUTOR_INSTANCEID_LABEL string = "executorInstanceId"
|
EXECUTOR_INSTANCEID_LABEL string = "executorInstanceId"
|
||||||
POOLMGR_INSTANCEID_LABEL string = "poolmgrInstanceId"
|
|
||||||
DEFAULT_FUNCTION_TIMEOUT int = 60
|
DEFAULT_FUNCTION_TIMEOUT int = 60
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
//LastUpdateTimestamp env variable is used for updating configmaps and secrets in pods
|
// ResourceVersionCount env variable is used for updating configmaps and secrets in pods
|
||||||
LastUpdateTimestamp string = "LASTUPDATE_TIMESTAMP"
|
ResourceVersionCount string = "RESOURCE_VERSION_COUNT"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -54,8 +53,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ExecutorTypePoolmgr = "poolmgr"
|
ExecutorTypePoolmgr ExecutorType = "poolmgr"
|
||||||
ExecutorTypeNewdeploy = "newdeploy"
|
ExecutorTypeNewdeploy ExecutorType = "newdeploy"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -56,10 +56,6 @@ func (c *CanaryConfig) GetObjectKind() schema.ObjectKind {
|
|||||||
return &c.TypeMeta
|
return &c.TypeMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Recorder) GetObjectKind() schema.ObjectKind {
|
|
||||||
return &r.TypeMeta
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *Function) GetObjectMeta() metav1.Object {
|
func (f *Function) GetObjectMeta() metav1.Object {
|
||||||
return &f.Metadata
|
return &f.Metadata
|
||||||
}
|
}
|
||||||
@@ -85,10 +81,6 @@ func (c *CanaryConfig) GetObjectMeta() metav1.Object {
|
|||||||
return &c.Metadata
|
return &c.Metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Recorder) GetObjectMeta() metav1.Object {
|
|
||||||
return &r.Metadata
|
|
||||||
}
|
|
||||||
|
|
||||||
func (fl *FunctionList) GetObjectKind() schema.ObjectKind {
|
func (fl *FunctionList) GetObjectKind() schema.ObjectKind {
|
||||||
return &fl.TypeMeta
|
return &fl.TypeMeta
|
||||||
}
|
}
|
||||||
@@ -110,9 +102,6 @@ func (ml *MessageQueueTriggerList) GetObjectKind() schema.ObjectKind {
|
|||||||
func (pl *PackageList) GetObjectKind() schema.ObjectKind {
|
func (pl *PackageList) GetObjectKind() schema.ObjectKind {
|
||||||
return &pl.TypeMeta
|
return &pl.TypeMeta
|
||||||
}
|
}
|
||||||
func (rl *RecorderList) GetObjectKind() schema.ObjectKind {
|
|
||||||
return &rl.TypeMeta
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cl *CanaryConfigList) GetObjectKind() schema.ObjectKind {
|
func (cl *CanaryConfigList) GetObjectKind() schema.ObjectKind {
|
||||||
return &cl.TypeMeta
|
return &cl.TypeMeta
|
||||||
@@ -140,10 +129,6 @@ func (pl *PackageList) GetListMeta() metav1.ListInterface {
|
|||||||
return &pl.Metadata
|
return &pl.Metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rl *RecorderList) GetListMeta() metav1.ListInterface {
|
|
||||||
return &rl.Metadata
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cl *CanaryConfigList) GetListMeta() metav1.ListInterface {
|
func (cl *CanaryConfigList) GetListMeta() metav1.ListInterface {
|
||||||
return &cl.Metadata
|
return &cl.Metadata
|
||||||
}
|
}
|
||||||
@@ -279,13 +264,3 @@ func (ml *MessageQueueTriggerList) Validate() error {
|
|||||||
}
|
}
|
||||||
return result.ErrorOrNil()
|
return result.ErrorOrNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Recorder) Validate() error {
|
|
||||||
result := &multierror.Error{}
|
|
||||||
|
|
||||||
result = multierror.Append(result,
|
|
||||||
validateMetadata("Recorder", r.Metadata),
|
|
||||||
r.Spec.Validate())
|
|
||||||
|
|
||||||
return result.ErrorOrNil()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -157,23 +157,6 @@ type (
|
|||||||
Items []MessageQueueTrigger `json:"items"`
|
Items []MessageQueueTrigger `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recorder allows user to record all traffic payload to a certain function.
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
||||||
Recorder struct {
|
|
||||||
metav1.TypeMeta `json:",inline"`
|
|
||||||
Metadata metav1.ObjectMeta `json:"metadata"`
|
|
||||||
Spec RecorderSpec `json:"spec"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// RecorderList is a list of Recorders.
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
|
||||||
RecorderList struct {
|
|
||||||
metav1.TypeMeta `json:",inline"`
|
|
||||||
Metadata metav1.ListMeta `json:"metadata"`
|
|
||||||
|
|
||||||
Items []Recorder `json:"items"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// CanaryConfig is for canary deployment of two functions.
|
// CanaryConfig is for canary deployment of two functions.
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
CanaryConfig struct {
|
CanaryConfig struct {
|
||||||
@@ -343,7 +326,8 @@ type (
|
|||||||
// InvokeStrategy is a set of controls which affect how function executes
|
// InvokeStrategy is a set of controls which affect how function executes
|
||||||
InvokeStrategy InvokeStrategy
|
InvokeStrategy InvokeStrategy
|
||||||
|
|
||||||
// FunctionTimeout provides a maximum amount of duration wihtin which a request for a particular function execution should be complete.
|
// FunctionTimeout provides a maximum amount of duration within which a request for
|
||||||
|
// a particular function execution should be complete.
|
||||||
// This is optional. If not specified default value will be taken as 60s
|
// This is optional. If not specified default value will be taken as 60s
|
||||||
FunctionTimeout int `json:"functionTimeout,omitempty"`
|
FunctionTimeout int `json:"functionTimeout,omitempty"`
|
||||||
}
|
}
|
||||||
@@ -397,7 +381,6 @@ type (
|
|||||||
TargetCPUPercent int
|
TargetCPUPercent int
|
||||||
|
|
||||||
// This is the timeout setting for executor to wait for pod specialization.
|
// This is the timeout setting for executor to wait for pod specialization.
|
||||||
// Currently, only newdeploy utilizes this value.
|
|
||||||
SpecializationTimeout int
|
SpecializationTimeout int
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -490,6 +473,9 @@ type (
|
|||||||
// - ImagePullPolicy
|
// - ImagePullPolicy
|
||||||
// - ReadinessProbe
|
// - ReadinessProbe
|
||||||
Container *apiv1.Container `json:"container,omitempty"`
|
Container *apiv1.Container `json:"container,omitempty"`
|
||||||
|
|
||||||
|
// PodSpec will store the spec of the pod that will be applied to the pod created for the builder
|
||||||
|
PodSpec *apiv1.PodSpec `json:"podspec,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnvironmentSpec contains with builder, runtime and some other related environment settings.
|
// EnvironmentSpec contains with builder, runtime and some other related environment settings.
|
||||||
@@ -542,6 +528,10 @@ type (
|
|||||||
// or unarchived file should be placed, which is then used by specialize handler.
|
// or unarchived file should be placed, which is then used by specialize handler.
|
||||||
// (This is mainly for the JVM environment because .jar is one kind of zip archive.)
|
// (This is mainly for the JVM environment because .jar is one kind of zip archive.)
|
||||||
KeepArchive bool `json:"keeparchive"`
|
KeepArchive bool `json:"keeparchive"`
|
||||||
|
|
||||||
|
// ImagePullSecret is the secret for Kubernetes to pull an image from a
|
||||||
|
// private registry.
|
||||||
|
ImagePullSecret string `json:"imagepullsecret"`
|
||||||
}
|
}
|
||||||
|
|
||||||
AllowedFunctionsPerContainer string
|
AllowedFunctionsPerContainer string
|
||||||
@@ -638,22 +628,6 @@ type (
|
|||||||
ContentType string `json:"contentType"`
|
ContentType string `json:"contentType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecorderSpec defines a policy for recording requests and responses
|
|
||||||
// to a function, that can be later inspected or replayed.
|
|
||||||
RecorderSpec struct {
|
|
||||||
// Name of recorder resource
|
|
||||||
Name string `json:"name"`
|
|
||||||
|
|
||||||
// Function to collect requests/responses
|
|
||||||
Function string `json:"function"`
|
|
||||||
|
|
||||||
// HTTP trigger to record the requests and responses.
|
|
||||||
Triggers []string `json:"triggers"`
|
|
||||||
RetentionPolicy string `json:"-"` // `json:"retentionPolicy"`
|
|
||||||
EvictionPolicy string `json:"-"` // `json:"evictionPolicy"`
|
|
||||||
Enabled bool `json:"enabled"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// TimeTrigger invokes the specific function at a time or
|
// TimeTrigger invokes the specific function at a time or
|
||||||
// times specified by a cron string.
|
// times specified by a cron string.
|
||||||
TimeTriggerSpec struct {
|
TimeTriggerSpec struct {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
validAzureQueueName = regexp.MustCompile("^[a-z0-9][a-z0-9\\-]*[a-z0-9]$")
|
validAzureQueueName = regexp.MustCompile(`^[a-z0-9][a-z0-9\\-]*[a-z0-9]$`)
|
||||||
// Need to use raw string to support escape sequence for - & . chars
|
// Need to use raw string to support escape sequence for - & . chars
|
||||||
validKafkaTopicName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-\._]*[a-zA-Z0-9]$`)
|
validKafkaTopicName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-\._]*[a-zA-Z0-9]$`)
|
||||||
)
|
)
|
||||||
@@ -339,7 +339,7 @@ func (es ExecutionStrategy) Validate() error {
|
|||||||
|
|
||||||
if es.ExecutorType == ExecutorTypeNewdeploy {
|
if es.ExecutorType == ExecutorTypeNewdeploy {
|
||||||
if es.MinScale < 0 {
|
if es.MinScale < 0 {
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.MinScale", es.MinScale, "minimum scale must be greater or equal to 0"))
|
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.MinScale", es.MinScale, "minimum scale must be greater than or equal to 0"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if es.MaxScale <= 0 {
|
if es.MaxScale <= 0 {
|
||||||
@@ -347,7 +347,7 @@ func (es ExecutionStrategy) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if es.MaxScale < es.MinScale {
|
if es.MaxScale < es.MinScale {
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.MaxScale", es.MaxScale, "maximum scale must be greater or equal to minimum scale"))
|
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "ExecutionStrategy.MaxScale", es.MaxScale, "maximum scale must be greater than or equal to minimum scale"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if es.TargetCPUPercent <= 0 || es.TargetCPUPercent > 100 {
|
if es.TargetCPUPercent <= 0 || es.TargetCPUPercent > 100 {
|
||||||
@@ -421,7 +421,11 @@ func (spec EnvironmentSpec) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if spec.Poolsize < 0 {
|
if spec.Poolsize < 0 {
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "EnvironmentSpec.Poolsize", spec.Poolsize, "Poolsize must be greater or equal to 0"))
|
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "EnvironmentSpec.Poolsize", spec.Poolsize, "must be greater than or equal to 0"))
|
||||||
|
}
|
||||||
|
|
||||||
|
if spec.TerminationGracePeriod < 0 {
|
||||||
|
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "EnvironmentSpec.TerminationGracePeriod", spec.TerminationGracePeriod, "must be greater than or equal to 0"))
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.ErrorOrNil()
|
return result.ErrorOrNil()
|
||||||
@@ -540,33 +544,6 @@ func (spec MessageQueueTriggerSpec) Validate() error {
|
|||||||
return result.ErrorOrNil()
|
return result.ErrorOrNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (spec RecorderSpec) Validate() error {
|
|
||||||
result := &multierror.Error{}
|
|
||||||
|
|
||||||
// TODO: Function validation
|
|
||||||
//if len(spec.Function.Name) != 0 {
|
|
||||||
// result = multierror.Append(result, spec.Function.Validate())
|
|
||||||
//}
|
|
||||||
|
|
||||||
// TODO: Triggers validation
|
|
||||||
//for _, trigger := range spec.Triggers {
|
|
||||||
// result = multierror.Append(result, trigger.Validate())
|
|
||||||
//}
|
|
||||||
|
|
||||||
if len(spec.Name) == 0 {
|
|
||||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.Name", spec.Name, "not a valid name"))
|
|
||||||
}
|
|
||||||
//if len(spec.RetentionPolicy) == 0 {
|
|
||||||
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.RetentionPolicy", spec.Name, "not a valid retention policy"))
|
|
||||||
//}
|
|
||||||
//if len(spec.EvictionPolicy) == 0 {
|
|
||||||
// result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "RecorderSpec.EvictionPolicy", spec.Name, "not a valid eviction policy"))
|
|
||||||
//}
|
|
||||||
|
|
||||||
//log.Info("This is the RecorderSpec validation result: %v", result)
|
|
||||||
return result.ErrorOrNil()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (spec TimeTriggerSpec) Validate() error {
|
func (spec TimeTriggerSpec) Validate() error {
|
||||||
result := &multierror.Error{}
|
result := &multierror.Error{}
|
||||||
|
|
||||||
|
|||||||
@@ -801,87 +801,6 @@ func (in *PackageStatus) DeepCopy() *PackageStatus {
|
|||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *Recorder) DeepCopyInto(out *Recorder) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
in.Metadata.DeepCopyInto(&out.Metadata)
|
|
||||||
in.Spec.DeepCopyInto(&out.Spec)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recorder.
|
|
||||||
func (in *Recorder) DeepCopy() *Recorder {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(Recorder)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *Recorder) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *RecorderList) DeepCopyInto(out *RecorderList) {
|
|
||||||
*out = *in
|
|
||||||
out.TypeMeta = in.TypeMeta
|
|
||||||
out.Metadata = in.Metadata
|
|
||||||
if in.Items != nil {
|
|
||||||
in, out := &in.Items, &out.Items
|
|
||||||
*out = make([]Recorder, len(*in))
|
|
||||||
for i := range *in {
|
|
||||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderList.
|
|
||||||
func (in *RecorderList) DeepCopy() *RecorderList {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(RecorderList)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
||||||
func (in *RecorderList) DeepCopyObject() runtime.Object {
|
|
||||||
if c := in.DeepCopy(); c != nil {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
||||||
func (in *RecorderSpec) DeepCopyInto(out *RecorderSpec) {
|
|
||||||
*out = *in
|
|
||||||
if in.Triggers != nil {
|
|
||||||
in, out := &in.Triggers, &out.Triggers
|
|
||||||
*out = make([]string, len(*in))
|
|
||||||
copy(*out, *in)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecorderSpec.
|
|
||||||
func (in *RecorderSpec) DeepCopy() *RecorderSpec {
|
|
||||||
if in == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
out := new(RecorderSpec)
|
|
||||||
in.DeepCopyInto(out)
|
|
||||||
return out
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *Runtime) DeepCopyInto(out *Runtime) {
|
func (in *Runtime) DeepCopyInto(out *Runtime) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ func MakeBuilder(logger *zap.Logger, sharedVolumePath string) *Builder {
|
|||||||
|
|
||||||
func (builder *Builder) VersionHandler(w http.ResponseWriter, r *http.Request) {
|
func (builder *Builder) VersionHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
fmt.Fprintf(w, info.BuildInfo().String())
|
w.Write([]byte(info.BuildInfo().String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
func (builder *Builder) Handler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
@@ -489,6 +489,16 @@ func (envw *environmentWatcher) createBuilderDeployment(env *fv1.Environment, ns
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
podSpec := apiv1.PodSpec{
|
||||||
|
Containers: []apiv1.Container{*container},
|
||||||
|
ServiceAccountName: "fission-builder",
|
||||||
|
}
|
||||||
|
|
||||||
|
finalPodSpec, err := util.MergePodSpec(&podSpec, env.Spec.Builder.PodSpec)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
deployment := &appsv1.Deployment{
|
deployment := &appsv1.Deployment{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Namespace: ns,
|
Namespace: ns,
|
||||||
@@ -505,10 +515,7 @@ func (envw *environmentWatcher) createBuilderDeployment(env *fv1.Environment, ns
|
|||||||
Labels: sel,
|
Labels: sel,
|
||||||
Annotations: podAnnotations,
|
Annotations: podAnnotations,
|
||||||
},
|
},
|
||||||
Spec: apiv1.PodSpec{
|
Spec: *(util.ApplyImagePullSecret(env.Spec.ImagePullSecret, *finalPodSpec)),
|
||||||
Containers: []apiv1.Container{*container},
|
|
||||||
ServiceAccountName: "fission-builder",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ func (pkgw *packageWatcher) build(buildCache *cache.Cache, srcpkg *fv1.Package)
|
|||||||
|
|
||||||
// Ignore duplicate build requests
|
// Ignore duplicate build requests
|
||||||
key := fmt.Sprintf("%v-%v", srcpkg.Metadata.Name, srcpkg.Metadata.ResourceVersion)
|
key := fmt.Sprintf("%v-%v", srcpkg.Metadata.Name, srcpkg.Metadata.ResourceVersion)
|
||||||
err, _ := buildCache.Set(key, srcpkg)
|
_, err := buildCache.Set(key, srcpkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -159,7 +159,7 @@ func (c *Cache) Get(key interface{}) (interface{}, error) {
|
|||||||
|
|
||||||
// if key exists in the cache, the new value is NOT set; instead an
|
// if key exists in the cache, the new value is NOT set; instead an
|
||||||
// error and the old value are returned
|
// error and the old value are returned
|
||||||
func (c *Cache) Set(key interface{}, value interface{}) (error, interface{}) {
|
func (c *Cache) Set(key interface{}, value interface{}) (interface{}, error) {
|
||||||
respChannel := make(chan *response)
|
respChannel := make(chan *response)
|
||||||
c.requestChannel <- &request{
|
c.requestChannel <- &request{
|
||||||
requestType: SET,
|
requestType: SET,
|
||||||
@@ -168,7 +168,7 @@ func (c *Cache) Set(key interface{}, value interface{}) (error, interface{}) {
|
|||||||
responseChannel: respChannel,
|
responseChannel: respChannel,
|
||||||
}
|
}
|
||||||
resp := <-respChannel
|
resp := <-respChannel
|
||||||
return resp.error, resp.existingValue
|
return resp.existingValue, resp.error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cache) Delete(key interface{}) error {
|
func (c *Cache) Delete(key interface{}) error {
|
||||||
|
|||||||
Vendored
+3
-3
@@ -31,9 +31,9 @@ func checkErr(err error) {
|
|||||||
func TestCache(t *testing.T) {
|
func TestCache(t *testing.T) {
|
||||||
c := MakeCache(100*time.Millisecond, 100*time.Millisecond)
|
c := MakeCache(100*time.Millisecond, 100*time.Millisecond)
|
||||||
|
|
||||||
err, _ := c.Set("a", "b")
|
_, err := c.Set("a", "b")
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
err, _ = c.Set("p", "q")
|
_, err = c.Set("p", "q")
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
|
|
||||||
val, err := c.Get("a")
|
val, err := c.Get("a")
|
||||||
@@ -55,7 +55,7 @@ func TestCache(t *testing.T) {
|
|||||||
log.Panicf("found deleted element")
|
log.Panicf("found deleted element")
|
||||||
}
|
}
|
||||||
|
|
||||||
err, _ = c.Set("expires", "42")
|
_, err = c.Set("expires", "42")
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
time.Sleep(150 * time.Millisecond)
|
time.Sleep(150 * time.Millisecond)
|
||||||
_, err = c.Get("expires")
|
_, err = c.Get("expires")
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ func (cancelFuncMap *canaryConfigCancelFuncMap) lookup(f *metav1.ObjectMeta) (*C
|
|||||||
|
|
||||||
func (cancelFuncMap *canaryConfigCancelFuncMap) assign(f *metav1.ObjectMeta, value *CanaryProcessingInfo) error {
|
func (cancelFuncMap *canaryConfigCancelFuncMap) assign(f *metav1.ObjectMeta, value *CanaryProcessingInfo) error {
|
||||||
mk := keyFromMetadata(f)
|
mk := keyFromMetadata(f)
|
||||||
err, _ := cancelFuncMap.cache.Set(mk, value)
|
_, err := cancelFuncMap.cache.Set(mk, value)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,17 +67,21 @@ func MakeCanaryConfigMgr(logger *zap.Logger, fissionClient *crd.FissionClient, k
|
|||||||
} else if strings.Contains(envVar, "PROMETHEUS_SERVER_SERVICE_PORT") {
|
} else if strings.Contains(envVar, "PROMETHEUS_SERVER_SERVICE_PORT") {
|
||||||
prometheusSvcPort = getEnvValue(envVar)
|
prometheusSvcPort = getEnvValue(envVar)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(prometheusSvcHost) > 0 && len(prometheusSvcPort) > 0 {
|
if len(prometheusSvcHost) > 0 && len(prometheusSvcPort) > 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(prometheusSvcHost) == 0 && len(prometheusSvcPort) == 0 {
|
||||||
|
return nil, errors.New("unable to get prometheus service url")
|
||||||
|
}
|
||||||
prometheusSvc = fmt.Sprintf("http://%v:%v", prometheusSvcHost, prometheusSvcPort)
|
prometheusSvc = fmt.Sprintf("http://%v:%v", prometheusSvcHost, prometheusSvcPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Info("try to start canary config manager with prometheus service url", zap.String("prometheus", prometheusSvc))
|
||||||
|
|
||||||
_, err := url.Parse(prometheusSvc)
|
_, err := url.Parse(prometheusSvc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("prometheus service url not found/invalid, cant create canary config manager: %v", prometheusSvc)
|
return nil, errors.Errorf("prometheus service url not found/invalid, cant create canary config manager: %v", prometheusSvc)
|
||||||
}
|
}
|
||||||
|
|
||||||
promClient, err := MakePrometheusClient(logger, prometheusSvc)
|
promClient, err := MakePrometheusClient(logger, prometheusSvc)
|
||||||
@@ -443,6 +447,9 @@ func (canaryCfgMgr *canaryConfigMgr) rollback(canaryConfig *fv1.CanaryConfig, tr
|
|||||||
functionWeights[canaryConfig.Spec.OldFunction] = 100
|
functionWeights[canaryConfig.Spec.OldFunction] = 100
|
||||||
|
|
||||||
err := canaryCfgMgr.updateHttpTriggerWithRetries(trigger.Metadata.Name, trigger.Metadata.Namespace, functionWeights)
|
err := canaryCfgMgr.updateHttpTriggerWithRetries(trigger.Metadata.Name, trigger.Metadata.Namespace, functionWeights)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = canaryCfgMgr.updateCanaryConfigStatusWithRetries(canaryConfig.Metadata.Name, canaryConfig.Metadata.Namespace,
|
err = canaryCfgMgr.updateCanaryConfigStatusWithRetries(canaryConfig.Metadata.Name, canaryConfig.Metadata.Namespace,
|
||||||
types.CanaryConfigStatusFailed)
|
types.CanaryConfigStatusFailed)
|
||||||
|
|||||||
+7
-18
@@ -53,7 +53,6 @@ type (
|
|||||||
builderManagerUrl string
|
builderManagerUrl string
|
||||||
workflowApiUrl string
|
workflowApiUrl string
|
||||||
functionNamespace string
|
functionNamespace string
|
||||||
useIstio bool
|
|
||||||
featureStatus map[string]string
|
featureStatus map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +166,7 @@ func (api *API) getLogDBConfig(dbType string) logDBConfig {
|
|||||||
|
|
||||||
func (api *API) HomeHandler(w http.ResponseWriter, r *http.Request) {
|
func (api *API) HomeHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
fmt.Fprintf(w, info.ApiInfo().String())
|
w.Write([]byte(info.ApiInfo().String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *API) ApiVersionMismatchHandler(w http.ResponseWriter, r *http.Request) {
|
func (api *API) ApiVersionMismatchHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -191,7 +190,7 @@ func (api *API) GetSvcName(w http.ResponseWriter, r *http.Request) {
|
|||||||
fmt.Fprintf(w, service.Name+"."+podNamespace)
|
fmt.Fprintf(w, service.Name+"."+podNamespace)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *API) Serve(port int) {
|
func (api *API) GetHandler() http.Handler {
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/healthz", api.HealthHandler).Methods("GET")
|
r.HandleFunc("/healthz", api.HealthHandler).Methods("GET")
|
||||||
// Give a useful error message if an older CLI attempts to make a request
|
// Give a useful error message if an older CLI attempts to make a request
|
||||||
@@ -240,19 +239,6 @@ func (api *API) Serve(port int) {
|
|||||||
r.HandleFunc("/v2/triggers/messagequeue/{mqTrigger}", api.MessageQueueTriggerApiUpdate).Methods("PUT")
|
r.HandleFunc("/v2/triggers/messagequeue/{mqTrigger}", api.MessageQueueTriggerApiUpdate).Methods("PUT")
|
||||||
r.HandleFunc("/v2/triggers/messagequeue/{mqTrigger}", api.MessageQueueTriggerApiDelete).Methods("DELETE")
|
r.HandleFunc("/v2/triggers/messagequeue/{mqTrigger}", api.MessageQueueTriggerApiDelete).Methods("DELETE")
|
||||||
|
|
||||||
r.HandleFunc("/v2/recorders", api.RecorderApiList).Methods("GET")
|
|
||||||
r.HandleFunc("/v2/recorders", api.RecorderApiCreate).Methods("POST")
|
|
||||||
r.HandleFunc("/v2/recorders/{recorder}", api.RecorderApiGet).Methods("GET")
|
|
||||||
r.HandleFunc("/v2/recorders/{recorder}", api.RecorderApiUpdate).Methods("PUT")
|
|
||||||
r.HandleFunc("/v2/recorders/{recorder}", api.RecorderApiDelete).Methods("DELETE")
|
|
||||||
|
|
||||||
r.HandleFunc("/v2/records", api.RecordsApiListAll).Methods("GET")
|
|
||||||
r.HandleFunc("/v2/records/function/{function}", api.RecordsApiFilterByFunction).Methods("GET")
|
|
||||||
r.HandleFunc("/v2/records/trigger/{trigger}", api.RecordsApiFilterByTrigger).Methods("GET")
|
|
||||||
r.HandleFunc("/v2/records/time", api.RecordsApiFilterByTime).Methods("GET")
|
|
||||||
|
|
||||||
r.HandleFunc("/v2/replay/{reqUID}", api.ReplayByReqUID).Methods("GET")
|
|
||||||
|
|
||||||
r.HandleFunc("/v2/secrets/{secret}", api.SecretGet).Methods("GET")
|
r.HandleFunc("/v2/secrets/{secret}", api.SecretGet).Methods("GET")
|
||||||
r.HandleFunc("/v2/configmaps/{configmap}", api.ConfigMapGet).Methods("GET")
|
r.HandleFunc("/v2/configmaps/{configmap}", api.ConfigMapGet).Methods("GET")
|
||||||
|
|
||||||
@@ -270,9 +256,12 @@ func (api *API) Serve(port int) {
|
|||||||
|
|
||||||
r.Handle("/v2/apidocs.json", openAPI()).Methods("GET")
|
r.Handle("/v2/apidocs.json", openAPI()).Methods("GET")
|
||||||
|
|
||||||
address := fmt.Sprintf(":%v", port)
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func (api *API) Serve(port int) {
|
||||||
|
address := fmt.Sprintf(":%v", port)
|
||||||
api.logger.Info("server started", zap.Int("port", port))
|
api.logger.Info("server started", zap.Int("port", port))
|
||||||
err := http.ListenAndServe(address, r)
|
err := http.ListenAndServe(address, api.GetHandler())
|
||||||
api.logger.Fatal("done listening", zap.Error(err))
|
api.logger.Fatal("done listening", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -33,7 +31,7 @@ func (c *Client) CanaryConfigCreate(canaryConf *fv1.CanaryConfig) (*metav1.Objec
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("canaryconfigs"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("canaryconfigs", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -57,7 +55,7 @@ func (c *Client) CanaryConfigGet(m *metav1.ObjectMeta) (*fv1.CanaryConfig, error
|
|||||||
relativeUrl := fmt.Sprintf("canaryconfigs/%v", m.Name)
|
relativeUrl := fmt.Sprintf("canaryconfigs/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -106,13 +104,12 @@ func (c *Client) CanaryConfigUpdate(canaryConf *fv1.CanaryConfig) (*metav1.Objec
|
|||||||
func (c *Client) CanaryConfigDelete(m *metav1.ObjectMeta) error {
|
func (c *Client) CanaryConfigDelete(m *metav1.ObjectMeta) error {
|
||||||
relativeUrl := fmt.Sprintf("canaryconfigs/%v", m.Name)
|
relativeUrl := fmt.Sprintf("canaryconfigs/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
return c.delete(relativeUrl)
|
return c.delete(relativeUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) CanaryConfigList(ns string) ([]fv1.CanaryConfig, error) {
|
func (c *Client) CanaryConfigList(ns string) ([]fv1.CanaryConfig, error) {
|
||||||
relativeUrl := fmt.Sprintf("canaryconfigs?namespace=%v", ns)
|
relativeUrl := fmt.Sprintf("canaryconfigs?namespace=%v", ns)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,38 +18,56 @@ package client
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"io"
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"golang.org/x/net/context/ctxhttp"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
"github.com/fission/fission/pkg/info"
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
DefaultRequestHeaders map[string]string
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Client struct {
|
Client struct {
|
||||||
Url string
|
Url string
|
||||||
|
Headers map[string]string
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func MakeClient(serverUrl string) *Client {
|
func MakeClient(serverUrl string) *Client {
|
||||||
return &Client{Url: strings.TrimSuffix(serverUrl, "/")}
|
return &Client{
|
||||||
|
Url: strings.TrimSuffix(serverUrl, "/"),
|
||||||
|
Headers: DefaultRequestHeaders,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) create(relativeUrl string, contentType string, payload []byte) (*http.Response, error) {
|
||||||
|
var reader io.Reader
|
||||||
|
if len(payload) > 0 {
|
||||||
|
reader = bytes.NewReader(payload)
|
||||||
|
}
|
||||||
|
return c.sendRequest(http.MethodPost, c.v2CrdUrl(relativeUrl), map[string]string{"Content-type": contentType}, reader)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) put(relativeUrl string, contentType string, payload []byte) (*http.Response, error) {
|
||||||
|
var reader io.Reader
|
||||||
|
if len(payload) > 0 {
|
||||||
|
reader = bytes.NewReader(payload)
|
||||||
|
}
|
||||||
|
return c.sendRequest(http.MethodPut, c.v2CrdUrl(relativeUrl), map[string]string{"Content-type": contentType}, reader)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) get(relativeUrl string) (*http.Response, error) {
|
||||||
|
return c.sendRequest(http.MethodGet, c.v2CrdUrl(relativeUrl), nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) delete(relativeUrl string) error {
|
func (c *Client) delete(relativeUrl string) error {
|
||||||
req, err := http.NewRequest("DELETE", c.url(relativeUrl), nil)
|
resp, err := c.sendRequest(http.MethodDelete, c.v2CrdUrl(relativeUrl), nil, nil)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := http.DefaultClient.Do(req)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -58,26 +76,42 @@ func (c *Client) delete(relativeUrl string) error {
|
|||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("Delete failed")
|
return errors.Wrap(err, "error deleting")
|
||||||
} else {
|
} else {
|
||||||
return errors.New("Delete failed: " + string(body))
|
return errors.Errorf("failed to delete: %v", string(body))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) put(relativeUrl string, contentType string, body []byte) (*http.Response, error) {
|
func (c *Client) proxy(method string, relativeUrl string, payload []byte) (*http.Response, error) {
|
||||||
req, err := http.NewRequest("PUT", c.url(relativeUrl), bytes.NewReader(body))
|
var reader io.Reader
|
||||||
|
if len(payload) > 0 {
|
||||||
|
reader = bytes.NewReader(payload)
|
||||||
|
}
|
||||||
|
return c.sendRequest(method, c.proxyUrl(relativeUrl), nil, reader)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) sendRequest(method string, relativeUrl string, headers map[string]string, reader io.Reader) (*http.Response, error) {
|
||||||
|
req, err := http.NewRequest(method, relativeUrl, reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
req.Header.Set("Content-type", contentType)
|
for _, hs := range []map[string]string{headers, c.Headers} {
|
||||||
|
for k, v := range hs {
|
||||||
|
req.Header.Set(k, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
return http.DefaultClient.Do(req)
|
return http.DefaultClient.Do(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) url(relativeUrl string) string {
|
func (c *Client) v2CrdUrl(relativeUrl string) string {
|
||||||
return c.Url + "/v2/" + relativeUrl
|
return c.Url + "/v2/" + strings.TrimPrefix(relativeUrl, "/")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) proxyUrl(relativeUrl string) string {
|
||||||
|
return c.Url + "/proxy/" + strings.TrimPrefix(relativeUrl, "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) handleResponse(resp *http.Response) ([]byte, error) {
|
func (c *Client) handleResponse(resp *http.Response) ([]byte, error) {
|
||||||
@@ -95,29 +129,3 @@ func (c *Client) handleCreateResponse(resp *http.Response) ([]byte, error) {
|
|||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
return body, err
|
return body, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) ServerInfo() (*info.ServerInfo, error) {
|
|
||||||
url := fmt.Sprintf(c.Url)
|
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
resp, err := ctxhttp.Get(ctx, &http.Client{}, url)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := &info.ServerInfo{}
|
|
||||||
err = json.Unmarshal(body, info)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return info, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,20 +17,26 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
"golang.org/x/net/context/ctxhttp"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
|
"github.com/fission/fission/pkg/info"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) SecretGet(m *metav1.ObjectMeta) (*apiv1.Secret, error) {
|
func (c *Client) SecretGet(m *metav1.ObjectMeta) (*apiv1.Secret, error) {
|
||||||
relativeUrl := fmt.Sprintf("secrets/%v", m.Name)
|
relativeUrl := fmt.Sprintf("secrets/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -54,7 +60,7 @@ func (c *Client) ConfigMapGet(m *metav1.ObjectMeta) (*apiv1.ConfigMap, error) {
|
|||||||
relativeUrl := fmt.Sprintf("configmaps/%v", m.Name)
|
relativeUrl := fmt.Sprintf("configmaps/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -75,19 +81,15 @@ func (c *Client) ConfigMapGet(m *metav1.ObjectMeta) (*apiv1.ConfigMap, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) GetSvcURL(label string) (string, error) {
|
func (c *Client) GetSvcURL(label string) (string, error) {
|
||||||
url := fmt.Sprintf("%s/proxy/svcname?"+label, c.Url)
|
resp, err := c.proxy(http.MethodGet, "svcname?"+label, nil)
|
||||||
|
|
||||||
resp, err := http.Get(url)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp == nil {
|
if resp == nil {
|
||||||
return "", fmt.Errorf("Failed to find service for given label: %v", label)
|
return "", errors.Errorf("failed to find service for given label: %v", label)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@@ -97,3 +99,27 @@ func (c *Client) GetSvcURL(label string) (string, error) {
|
|||||||
|
|
||||||
return storageSvc, err
|
return storageSvc, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) ServerInfo() (*info.ServerInfo, error) {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
resp, err := ctxhttp.Get(ctx, &http.Client{}, c.Url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := &info.ServerInfo{}
|
||||||
|
err = json.Unmarshal(body, info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return info, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -43,7 +41,7 @@ func (c *Client) EnvironmentCreate(env *fv1.Environment) (*metav1.ObjectMeta, er
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("environments"), "application/json", bytes.NewReader(data))
|
resp, err := c.create("environments", "application/json", data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -67,7 +65,7 @@ func (c *Client) EnvironmentGet(m *metav1.ObjectMeta) (*fv1.Environment, error)
|
|||||||
relativeUrl := fmt.Sprintf("environments/%v", m.Name)
|
relativeUrl := fmt.Sprintf("environments/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -117,13 +115,12 @@ func (c *Client) EnvironmentUpdate(env *fv1.Environment) (*metav1.ObjectMeta, er
|
|||||||
func (c *Client) EnvironmentDelete(m *metav1.ObjectMeta) error {
|
func (c *Client) EnvironmentDelete(m *metav1.ObjectMeta) error {
|
||||||
relativeUrl := fmt.Sprintf("environments/%v", m.Name)
|
relativeUrl := fmt.Sprintf("environments/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
return c.delete(relativeUrl)
|
return c.delete(relativeUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) EnvironmentList(ns string) ([]fv1.Environment, error) {
|
func (c *Client) EnvironmentList(ns string) ([]fv1.Environment, error) {
|
||||||
relativeUrl := fmt.Sprintf("environments?namespace=%v", ns)
|
relativeUrl := fmt.Sprintf("environments?namespace=%v", ns)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,17 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
|
"github.com/fission/fission/pkg/fission-cli/console"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Client) FunctionCreate(f *fv1.Function) (*metav1.ObjectMeta, error) {
|
func (c *Client) FunctionCreate(f *fv1.Function) (*metav1.ObjectMeta, error) {
|
||||||
@@ -38,7 +41,7 @@ func (c *Client) FunctionCreate(f *fv1.Function) (*metav1.ObjectMeta, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("functions"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("functions", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,7 +65,7 @@ func (c *Client) FunctionGet(m *metav1.ObjectMeta) (*fv1.Function, error) {
|
|||||||
relativeUrl := fmt.Sprintf("functions/%v", m.Name)
|
relativeUrl := fmt.Sprintf("functions/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -87,7 +90,7 @@ func (c *Client) FunctionGetRawDeployment(m *metav1.ObjectMeta) ([]byte, error)
|
|||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
relativeUrl += fmt.Sprintf("&deploymentraw=1")
|
relativeUrl += fmt.Sprintf("&deploymentraw=1")
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -135,7 +138,7 @@ func (c *Client) FunctionDelete(m *metav1.ObjectMeta) error {
|
|||||||
|
|
||||||
func (c *Client) FunctionList(functionNamespace string) ([]fv1.Function, error) {
|
func (c *Client) FunctionList(functionNamespace string) ([]fv1.Function, error) {
|
||||||
relativeUrl := fmt.Sprintf("functions?namespace=%v", functionNamespace)
|
relativeUrl := fmt.Sprintf("functions?namespace=%v", functionNamespace)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -154,3 +157,29 @@ func (c *Client) FunctionList(functionNamespace string) ([]fv1.Function, error)
|
|||||||
|
|
||||||
return funcs, nil
|
return funcs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) FunctionPodLogs(m *metav1.ObjectMeta) (io.ReadCloser, int, error) {
|
||||||
|
relativeUrl := fmt.Sprintf("functions/%v", m.Name)
|
||||||
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
|
queryURL, err := url.Parse(c.Url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, errors.Wrapf(err, "error parsing the base URL '%v'", c.Url)
|
||||||
|
}
|
||||||
|
queryURL.Path = fmt.Sprintf("/proxy/logs/%s", m.Name)
|
||||||
|
|
||||||
|
console.Verbose(2, fmt.Sprintf("Try to get pod logs from controller '%v'", queryURL.String()))
|
||||||
|
|
||||||
|
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, errors.Wrap(err, "error creating logs request")
|
||||||
|
}
|
||||||
|
|
||||||
|
httpClient := http.Client{}
|
||||||
|
resp, err := httpClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, errors.Wrap(err, "error executing get logs request")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.Body, resp.StatusCode, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ func (c *Client) HTTPTriggerCreate(t *fv1.HTTPTrigger) (*metav1.ObjectMeta, erro
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("triggers/http"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("triggers/http", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,7 @@ func (c *Client) HTTPTriggerGet(m *metav1.ObjectMeta) (*fv1.HTTPTrigger, error)
|
|||||||
relativeUrl := fmt.Sprintf("triggers/http/%v", m.Name)
|
relativeUrl := fmt.Sprintf("triggers/http/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -121,7 +119,7 @@ func (c *Client) HTTPTriggerDelete(m *metav1.ObjectMeta) error {
|
|||||||
|
|
||||||
func (c *Client) HTTPTriggerList(triggerNamespace string) ([]fv1.HTTPTrigger, error) {
|
func (c *Client) HTTPTriggerList(triggerNamespace string) ([]fv1.HTTPTrigger, error) {
|
||||||
relativeUrl := fmt.Sprintf("triggers/http?namespace=%v", triggerNamespace)
|
relativeUrl := fmt.Sprintf("triggers/http?namespace=%v", triggerNamespace)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -39,7 +37,7 @@ func (c *Client) WatchCreate(w *fv1.KubernetesWatchTrigger) (*metav1.ObjectMeta,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("watches"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("watches", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -63,7 +61,7 @@ func (c *Client) WatchGet(m *metav1.ObjectMeta) (*fv1.KubernetesWatchTrigger, er
|
|||||||
relativeUrl := fmt.Sprintf("watches/%v", m.Name)
|
relativeUrl := fmt.Sprintf("watches/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -84,8 +82,7 @@ func (c *Client) WatchGet(m *metav1.ObjectMeta) (*fv1.KubernetesWatchTrigger, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) WatchUpdate(w *fv1.KubernetesWatchTrigger) (*metav1.ObjectMeta, error) {
|
func (c *Client) WatchUpdate(w *fv1.KubernetesWatchTrigger) (*metav1.ObjectMeta, error) {
|
||||||
return nil, ferror.MakeError(ferror.ErrorNotImplmented,
|
return nil, ferror.MakeError(ferror.ErrorNotImplmented, "watch update not implemented")
|
||||||
"watch update not implemented")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) WatchDelete(m *metav1.ObjectMeta) error {
|
func (c *Client) WatchDelete(m *metav1.ObjectMeta) error {
|
||||||
@@ -96,7 +93,7 @@ func (c *Client) WatchDelete(m *metav1.ObjectMeta) error {
|
|||||||
|
|
||||||
func (c *Client) WatchList(ns string) ([]fv1.KubernetesWatchTrigger, error) {
|
func (c *Client) WatchList(ns string) ([]fv1.KubernetesWatchTrigger, error) {
|
||||||
relativeUrl := fmt.Sprintf("watches?namespace=%v", ns)
|
relativeUrl := fmt.Sprintf("watches?namespace=%v", ns)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ func (c *Client) MessageQueueTriggerCreate(t *fv1.MessageQueueTrigger) (*metav1.
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("triggers/messagequeue"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("triggers/messagequeue", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,7 @@ func (c *Client) MessageQueueTriggerGet(m *metav1.ObjectMeta) (*fv1.MessageQueue
|
|||||||
relativeUrl := fmt.Sprintf("triggers/messagequeue/%v", m.Name)
|
relativeUrl := fmt.Sprintf("triggers/messagequeue/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -126,7 +124,7 @@ func (c *Client) MessageQueueTriggerList(mqType string, ns string) ([]fv1.Messag
|
|||||||
relativeUrl += fmt.Sprintf("?mqtype=%v&namespace=%v", mqType, ns)
|
relativeUrl += fmt.Sprintf("?mqtype=%v&namespace=%v", mqType, ns)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ func (c *Client) PackageCreate(f *fv1.Package) (*metav1.ObjectMeta, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("packages"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("packages", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,7 @@ func (c *Client) PackageGet(m *metav1.ObjectMeta) (*fv1.Package, error) {
|
|||||||
relativeUrl := fmt.Sprintf("packages/%v", m.Name)
|
relativeUrl := fmt.Sprintf("packages/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -121,7 +119,7 @@ func (c *Client) PackageDelete(m *metav1.ObjectMeta) error {
|
|||||||
|
|
||||||
func (c *Client) PackageList(pkgNamespace string) ([]fv1.Package, error) {
|
func (c *Client) PackageList(pkgNamespace string) ([]fv1.Package, error) {
|
||||||
relativeUrl := fmt.Sprintf("packages?namespace=%v", pkgNamespace)
|
relativeUrl := fmt.Sprintf("packages?namespace=%v", pkgNamespace)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,238 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2018 The Fission Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package client
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
|
||||||
"github.com/fission/fission/pkg/redis/build/gen"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (c *Client) RecorderCreate(r *fv1.Recorder) (*metav1.ObjectMeta, error) {
|
|
||||||
err := r.Validate()
|
|
||||||
if err != nil {
|
|
||||||
return nil, fv1.AggregateValidationErrors("Recorder", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
reqbody, err := json.Marshal(r)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := http.Post(c.url("recorders"), "application/json", bytes.NewReader(reqbody))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleCreateResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var m metav1.ObjectMeta
|
|
||||||
err = json.Unmarshal(body, &m)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &m, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecorderGet(m *metav1.ObjectMeta) (*fv1.Recorder, error) {
|
|
||||||
relativeUrl := fmt.Sprintf("recorders/%v", m.Name)
|
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var r fv1.Recorder
|
|
||||||
err = json.Unmarshal(body, &r)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &r, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecorderUpdate(recorder *fv1.Recorder) (*metav1.ObjectMeta, error) {
|
|
||||||
err := recorder.Validate()
|
|
||||||
if err != nil {
|
|
||||||
return nil, fv1.AggregateValidationErrors("Recorder", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
reqbody, err := json.Marshal(recorder)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
relativeUrl := fmt.Sprintf("recorders/%v", recorder.Metadata.Name)
|
|
||||||
|
|
||||||
resp, err := c.put(relativeUrl, "application/json", reqbody)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var m metav1.ObjectMeta
|
|
||||||
err = json.Unmarshal(body, &m)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &m, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecorderDelete(m *metav1.ObjectMeta) error {
|
|
||||||
relativeUrl := fmt.Sprintf("recorders/%v", m.Name)
|
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
|
||||||
return c.delete(relativeUrl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecorderList(ns string) ([]fv1.Recorder, error) {
|
|
||||||
relativeUrl := "recorders"
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
recorders := make([]fv1.Recorder, 0)
|
|
||||||
err = json.Unmarshal(body, &recorders)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return recorders, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Move to different file?
|
|
||||||
func (c *Client) RecordsByFunction(function string) ([]*redisCache.RecordedEntry, error) {
|
|
||||||
relativeUrl := fmt.Sprintf("records/function/%v", function)
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
records := make([]*redisCache.RecordedEntry, 0)
|
|
||||||
err = json.Unmarshal(body, &records)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return records, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecordsAll() ([]*redisCache.RecordedEntry, error) {
|
|
||||||
relativeUrl := "records"
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
records := make([]*redisCache.RecordedEntry, 0)
|
|
||||||
err = json.Unmarshal(body, &records)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return records, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecordsByTrigger(trigger string) ([]*redisCache.RecordedEntry, error) {
|
|
||||||
relativeUrl := fmt.Sprintf("records/trigger/%v", trigger)
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
records := make([]*redisCache.RecordedEntry, 0)
|
|
||||||
err = json.Unmarshal(body, &records)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return records, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) RecordsByTime(from string, to string) ([]*redisCache.RecordedEntry, error) {
|
|
||||||
relativeUrl := "records/time"
|
|
||||||
relativeUrl += fmt.Sprintf("?from=%v&to=%v", from, to)
|
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := c.handleResponse(resp)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
records := make([]*redisCache.RecordedEntry, 0)
|
|
||||||
err = json.Unmarshal(body, &records)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return records, nil
|
|
||||||
}
|
|
||||||
@@ -17,10 +17,8 @@ limitations under the License.
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ func (c *Client) TimeTriggerCreate(t *fv1.TimeTrigger) (*metav1.ObjectMeta, erro
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := http.Post(c.url("triggers/time"), "application/json", bytes.NewReader(reqbody))
|
resp, err := c.create("triggers/time", "application/json", reqbody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,7 @@ func (c *Client) TimeTriggerGet(m *metav1.ObjectMeta) (*fv1.TimeTrigger, error)
|
|||||||
relativeUrl := fmt.Sprintf("triggers/time/%v", m.Name)
|
relativeUrl := fmt.Sprintf("triggers/time/%v", m.Name)
|
||||||
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
relativeUrl += fmt.Sprintf("?namespace=%v", m.Namespace)
|
||||||
|
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -121,7 +119,7 @@ func (c *Client) TimeTriggerDelete(m *metav1.ObjectMeta) error {
|
|||||||
|
|
||||||
func (c *Client) TimeTriggerList(ns string) ([]fv1.TimeTrigger, error) {
|
func (c *Client) TimeTriggerList(ns string) ([]fv1.TimeTrigger, error) {
|
||||||
relativeUrl := fmt.Sprintf("triggers/time?namespace=%v", ns)
|
relativeUrl := fmt.Sprintf("triggers/time?namespace=%v", ns)
|
||||||
resp, err := http.Get(c.url(relativeUrl))
|
resp, err := c.get(relativeUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,25 +18,30 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/emicklei/go-restful"
|
"github.com/emicklei/go-restful"
|
||||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
restfulspec "github.com/emicklei/go-restful-openapi"
|
||||||
"github.com/go-openapi/spec"
|
"github.com/go-openapi/spec"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
restclient "k8s.io/client-go/rest"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/client-go/kubernetes"
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
|
"github.com/fission/fission/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RegisterFunctionRoute(ws *restful.WebService) {
|
func RegisterFunctionRoute(ws *restful.WebService) {
|
||||||
@@ -106,12 +111,6 @@ func RegisterFunctionRoute(ws *restful.WebService) {
|
|||||||
Returns(http.StatusOK, "Only HTTP status returned", nil))
|
Returns(http.StatusOK, "Only HTTP status returned", nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *API) getIstioServiceLabels(fnName string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"functionName": fnName,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) FunctionApiList(w http.ResponseWriter, r *http.Request) {
|
func (a *API) FunctionApiList(w http.ResponseWriter, r *http.Request) {
|
||||||
ns := a.extractQueryParamFromRequest(r, "namespace")
|
ns := a.extractQueryParamFromRequest(r, "namespace")
|
||||||
if len(ns) == 0 {
|
if len(ns) == 0 {
|
||||||
@@ -258,9 +257,12 @@ func (a *API) FunctionLogsApiPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
svcUrl, err := url.Parse(dbCnf.httpURL)
|
svcUrl, err := url.Parse(dbCnf.httpURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.logger.Error("failed parse url to establish proxy to database for function logs",
|
msg := "failed parse url to establish proxy to database for function logs"
|
||||||
|
a.logger.Error(msg,
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("database_url", dbCnf.httpURL))
|
zap.String("database_url", dbCnf.httpURL))
|
||||||
|
a.respondWithError(w, errors.Wrap(err, msg))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
// set up proxy server director
|
// set up proxy server director
|
||||||
director := func(req *http.Request) {
|
director := func(req *http.Request) {
|
||||||
@@ -269,6 +271,7 @@ func (a *API) FunctionLogsApiPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
req.URL.Scheme = svcUrl.Scheme
|
req.URL.Scheme = svcUrl.Scheme
|
||||||
req.URL.Host = svcUrl.Host
|
req.URL.Host = svcUrl.Host
|
||||||
req.URL.Path = svcUrl.Path
|
req.URL.Path = svcUrl.Path
|
||||||
|
req.Host = svcUrl.Host
|
||||||
// set up http basic auth for database authentication
|
// set up http basic auth for database authentication
|
||||||
req.SetBasicAuth(dbCnf.username, dbCnf.password)
|
req.SetBasicAuth(dbCnf.username, dbCnf.password)
|
||||||
}
|
}
|
||||||
@@ -282,27 +285,35 @@ func (a *API) FunctionLogsApiPost(w http.ResponseWriter, r *http.Request) {
|
|||||||
func (a *API) FunctionPodLogs(w http.ResponseWriter, r *http.Request) {
|
func (a *API) FunctionPodLogs(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
fnName := vars["function"]
|
fnName := vars["function"]
|
||||||
ns := vars["namespace"]
|
|
||||||
|
ns := a.extractQueryParamFromRequest(r, "namespace")
|
||||||
|
podNs := "fission-function"
|
||||||
|
|
||||||
if len(ns) == 0 {
|
if len(ns) == 0 {
|
||||||
ns = "fission-function"
|
ns = metav1.NamespaceDefault
|
||||||
|
} else if ns != metav1.NamespaceDefault {
|
||||||
|
// If the function namespace is "default", executor
|
||||||
|
// will create function pods under "fission-function".
|
||||||
|
// Otherwise, the function pod will be created under
|
||||||
|
// the same namespace of function.
|
||||||
|
podNs = ns
|
||||||
}
|
}
|
||||||
|
|
||||||
f, err := a.fissionClient.Functions(ns).Get(fnName)
|
f, err := a.fissionClient.Functions(ns).Get(fnName)
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
envName := f.Spec.Environment.Name
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.respondWithError(w, err)
|
a.respondWithError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get function Pods first
|
// Get function Pods first
|
||||||
selector := "functionName=" + fnName
|
selector := map[string]string{
|
||||||
podList, err := a.kubernetesClient.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: selector})
|
types.FUNCTION_UID: string(f.Metadata.UID),
|
||||||
|
types.ENVIRONMENT_NAME: f.Spec.Environment.Name,
|
||||||
|
types.ENVIRONMENT_NAMESPACE: f.Spec.Environment.Namespace,
|
||||||
|
}
|
||||||
|
podList, err := a.kubernetesClient.CoreV1().Pods(podNs).List(metav1.ListOptions{
|
||||||
|
LabelSelector: labels.Set(selector).AsSelector().String(),
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.respondWithError(w, err)
|
a.respondWithError(w, err)
|
||||||
return
|
return
|
||||||
@@ -311,31 +322,47 @@ func (a *API) FunctionPodLogs(w http.ResponseWriter, r *http.Request) {
|
|||||||
// Get the logs for last Pod executed
|
// Get the logs for last Pod executed
|
||||||
pods := podList.Items
|
pods := podList.Items
|
||||||
sort.Slice(pods, func(i, j int) bool {
|
sort.Slice(pods, func(i, j int) bool {
|
||||||
itime := pods[i].ObjectMeta.CreationTimestamp.Time
|
rv1, _ := strconv.ParseInt(pods[i].ObjectMeta.ResourceVersion, 10, 32)
|
||||||
jtime := pods[j].ObjectMeta.CreationTimestamp.Time
|
rv2, _ := strconv.ParseInt(pods[j].ObjectMeta.ResourceVersion, 10, 32)
|
||||||
return itime.After(jtime)
|
return rv1 > rv2
|
||||||
})
|
})
|
||||||
|
|
||||||
podLogOpts := apiv1.PodLogOptions{Container: envName} // Only the env container, not fetcher
|
if len(pods) <= 0 {
|
||||||
var podLogsReq *restclient.Request
|
a.respondWithError(w, errors.New("no active pods found"))
|
||||||
if len(pods) > 0 {
|
|
||||||
podLogsReq = a.kubernetesClient.CoreV1().Pods(ns).GetLogs(pods[0].ObjectMeta.Name, &podLogOpts)
|
|
||||||
} else {
|
|
||||||
a.respondWithError(w, errors.New("No active pods found"))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
podLogs, err := podLogsReq.Stream()
|
// get the pod with highest resource version
|
||||||
|
err = getContainerLog(a.kubernetesClient, w, f, &pods[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.respondWithError(w, err)
|
a.respondWithError(w, errors.Wrapf(err, "error getting container logs"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer podLogs.Close()
|
}
|
||||||
|
|
||||||
_, err = io.Copy(w, podLogs)
|
func getContainerLog(kubernetesClient *kubernetes.Clientset, w http.ResponseWriter, fn *fv1.Function, pod *apiv1.Pod) error {
|
||||||
if err != nil {
|
seq := strings.Repeat("=", 35)
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
for _, container := range pod.Spec.Containers {
|
||||||
}
|
podLogOpts := apiv1.PodLogOptions{Container: container.Name} // Only the env container, not fetcher
|
||||||
return
|
podLogsReq := kubernetesClient.CoreV1().Pods(pod.Namespace).GetLogs(pod.ObjectMeta.Name, &podLogOpts)
|
||||||
|
|
||||||
|
podLogs, err := podLogsReq.Stream()
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "error streaming pod log")
|
||||||
|
}
|
||||||
|
|
||||||
|
msg := fmt.Sprintf("\n%v\nFunction: %v\nEnvironment: %v\nNamespace: %v\nPod: %v\nContainer: %v\nNode: %v\n%v\n", seq,
|
||||||
|
fn.Metadata.Name, fn.Spec.Environment.Name, pod.Namespace, pod.Name, container.Name, pod.Spec.NodeName, seq)
|
||||||
|
w.Write([]byte(msg))
|
||||||
|
|
||||||
|
_, err = io.Copy(w, podLogs)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "error copying pod log")
|
||||||
|
}
|
||||||
|
|
||||||
|
podLogs.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2018 The Fission Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package controller
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (a *API) RecorderApiList(w http.ResponseWriter, r *http.Request) {
|
|
||||||
recorders, err := a.fissionClient.Recorders(metav1.NamespaceAll).List(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err := json.Marshal(recorders.Items)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecorderApiCreate(w http.ResponseWriter, r *http.Request) {
|
|
||||||
body, err := ioutil.ReadAll(r.Body)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var recorder fv1.Recorder
|
|
||||||
err = json.Unmarshal(body, &recorder)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
tnew, err := a.fissionClient.Recorders(recorder.Metadata.Namespace).Create(&recorder)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := json.Marshal(tnew.Metadata)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
w.WriteHeader(http.StatusCreated)
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecorderApiGet(w http.ResponseWriter, r *http.Request) {
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
name := vars["recorder"]
|
|
||||||
ns := a.extractQueryParamFromRequest(r, "namespace")
|
|
||||||
if len(ns) == 0 {
|
|
||||||
ns = metav1.NamespaceDefault
|
|
||||||
}
|
|
||||||
|
|
||||||
recorder, err := a.fissionClient.Recorders(ns).Get(name)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err := json.Marshal(recorder)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecorderApiUpdate(w http.ResponseWriter, r *http.Request) {
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
name := vars["recorder"]
|
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(r.Body)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var recorder fv1.Recorder
|
|
||||||
err = json.Unmarshal(body, &recorder)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if name != recorder.Metadata.Name {
|
|
||||||
err = ferror.MakeError(ferror.ErrorInvalidArgument, "Recorder name doesn't match URL")
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
rnew, err := a.fissionClient.Recorders(recorder.Metadata.Namespace).Update(&recorder)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := json.Marshal(rnew.Metadata)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecorderApiDelete(w http.ResponseWriter, r *http.Request) {
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
name := vars["recorder"]
|
|
||||||
ns := a.extractQueryParamFromRequest(r, "namespace")
|
|
||||||
if len(ns) == 0 {
|
|
||||||
ns = metav1.NamespaceDefault
|
|
||||||
}
|
|
||||||
|
|
||||||
err := a.fissionClient.Recorders(ns).Delete(name, &metav1.DeleteOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, []byte(""))
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2018 The Fission Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package controller
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
|
|
||||||
"github.com/fission/fission/pkg/redis"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (a *API) RecordsApiListAll(w http.ResponseWriter, r *http.Request) {
|
|
||||||
resp, err := redis.RecordsListAll(a.logger.Named("redis"))
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecordsApiFilterByFunction(w http.ResponseWriter, r *http.Request) {
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
query := vars["function"]
|
|
||||||
|
|
||||||
recorders, err := a.fissionClient.Recorders(metav1.NamespaceAll).List(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
triggers, err := a.fissionClient.HTTPTriggers(metav1.NamespaceAll).List(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := redis.RecordsFilterByFunction(a.logger.Named("redis"), query, recorders, triggers)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecordsApiFilterByTrigger(w http.ResponseWriter, r *http.Request) {
|
|
||||||
vars := mux.Vars(r)
|
|
||||||
query := vars["trigger"]
|
|
||||||
|
|
||||||
recorders, err := a.fissionClient.Recorders(metav1.NamespaceAll).List(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
triggers, err := a.fissionClient.HTTPTriggers(metav1.NamespaceAll).List(metav1.ListOptions{})
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := redis.RecordsFilterByTrigger(a.logger.Named("redis"), query, recorders, triggers)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) RecordsApiFilterByTime(w http.ResponseWriter, r *http.Request) {
|
|
||||||
from := r.FormValue("from")
|
|
||||||
to := r.FormValue("to")
|
|
||||||
|
|
||||||
resp, err := redis.RecordsFilterByTime(a.logger.Named("redis"), from, to)
|
|
||||||
if err != nil {
|
|
||||||
a.respondWithError(w, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
a.respondWithSuccess(w, resp)
|
|
||||||
}
|
|
||||||
@@ -69,6 +69,7 @@ func (api *API) StorageServiceProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
req.URL.Scheme = ssUrl.Scheme
|
req.URL.Scheme = ssUrl.Scheme
|
||||||
req.URL.Host = ssUrl.Host
|
req.URL.Host = ssUrl.Host
|
||||||
req.URL.Path = "/v1/archive"
|
req.URL.Path = "/v1/archive"
|
||||||
|
req.Host = ssUrl.Host
|
||||||
}
|
}
|
||||||
proxy := &httputil.ReverseProxy{
|
proxy := &httputil.ReverseProxy{
|
||||||
Director: director,
|
Director: director,
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ func (api *API) WorkflowApiserverProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
req.URL.Scheme = ssUrl.Scheme
|
req.URL.Scheme = ssUrl.Scheme
|
||||||
req.URL.Host = ssUrl.Host
|
req.URL.Host = ssUrl.Host
|
||||||
req.URL.Path = path
|
req.URL.Path = path
|
||||||
|
req.Host = ssUrl.Host
|
||||||
}
|
}
|
||||||
proxy := &httputil.ReverseProxy{
|
proxy := &httputil.ReverseProxy{
|
||||||
Director: director,
|
Director: director,
|
||||||
|
|||||||
@@ -155,13 +155,6 @@ func configureClient(config *rest.Config) {
|
|||||||
&metav1.ListOptions{},
|
&metav1.ListOptions{},
|
||||||
&metav1.DeleteOptions{},
|
&metav1.DeleteOptions{},
|
||||||
)
|
)
|
||||||
scheme.AddKnownTypes(
|
|
||||||
groupversion,
|
|
||||||
&fv1.Recorder{},
|
|
||||||
&fv1.RecorderList{},
|
|
||||||
&metav1.ListOptions{},
|
|
||||||
&metav1.DeleteOptions{},
|
|
||||||
)
|
|
||||||
scheme.AddKnownTypes(
|
scheme.AddKnownTypes(
|
||||||
groupversion,
|
groupversion,
|
||||||
&fv1.CanaryConfig{},
|
&fv1.CanaryConfig{},
|
||||||
@@ -224,9 +217,6 @@ func (fc *FissionClient) TimeTriggers(ns string) TimeTriggerInterface {
|
|||||||
func (fc *FissionClient) MessageQueueTriggers(ns string) MessageQueueTriggerInterface {
|
func (fc *FissionClient) MessageQueueTriggers(ns string) MessageQueueTriggerInterface {
|
||||||
return MakeMessageQueueTriggerInterface(fc.crdClient, ns)
|
return MakeMessageQueueTriggerInterface(fc.crdClient, ns)
|
||||||
}
|
}
|
||||||
func (fc *FissionClient) Recorders(ns string) RecorderInterface {
|
|
||||||
return MakeRecorderInterface(fc.crdClient, ns)
|
|
||||||
}
|
|
||||||
func (fc *FissionClient) Packages(ns string) PackageInterface {
|
func (fc *FissionClient) Packages(ns string) PackageInterface {
|
||||||
return MakePackageInterface(fc.crdClient, ns)
|
return MakePackageInterface(fc.crdClient, ns)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,22 +157,6 @@ func EnsureFissionCRDs(logger *zap.Logger, clientset *apiextensionsclient.Client
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Recorders
|
|
||||||
{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: "recorders.fission.io",
|
|
||||||
},
|
|
||||||
Spec: apiextensionsv1beta1.CustomResourceDefinitionSpec{
|
|
||||||
Group: crdGroupName,
|
|
||||||
Version: crdVersion,
|
|
||||||
Scope: apiextensionsv1beta1.NamespaceScoped,
|
|
||||||
Names: apiextensionsv1beta1.CustomResourceDefinitionNames{
|
|
||||||
Kind: "Recorder",
|
|
||||||
Plural: "recorders",
|
|
||||||
Singular: "recorder",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// Packages: archives containing source or binaries for one or more functions
|
// Packages: archives containing source or binaries for one or more functions
|
||||||
{
|
{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2016 The Fission Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package crd
|
|
||||||
|
|
||||||
import (
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
|
||||||
"k8s.io/client-go/kubernetes/scheme"
|
|
||||||
"k8s.io/client-go/rest"
|
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
RecorderInterface interface {
|
|
||||||
Create(*fv1.Recorder) (*fv1.Recorder, error)
|
|
||||||
Get(name string) (*fv1.Recorder, error)
|
|
||||||
Update(*fv1.Recorder) (*fv1.Recorder, error)
|
|
||||||
Delete(name string, opts *metav1.DeleteOptions) error
|
|
||||||
List(opts metav1.ListOptions) (*fv1.RecorderList, error)
|
|
||||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
recorderClient struct {
|
|
||||||
client *rest.RESTClient
|
|
||||||
namespace string
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func MakeRecorderInterface(crdClient *rest.RESTClient, namespace string) RecorderInterface {
|
|
||||||
return &recorderClient{
|
|
||||||
client: crdClient,
|
|
||||||
namespace: namespace,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) Create(r *fv1.Recorder) (*fv1.Recorder, error) {
|
|
||||||
var result fv1.Recorder
|
|
||||||
err := rc.client.Post().
|
|
||||||
Resource("recorders").
|
|
||||||
Namespace("default").
|
|
||||||
Body(r).
|
|
||||||
Do().Into(&result)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) Get(name string) (*fv1.Recorder, error) {
|
|
||||||
var result fv1.Recorder
|
|
||||||
err := rc.client.Get().
|
|
||||||
Resource("recorders").
|
|
||||||
Namespace(rc.namespace).
|
|
||||||
Name(name).
|
|
||||||
Do().Into(&result)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) Update(r *fv1.Recorder) (*fv1.Recorder, error) {
|
|
||||||
var result fv1.Recorder
|
|
||||||
err := rc.client.Put().
|
|
||||||
Resource("recorders").
|
|
||||||
Namespace(rc.namespace).
|
|
||||||
Name(r.Metadata.Name).
|
|
||||||
Body(r).
|
|
||||||
Do().Into(&result)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) Delete(name string, opts *metav1.DeleteOptions) error {
|
|
||||||
return rc.client.Delete().
|
|
||||||
Namespace(rc.namespace).
|
|
||||||
Resource("recorders").
|
|
||||||
Name(name).
|
|
||||||
Body(opts).
|
|
||||||
Do().
|
|
||||||
Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) List(opts metav1.ListOptions) (*fv1.RecorderList, error) {
|
|
||||||
var result fv1.RecorderList
|
|
||||||
err := rc.client.Get().
|
|
||||||
Namespace(rc.namespace).
|
|
||||||
Resource("recorders").
|
|
||||||
VersionedParams(&opts, scheme.ParameterCodec).
|
|
||||||
Do().
|
|
||||||
Into(&result)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (rc *recorderClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
|
||||||
return rc.client.Get().
|
|
||||||
Prefix("watch").
|
|
||||||
Namespace(rc.namespace).
|
|
||||||
Resource("recorders").
|
|
||||||
VersionedParams(&opts, scheme.ParameterCodec).
|
|
||||||
Watch()
|
|
||||||
}
|
|
||||||
+77
-30
@@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package executor
|
package executor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -25,11 +24,16 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/hashicorp/go-multierror"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"go.opencensus.io/plugin/ochttp"
|
"go.opencensus.io/plugin/ochttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
k8serrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
|
"github.com/fission/fission/pkg/executor/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (executor *Executor) getServiceForFunctionApi(w http.ResponseWriter, r *http.Request) {
|
func (executor *Executor) getServiceForFunctionApi(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -47,7 +51,17 @@ func (executor *Executor) getServiceForFunctionApi(w http.ResponseWriter, r *htt
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
serviceName, err := executor.getServiceForFunction(r.Context(), &m)
|
fn, err := executor.fissionClient.Functions(m.Namespace).Get(m.Name)
|
||||||
|
if err != nil {
|
||||||
|
if k8serrors.IsNotFound(err) {
|
||||||
|
http.Error(w, "Failed to find function", http.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
http.Error(w, "Failed to get function", http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceName, err := executor.getServiceForFunction(fn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code, msg := ferror.GetHTTPError(err)
|
code, msg := ferror.GetHTTPError(err)
|
||||||
executor.logger.Error("error getting service for function",
|
executor.logger.Error("error getting service for function",
|
||||||
@@ -70,30 +84,35 @@ func (executor *Executor) getServiceForFunctionApi(w http.ResponseWriter, r *htt
|
|||||||
// stale addresses are not returned to the router.
|
// stale addresses are not returned to the router.
|
||||||
// To make it optimal, plan is to add an eager cache invalidator function that watches for pod deletion events and
|
// To make it optimal, plan is to add an eager cache invalidator function that watches for pod deletion events and
|
||||||
// invalidates the cache entry if the pod address was cached.
|
// invalidates the cache entry if the pod address was cached.
|
||||||
func (executor *Executor) getServiceForFunction(ctx context.Context, m *metav1.ObjectMeta) (string, error) {
|
func (executor *Executor) getServiceForFunction(fn *fv1.Function) (string, error) {
|
||||||
// Check function -> svc cache
|
// Check function -> svc cache
|
||||||
executor.logger.Debug("checking for cached function service",
|
executor.logger.Debug("checking for cached function service",
|
||||||
zap.String("function_name", m.Name),
|
zap.String("function_name", fn.Metadata.Name),
|
||||||
zap.String("function_namespace", m.Namespace))
|
zap.String("function_namespace", fn.Metadata.Namespace))
|
||||||
|
|
||||||
fsvc, err := executor.fsCache.GetByFunction(m)
|
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
||||||
|
et, exists := executor.executorTypes[t]
|
||||||
|
if !exists {
|
||||||
|
return "", errors.Errorf("Unknown executor type '%v'", t)
|
||||||
|
}
|
||||||
|
|
||||||
|
fsvc, err := et.GetFuncSvcFromCache(fn)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if executor.isValidAddress(fsvc) {
|
if et.IsValid(fsvc) {
|
||||||
// Cached, return svc address
|
// Cached, return svc address
|
||||||
return fsvc.Address, nil
|
return fsvc.Address, nil
|
||||||
} else {
|
} else {
|
||||||
executor.logger.Debug("deleting cache entry for invalid address",
|
executor.logger.Debug("deleting cache entry for invalid address",
|
||||||
zap.String("function_name", m.Name),
|
zap.String("function_name", fn.Metadata.Name),
|
||||||
zap.String("function_namespace", m.Namespace),
|
zap.String("function_namespace", fn.Metadata.Namespace),
|
||||||
zap.String("address", fsvc.Address))
|
zap.String("address", fsvc.Address))
|
||||||
executor.fsCache.DeleteEntry(fsvc)
|
et.DeleteFuncSvcFromCache(fsvc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
respChan := make(chan *createFuncServiceResponse)
|
respChan := make(chan *createFuncServiceResponse)
|
||||||
executor.requestChan <- &createFuncServiceRequest{
|
executor.requestChan <- &createFuncServiceRequest{
|
||||||
ctx: ctx,
|
function: fn,
|
||||||
funcMeta: m,
|
|
||||||
respChan: respChan,
|
respChan: respChan,
|
||||||
}
|
}
|
||||||
resp := <-respChan
|
resp := <-respChan
|
||||||
@@ -104,25 +123,57 @@ func (executor *Executor) getServiceForFunction(ctx context.Context, m *metav1.O
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find funcSvc and update its atime
|
// find funcSvc and update its atime
|
||||||
|
// TODO: Deprecated tapService
|
||||||
func (executor *Executor) tapService(w http.ResponseWriter, r *http.Request) {
|
func (executor *Executor) tapService(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// only for upgrade compatibility
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
|
// find funcSvc and update its atime
|
||||||
|
func (executor *Executor) tapServices(w http.ResponseWriter, r *http.Request) {
|
||||||
body, err := ioutil.ReadAll(r.Body)
|
body, err := ioutil.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
executor.logger.Error("failed to read tap service request", zap.Error(err))
|
executor.logger.Error("failed to read tap service request", zap.Error(err))
|
||||||
http.Error(w, "Failed to read request", http.StatusInternalServerError)
|
http.Error(w, "Failed to read request", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
svcName := string(body)
|
|
||||||
svcHost := strings.TrimPrefix(svcName, "http://")
|
|
||||||
|
|
||||||
err = executor.fsCache.TouchByAddress(svcHost)
|
tapSvcReqs := []client.TapServiceRequest{}
|
||||||
|
err = json.Unmarshal(body, &tapSvcReqs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
executor.logger.Error("error tapping function service",
|
executor.logger.Error("failed to decode tap service request",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("service", svcName),
|
zap.String("request-payload", string(body)))
|
||||||
zap.String("host", svcHost))
|
http.Error(w, "Failed to decode tap service request", http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
errs := &multierror.Error{}
|
||||||
|
for _, req := range tapSvcReqs {
|
||||||
|
svcHost := strings.TrimPrefix(req.ServiceUrl, "http://")
|
||||||
|
|
||||||
|
et, exists := executor.executorTypes[req.FnExecutorType]
|
||||||
|
if !exists {
|
||||||
|
errs = multierror.Append(errs,
|
||||||
|
errors.Errorf("error tapping service due to unknown executor type '%v' found",
|
||||||
|
req.FnExecutorType))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
err = et.TapService(svcHost)
|
||||||
|
if err != nil {
|
||||||
|
errs = multierror.Append(errs,
|
||||||
|
errors.Wrapf(err, "'%v' failed to tap function '%v' in '%v' with service url '%v'",
|
||||||
|
req.FnMetadata.Name, req.FnMetadata.Namespace, req.ServiceUrl, req.FnExecutorType))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if errs.ErrorOrNil() != nil {
|
||||||
|
executor.logger.Error("error tapping function service", zap.Error(errs))
|
||||||
http.Error(w, "Not found", http.StatusNotFound)
|
http.Error(w, "Not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,24 +181,20 @@ func (executor *Executor) healthHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (executor *Executor) Serve(port int) {
|
func (executor *Executor) GetHandler() http.Handler {
|
||||||
executor.logger.Info("starting executor", zap.Int("port", port))
|
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
defer cancel()
|
|
||||||
executor.ndm.Run(ctx)
|
|
||||||
executor.gpm.Run(ctx)
|
|
||||||
executor.cms.Run(ctx)
|
|
||||||
|
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/v2/getServiceForFunction", executor.getServiceForFunctionApi).Methods("POST")
|
r.HandleFunc("/v2/getServiceForFunction", executor.getServiceForFunctionApi).Methods("POST")
|
||||||
r.HandleFunc("/v2/tapService", executor.tapService).Methods("POST")
|
r.HandleFunc("/v2/tapService", executor.tapService).Methods("POST") // for backward compatibility
|
||||||
|
r.HandleFunc("/v2/tapServices", executor.tapServices).Methods("POST")
|
||||||
r.HandleFunc("/healthz", executor.healthHandler).Methods("GET")
|
r.HandleFunc("/healthz", executor.healthHandler).Methods("GET")
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func (executor *Executor) Serve(port int) {
|
||||||
|
executor.logger.Info("starting executor API", zap.Int("port", port))
|
||||||
address := fmt.Sprintf(":%v", port)
|
address := fmt.Sprintf(":%v", port)
|
||||||
|
|
||||||
err := http.ListenAndServe(address, &ochttp.Handler{
|
err := http.ListenAndServe(address, &ochttp.Handler{
|
||||||
Handler: r,
|
Handler: executor.GetHandler(),
|
||||||
})
|
})
|
||||||
executor.logger.Fatal("done listening", zap.Error(err))
|
executor.logger.Fatal("done listening", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,23 +32,31 @@ import (
|
|||||||
"golang.org/x/net/context/ctxhttp"
|
"golang.org/x/net/context/ctxhttp"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
|
||||||
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
ferror "github.com/fission/fission/pkg/error"
|
ferror "github.com/fission/fission/pkg/error"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type (
|
||||||
logger *zap.Logger
|
Client struct {
|
||||||
executorUrl string
|
logger *zap.Logger
|
||||||
tappedByUrl map[string]bool
|
executorUrl string
|
||||||
requestChan chan string
|
tappedByUrl map[string]TapServiceRequest
|
||||||
httpClient *http.Client
|
requestChan chan TapServiceRequest
|
||||||
}
|
httpClient *http.Client
|
||||||
|
}
|
||||||
|
TapServiceRequest struct {
|
||||||
|
FnMetadata metav1.ObjectMeta
|
||||||
|
FnExecutorType fv1.ExecutorType
|
||||||
|
ServiceUrl string
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
func MakeClient(logger *zap.Logger, executorUrl string) *Client {
|
func MakeClient(logger *zap.Logger, executorUrl string) *Client {
|
||||||
c := &Client{
|
c := &Client{
|
||||||
logger: logger.Named("executor_client"),
|
logger: logger.Named("executor_client"),
|
||||||
executorUrl: strings.TrimSuffix(executorUrl, "/"),
|
executorUrl: strings.TrimSuffix(executorUrl, "/"),
|
||||||
tappedByUrl: make(map[string]bool),
|
tappedByUrl: make(map[string]TapServiceRequest),
|
||||||
requestChan: make(chan string),
|
requestChan: make(chan TapServiceRequest, 100),
|
||||||
httpClient: &http.Client{
|
httpClient: &http.Client{
|
||||||
Transport: &ochttp.Transport{},
|
Transport: &ochttp.Transport{},
|
||||||
},
|
},
|
||||||
@@ -87,40 +95,64 @@ func (c *Client) service() {
|
|||||||
ticker := time.NewTicker(time.Second * 5)
|
ticker := time.NewTicker(time.Second * 5)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case serviceUrl := <-c.requestChan:
|
case svcReq := <-c.requestChan:
|
||||||
c.tappedByUrl[serviceUrl] = true
|
c.tappedByUrl[svcReq.ServiceUrl] = svcReq
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
urls := c.tappedByUrl
|
if len(c.tappedByUrl) == 0 {
|
||||||
c.tappedByUrl = make(map[string]bool)
|
continue
|
||||||
if len(urls) > 0 {
|
|
||||||
go func() {
|
|
||||||
for u := range urls {
|
|
||||||
err := c._tapService(u)
|
|
||||||
if err != nil {
|
|
||||||
c.logger.Error("error tapping function service address", zap.Error(err), zap.String("address", u))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
c.logger.Debug("tapped services in batch", zap.Int("service_count", len(urls)))
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
urls := c.tappedByUrl
|
||||||
|
c.tappedByUrl = make(map[string]TapServiceRequest)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
svcReqs := []TapServiceRequest{}
|
||||||
|
for _, req := range urls {
|
||||||
|
svcReqs = append(svcReqs, req)
|
||||||
|
}
|
||||||
|
c.logger.Debug("tapped services in batch", zap.Int("service_count", len(urls)))
|
||||||
|
|
||||||
|
err := c._tapService(svcReqs)
|
||||||
|
if err != nil {
|
||||||
|
c.logger.Error("error tapping function service address", zap.Error(err))
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) TapService(serviceUrl *url.URL) {
|
func (c *Client) TapService(fnMeta metav1.ObjectMeta, executorType fv1.ExecutorType, serviceUrl *url.URL) {
|
||||||
c.requestChan <- serviceUrl.String()
|
c.requestChan <- TapServiceRequest{
|
||||||
|
FnMetadata: metav1.ObjectMeta{
|
||||||
|
Name: fnMeta.Name,
|
||||||
|
Namespace: fnMeta.Namespace,
|
||||||
|
ResourceVersion: fnMeta.ResourceVersion,
|
||||||
|
UID: fnMeta.UID,
|
||||||
|
},
|
||||||
|
FnExecutorType: executorType,
|
||||||
|
// service url is for executor to know which
|
||||||
|
// pod/service is currently used to serve user function.
|
||||||
|
ServiceUrl: serviceUrl.String(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) _tapService(serviceUrlStr string) error {
|
func (c *Client) _tapService(tapSvcReqs []TapServiceRequest) error {
|
||||||
executorUrl := c.executorUrl + "/v2/tapService"
|
executorUrl := c.executorUrl + "/v2/tapServices"
|
||||||
|
|
||||||
resp, err := http.Post(executorUrl, "application/octet-stream", bytes.NewReader([]byte(serviceUrlStr)))
|
body, err := json.Marshal(tapSvcReqs)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := http.Post(executorUrl, "application/json", bytes.NewReader(body))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
if resp.StatusCode != 200 {
|
||||||
return ferror.MakeErrorFromHTTP(resp)
|
return ferror.MakeErrorFromHTTP(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/pkg/errors"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
@@ -29,8 +30,7 @@ import (
|
|||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
"github.com/fission/fission/pkg/crd"
|
"github.com/fission/fission/pkg/crd"
|
||||||
nd "github.com/fission/fission/pkg/executor/newdeploy"
|
"github.com/fission/fission/pkg/executor/executortype"
|
||||||
gpm "github.com/fission/fission/pkg/executor/poolmgr"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -46,10 +46,10 @@ type (
|
|||||||
|
|
||||||
//MakeConfigSecretController makes a controller for configmaps and secrets which changes related functions
|
//MakeConfigSecretController makes a controller for configmaps and secrets which changes related functions
|
||||||
func MakeConfigSecretController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
func MakeConfigSecretController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
||||||
kubernetesClient *kubernetes.Clientset, ndm *nd.NewDeploy, gpm *gpm.GenericPoolManager) *ConfigSecretController {
|
kubernetesClient *kubernetes.Clientset, types map[fv1.ExecutorType]executortype.ExecutorType) *ConfigSecretController {
|
||||||
logger.Debug("Creating ConfigMap & Secret Controller")
|
logger.Debug("Creating ConfigMap & Secret Controller")
|
||||||
_, cmcontroller := initConfigmapController(logger, fissionClient, kubernetesClient, ndm, gpm)
|
_, cmcontroller := initConfigmapController(logger, fissionClient, kubernetesClient, types)
|
||||||
_, scontroller := initSecretController(logger, fissionClient, kubernetesClient, ndm, gpm)
|
_, scontroller := initSecretController(logger, fissionClient, kubernetesClient, types)
|
||||||
cmsController := &ConfigSecretController{
|
cmsController := &ConfigSecretController{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
configmapController: cmcontroller,
|
configmapController: cmcontroller,
|
||||||
@@ -66,7 +66,7 @@ func (csController *ConfigSecretController) Run(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initConfigmapController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
func initConfigmapController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
||||||
kubernetesClient *kubernetes.Clientset, ndm *nd.NewDeploy, gpm *gpm.GenericPoolManager) (cache.Store, cache.Controller) {
|
kubernetesClient *kubernetes.Clientset, types map[fv1.ExecutorType]executortype.ExecutorType) (cache.Store, cache.Controller) {
|
||||||
resyncPeriod := 30 * time.Second
|
resyncPeriod := 30 * time.Second
|
||||||
listWatch := cache.NewListWatchFromClient(kubernetesClient.CoreV1().RESTClient(), "configmaps", metav1.NamespaceAll, fields.Everything())
|
listWatch := cache.NewListWatchFromClient(kubernetesClient.CoreV1().RESTClient(), "configmaps", metav1.NamespaceAll, fields.Everything())
|
||||||
store, controller := cache.NewInformer(listWatch, &apiv1.ConfigMap{}, resyncPeriod, cache.ResourceEventHandlerFuncs{
|
store, controller := cache.NewInformer(listWatch, &apiv1.ConfigMap{}, resyncPeriod, cache.ResourceEventHandlerFuncs{
|
||||||
@@ -81,12 +81,11 @@ func initConfigmapController(logger *zap.Logger, fissionClient *crd.FissionClien
|
|||||||
zap.String("configmap_name", newCm.ObjectMeta.Name),
|
zap.String("configmap_name", newCm.ObjectMeta.Name),
|
||||||
zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
||||||
}
|
}
|
||||||
|
|
||||||
funcs, err := getConfigmapRelatedFuncs(logger, &newCm.ObjectMeta, fissionClient)
|
funcs, err := getConfigmapRelatedFuncs(logger, &newCm.ObjectMeta, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Failed to get functions related to secret", zap.String("secret_name", newCm.ObjectMeta.Name), zap.String("secret_namespace", newCm.ObjectMeta.Namespace))
|
logger.Error("Failed to get functions related to configmap", zap.String("configmap_name", newCm.ObjectMeta.Name), zap.String("configmap_namespace", newCm.ObjectMeta.Namespace))
|
||||||
}
|
}
|
||||||
recyclePods(logger, funcs, ndm, gpm)
|
refreshPods(logger, funcs, types)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -112,7 +111,7 @@ func getConfigmapRelatedFuncs(logger *zap.Logger, m *metav1.ObjectMeta, fissionC
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initSecretController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
func initSecretController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
||||||
kubernetesClient *kubernetes.Clientset, ndm *nd.NewDeploy, gpm *gpm.GenericPoolManager) (cache.Store, cache.Controller) {
|
kubernetesClient *kubernetes.Clientset, types map[fv1.ExecutorType]executortype.ExecutorType) (cache.Store, cache.Controller) {
|
||||||
resyncPeriod := 30 * time.Second
|
resyncPeriod := 30 * time.Second
|
||||||
listWatch := cache.NewListWatchFromClient(kubernetesClient.CoreV1().RESTClient(), "secrets", metav1.NamespaceAll, fields.Everything())
|
listWatch := cache.NewListWatchFromClient(kubernetesClient.CoreV1().RESTClient(), "secrets", metav1.NamespaceAll, fields.Everything())
|
||||||
store, controller := cache.NewInformer(listWatch, &apiv1.Secret{}, resyncPeriod, cache.ResourceEventHandlerFuncs{
|
store, controller := cache.NewInformer(listWatch, &apiv1.Secret{}, resyncPeriod, cache.ResourceEventHandlerFuncs{
|
||||||
@@ -128,14 +127,12 @@ func initSecretController(logger *zap.Logger, fissionClient *crd.FissionClient,
|
|||||||
zap.String("configmap_namespace", newS.ObjectMeta.Namespace))
|
zap.String("configmap_namespace", newS.ObjectMeta.Namespace))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
funcs, err := getSecretRelatedFuncs(logger, &newS.ObjectMeta, fissionClient)
|
funcs, err := getSecretRelatedFuncs(logger, &newS.ObjectMeta, fissionClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Failed to get functions related to secret", zap.String("secret_name", newS.ObjectMeta.Name), zap.String("secret_namespace", newS.ObjectMeta.Namespace))
|
logger.Error("Failed to get functions related to secret", zap.String("secret_name", newS.ObjectMeta.Name), zap.String("secret_namespace", newS.ObjectMeta.Namespace))
|
||||||
}
|
}
|
||||||
recyclePods(logger, funcs, ndm, gpm)
|
refreshPods(logger, funcs, types)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return store, controller
|
return store, controller
|
||||||
@@ -160,19 +157,19 @@ func getSecretRelatedFuncs(logger *zap.Logger, m *metav1.ObjectMeta, fissionClie
|
|||||||
return relatedFunctions, nil
|
return relatedFunctions, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func recyclePods(logger *zap.Logger, funcs []fv1.Function, ndm *nd.NewDeploy, gpm *gpm.GenericPoolManager) {
|
func refreshPods(logger *zap.Logger, funcs []fv1.Function, types map[fv1.ExecutorType]executortype.ExecutorType) {
|
||||||
for _, f := range funcs {
|
for _, f := range funcs {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
switch f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType {
|
et, exists := types[f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType]
|
||||||
case fv1.ExecutorTypeNewdeploy:
|
if exists {
|
||||||
err = ndm.RefreshFuncPods(logger, f)
|
err = et.RefreshFuncPods(logger, f)
|
||||||
case fv1.ExecutorTypePoolmgr:
|
} else {
|
||||||
err = gpm.RefreshFuncPods(logger, f)
|
err = errors.Errorf("Unknown executor type '%v'", f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("Failed to recycle pods for function after configmap changed",
|
logger.Error("Failed to recycle pods for function after configmap/secret changed",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.Any("function", f))
|
zap.Any("function", f))
|
||||||
}
|
}
|
||||||
|
|||||||
+97
-70
@@ -20,6 +20,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -28,15 +30,16 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
|
|
||||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||||
"github.com/fission/fission/pkg/crd"
|
"github.com/fission/fission/pkg/crd"
|
||||||
"github.com/fission/fission/pkg/executor/cms"
|
"github.com/fission/fission/pkg/executor/cms"
|
||||||
|
"github.com/fission/fission/pkg/executor/executortype"
|
||||||
|
"github.com/fission/fission/pkg/executor/executortype/newdeploy"
|
||||||
|
"github.com/fission/fission/pkg/executor/executortype/poolmgr"
|
||||||
"github.com/fission/fission/pkg/executor/fscache"
|
"github.com/fission/fission/pkg/executor/fscache"
|
||||||
"github.com/fission/fission/pkg/executor/newdeploy"
|
|
||||||
"github.com/fission/fission/pkg/executor/poolmgr"
|
|
||||||
"github.com/fission/fission/pkg/executor/reaper"
|
"github.com/fission/fission/pkg/executor/reaper"
|
||||||
|
"github.com/fission/fission/pkg/executor/util"
|
||||||
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
fetcherConfig "github.com/fission/fission/pkg/fetcher/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -44,19 +47,16 @@ type (
|
|||||||
Executor struct {
|
Executor struct {
|
||||||
logger *zap.Logger
|
logger *zap.Logger
|
||||||
|
|
||||||
gpm *poolmgr.GenericPoolManager
|
executorTypes map[fv1.ExecutorType]executortype.ExecutorType
|
||||||
ndm *newdeploy.NewDeploy
|
cms *cms.ConfigSecretController
|
||||||
cms *cms.ConfigSecretController
|
|
||||||
|
|
||||||
fissionClient *crd.FissionClient
|
fissionClient *crd.FissionClient
|
||||||
fsCache *fscache.FunctionServiceCache
|
|
||||||
|
|
||||||
requestChan chan *createFuncServiceRequest
|
requestChan chan *createFuncServiceRequest
|
||||||
fsCreateWg map[string]*sync.WaitGroup
|
fsCreateWg map[string]*sync.WaitGroup
|
||||||
}
|
}
|
||||||
createFuncServiceRequest struct {
|
createFuncServiceRequest struct {
|
||||||
ctx context.Context
|
function *fv1.Function
|
||||||
funcMeta *metav1.ObjectMeta
|
|
||||||
respChan chan *createFuncServiceResponse
|
respChan chan *createFuncServiceResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,21 +66,26 @@ type (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func MakeExecutor(logger *zap.Logger, gpm *poolmgr.GenericPoolManager, ndm *newdeploy.NewDeploy, cms *cms.ConfigSecretController, fissionClient *crd.FissionClient, fsCache *fscache.FunctionServiceCache) *Executor {
|
func MakeExecutor(logger *zap.Logger, cms *cms.ConfigSecretController,
|
||||||
|
fissionClient *crd.FissionClient, types map[fv1.ExecutorType]executortype.ExecutorType) (*Executor, error) {
|
||||||
executor := &Executor{
|
executor := &Executor{
|
||||||
logger: logger.Named("executor"),
|
logger: logger.Named("executor"),
|
||||||
gpm: gpm,
|
|
||||||
ndm: ndm,
|
|
||||||
cms: cms,
|
cms: cms,
|
||||||
fissionClient: fissionClient,
|
fissionClient: fissionClient,
|
||||||
fsCache: fsCache,
|
executorTypes: types,
|
||||||
|
|
||||||
requestChan: make(chan *createFuncServiceRequest),
|
requestChan: make(chan *createFuncServiceRequest),
|
||||||
fsCreateWg: make(map[string]*sync.WaitGroup),
|
fsCreateWg: make(map[string]*sync.WaitGroup),
|
||||||
}
|
}
|
||||||
|
for _, et := range types {
|
||||||
|
go func(et executortype.ExecutorType) {
|
||||||
|
et.Run(context.Background())
|
||||||
|
}(et)
|
||||||
|
}
|
||||||
|
go cms.Run(context.Background())
|
||||||
go executor.serveCreateFuncServices()
|
go executor.serveCreateFuncServices()
|
||||||
|
|
||||||
return executor
|
return executor, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// All non-cached function service requests go through this goroutine
|
// All non-cached function service requests go through this goroutine
|
||||||
@@ -92,43 +97,65 @@ func MakeExecutor(logger *zap.Logger, gpm *poolmgr.GenericPoolManager, ndm *newd
|
|||||||
func (executor *Executor) serveCreateFuncServices() {
|
func (executor *Executor) serveCreateFuncServices() {
|
||||||
for {
|
for {
|
||||||
req := <-executor.requestChan
|
req := <-executor.requestChan
|
||||||
m := req.funcMeta
|
fnMetadata := &req.function.Metadata
|
||||||
|
|
||||||
// Cache miss -- is this first one to request the func?
|
// Cache miss -- is this first one to request the func?
|
||||||
wg, found := executor.fsCreateWg[crd.CacheKey(m)]
|
wg, found := executor.fsCreateWg[crd.CacheKey(fnMetadata)]
|
||||||
if !found {
|
if !found {
|
||||||
// create a waitgroup for other requests for
|
// create a waitgroup for other requests for
|
||||||
// the same function to wait on
|
// the same function to wait on
|
||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
executor.fsCreateWg[crd.CacheKey(m)] = wg
|
executor.fsCreateWg[crd.CacheKey(fnMetadata)] = wg
|
||||||
|
|
||||||
// launch a goroutine for each request, to parallelize
|
// launch a goroutine for each request, to parallelize
|
||||||
// the specialization of different functions
|
// the specialization of different functions
|
||||||
go func() {
|
go func() {
|
||||||
fsvc, err := executor.createServiceForFunction(req.ctx, m)
|
// Control overall specialization time by setting function
|
||||||
|
// specialization time to context. The reason not to use
|
||||||
|
// context from router requests is because a request maybe
|
||||||
|
// canceled for unknown reasons and let executor keeps
|
||||||
|
// spawning pods that never finish specialization process.
|
||||||
|
// Also, even a request failed, a specialized function pod
|
||||||
|
// still can serve other subsequent requests.
|
||||||
|
|
||||||
|
buffer := 10 // add some buffer time for specialization
|
||||||
|
specializationTimeout := req.function.Spec.InvokeStrategy.ExecutionStrategy.SpecializationTimeout
|
||||||
|
|
||||||
|
// set minimum specialization timeout to avoid illegal input and
|
||||||
|
// compatibility problem when applying old spec file that doesn't
|
||||||
|
// have specialization timeout field.
|
||||||
|
if specializationTimeout < fv1.DefaultSpecializationTimeOut {
|
||||||
|
specializationTimeout = fv1.DefaultSpecializationTimeOut
|
||||||
|
}
|
||||||
|
|
||||||
|
fnSpecializationTimeoutContext, cancel := context.WithTimeout(context.Background(),
|
||||||
|
time.Duration(specializationTimeout+buffer)*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
fsvc, err := executor.createServiceForFunction(fnSpecializationTimeoutContext, req.function)
|
||||||
req.respChan <- &createFuncServiceResponse{
|
req.respChan <- &createFuncServiceResponse{
|
||||||
funcSvc: fsvc,
|
funcSvc: fsvc,
|
||||||
err: err,
|
err: err,
|
||||||
}
|
}
|
||||||
delete(executor.fsCreateWg, crd.CacheKey(m))
|
delete(executor.fsCreateWg, crd.CacheKey(fnMetadata))
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
// There's an existing request for this function, wait for it to finish
|
// There's an existing request for this function, wait for it to finish
|
||||||
go func() {
|
go func() {
|
||||||
executor.logger.Debug("waiting for concurrent request for the same function",
|
executor.logger.Debug("waiting for concurrent request for the same function",
|
||||||
zap.Any("function", m))
|
zap.Any("function", fnMetadata))
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
// get the function service from the cache
|
// get the function service from the cache
|
||||||
fsvc, err := executor.fsCache.GetByFunction(m)
|
fsvc, err := executor.getFunctionServiceFromCache(req.function)
|
||||||
|
|
||||||
// fsCache return error when the entry does not exist/expire.
|
// fsCache return error when the entry does not exist/expire.
|
||||||
// It normally happened if there are multiple requests are
|
// It normally happened if there are multiple requests are
|
||||||
// waiting for the same function and executor failed to cre-
|
// waiting for the same function and executor failed to cre-
|
||||||
// ate service for function.
|
// ate service for function.
|
||||||
err = errors.Wrapf(err, "error getting service for function %v in namespace %v", m.Name, m.Namespace)
|
err = errors.Wrapf(err, "error getting service for function %v in namespace %v", fnMetadata.Name, fnMetadata.Namespace)
|
||||||
req.respChan <- &createFuncServiceResponse{
|
req.respChan <- &createFuncServiceResponse{
|
||||||
funcSvc: fsvc,
|
funcSvc: fsvc,
|
||||||
err: err,
|
err: err,
|
||||||
@@ -138,60 +165,37 @@ func (executor *Executor) serveCreateFuncServices() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (executor *Executor) getFunctionExecutorType(meta *metav1.ObjectMeta) (fv1.ExecutorType, error) {
|
func (executor *Executor) createServiceForFunction(ctx context.Context, fn *fv1.Function) (*fscache.FuncSvc, error) {
|
||||||
fn, err := executor.fissionClient.Functions(meta.Namespace).Get(meta.Name)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (executor *Executor) createServiceForFunction(ctx context.Context, meta *metav1.ObjectMeta) (*fscache.FuncSvc, error) {
|
|
||||||
executor.logger.Debug("no cached function service found, creating one",
|
executor.logger.Debug("no cached function service found, creating one",
|
||||||
zap.String("function_name", meta.Name),
|
zap.String("function_name", fn.Metadata.Name),
|
||||||
zap.String("function_namespace", meta.Namespace))
|
zap.String("function_namespace", fn.Metadata.Namespace))
|
||||||
|
|
||||||
executorType, err := executor.getFunctionExecutorType(meta)
|
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
||||||
if err != nil {
|
e, ok := executor.executorTypes[t]
|
||||||
return nil, err
|
if !ok {
|
||||||
}
|
return nil, errors.Errorf("Unknown executor type '%v'", t)
|
||||||
|
|
||||||
var fsvc *fscache.FuncSvc
|
|
||||||
var fsvcErr error
|
|
||||||
|
|
||||||
switch executorType {
|
|
||||||
case fv1.ExecutorTypeNewdeploy:
|
|
||||||
fsvc, fsvcErr = executor.ndm.GetFuncSvc(ctx, meta)
|
|
||||||
default:
|
|
||||||
fsvc, fsvcErr = executor.gpm.GetFuncSvc(ctx, meta)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fsvc, fsvcErr := e.GetFuncSvc(ctx, fn)
|
||||||
if fsvcErr != nil {
|
if fsvcErr != nil {
|
||||||
e := "error creating service for function"
|
e := "error creating service for function"
|
||||||
executor.logger.Error(e,
|
executor.logger.Error(e,
|
||||||
zap.Error(fsvcErr),
|
zap.Error(fsvcErr),
|
||||||
zap.String("function_name", meta.Name),
|
zap.String("function_name", fn.Metadata.Name),
|
||||||
zap.String("function_namespace", meta.Namespace))
|
zap.String("function_namespace", fn.Metadata.Namespace))
|
||||||
fsvcErr = errors.Wrap(fsvcErr, fmt.Sprintf("[%s] %s", meta.Name, e))
|
fsvcErr = errors.Wrap(fsvcErr, fmt.Sprintf("[%s] %s", fn.Metadata.Name, e))
|
||||||
} else if fsvc != nil {
|
|
||||||
_, err = executor.fsCache.Add(*fsvc)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
executor.fsCache.IncreaseColdStarts(meta.Name, string(meta.UID))
|
|
||||||
|
|
||||||
return fsvc, fsvcErr
|
return fsvc, fsvcErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// isValidAddress invokes isValidService or isValidPod depending on the type of executor
|
func (executor *Executor) getFunctionServiceFromCache(fn *fv1.Function) (*fscache.FuncSvc, error) {
|
||||||
func (executor *Executor) isValidAddress(fsvc *fscache.FuncSvc) bool {
|
t := fn.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType
|
||||||
if fsvc.Executor == fscache.NEWDEPLOY {
|
e, ok := executor.executorTypes[t]
|
||||||
return executor.ndm.IsValid(fsvc)
|
if !ok {
|
||||||
} else {
|
return nil, errors.Errorf("Unknown executor type '%v'", t)
|
||||||
return executor.gpm.IsValid(fsvc)
|
|
||||||
}
|
}
|
||||||
|
return e.GetFuncSvcFromCache(fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
func serveMetric(logger *zap.Logger) {
|
func serveMetric(logger *zap.Logger) {
|
||||||
@@ -222,26 +226,49 @@ func StartExecutor(logger *zap.Logger, functionNamespace string, envBuilderNames
|
|||||||
}
|
}
|
||||||
|
|
||||||
restClient := fissionClient.GetCrdClient()
|
restClient := fissionClient.GetCrdClient()
|
||||||
fsCache := fscache.MakeFunctionServiceCache(logger)
|
executorInstanceID := strings.ToLower(uniuri.NewLen(8))
|
||||||
|
|
||||||
poolID := strings.ToLower(uniuri.NewLen(8))
|
logger.Info("Starting executor", zap.String("instanceID", executorInstanceID))
|
||||||
reaper.CleanupOldExecutorObjects(logger, kubernetesClient, poolID)
|
|
||||||
go reaper.CleanupRoleBindings(logger, kubernetesClient, fissionClient, functionNamespace, envBuilderNamespace, time.Minute*30)
|
|
||||||
|
|
||||||
gpm := poolmgr.MakeGenericPoolManager(
|
gpm := poolmgr.MakeGenericPoolManager(
|
||||||
logger,
|
logger,
|
||||||
fissionClient, kubernetesClient,
|
fissionClient, kubernetesClient,
|
||||||
functionNamespace, fetcherConfig, poolID)
|
functionNamespace, fetcherConfig, executorInstanceID)
|
||||||
|
|
||||||
ndm := newdeploy.MakeNewDeploy(
|
ndm := newdeploy.MakeNewDeploy(
|
||||||
logger,
|
logger,
|
||||||
fissionClient, kubernetesClient, restClient,
|
fissionClient, kubernetesClient, restClient,
|
||||||
functionNamespace, fetcherConfig, poolID)
|
functionNamespace, fetcherConfig, executorInstanceID)
|
||||||
|
|
||||||
cms := cms.MakeConfigSecretController(logger, fissionClient, kubernetesClient, ndm, gpm)
|
executorTypes := make(map[fv1.ExecutorType]executortype.ExecutorType)
|
||||||
|
executorTypes[gpm.GetTypeName()] = gpm
|
||||||
|
executorTypes[ndm.GetTypeName()] = ndm
|
||||||
|
|
||||||
api := MakeExecutor(logger, gpm, ndm, cms, fissionClient, fsCache)
|
adoptExistingResources, _ := strconv.ParseBool(os.Getenv("ADOPT_EXISTING_RESOURCES"))
|
||||||
|
|
||||||
|
wg := &sync.WaitGroup{}
|
||||||
|
for _, et := range executorTypes {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(et executortype.ExecutorType) {
|
||||||
|
defer wg.Done()
|
||||||
|
if adoptExistingResources {
|
||||||
|
et.AdoptExistingResources()
|
||||||
|
}
|
||||||
|
et.CleanupOldExecutorObjects()
|
||||||
|
}(et)
|
||||||
|
}
|
||||||
|
// set hard timeout for resource adoption
|
||||||
|
// TODO: use context to control the waiting time once kubernetes client supports it.
|
||||||
|
util.WaitTimeout(wg, 30*time.Second)
|
||||||
|
|
||||||
|
cms := cms.MakeConfigSecretController(logger, fissionClient, kubernetesClient, executorTypes)
|
||||||
|
|
||||||
|
api, err := MakeExecutor(logger, cms, fissionClient, executorTypes)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
go reaper.CleanupRoleBindings(logger, kubernetesClient, fissionClient, functionNamespace, envBuilderNamespace, time.Minute*30)
|
||||||
go api.Serve(port)
|
go api.Serve(port)
|
||||||
go serveMetric(logger)
|
go serveMetric(logger)
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,8 @@ package executor
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -99,19 +97,6 @@ func createSvc(kubeClient *kubernetes.Clientset, ns string, name string, targetP
|
|||||||
return svc
|
return svc
|
||||||
}
|
}
|
||||||
|
|
||||||
func httpGet(url string) string {
|
|
||||||
resp, err := http.Get(url)
|
|
||||||
if err != nil {
|
|
||||||
log.Panicf("HTTP Get failed: URL %v: %v", url, err)
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
log.Panicf("HTTP Get failed to read body: URL %v: %v", url, err)
|
|
||||||
}
|
|
||||||
return string(body)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestExecutor(t *testing.T) {
|
func TestExecutor(t *testing.T) {
|
||||||
// run in a random namespace so we can have concurrent tests
|
// run in a random namespace so we can have concurrent tests
|
||||||
// on a given cluster
|
// on a given cluster
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user