Commit Graph

526 Commits

Author SHA1 Message Date
Lance Ball d71532a070
fix: fix unit tests for Node.js event templates (#438)
The bump of a major version of the Node.js dependencies changed
the format for the data received over HTTP (string vs. object).
This fixes that test to use JSON.stringify().

Signed-off-by: Lance Ball <lball@redhat.com>
2021-07-26 10:42:15 -07:00
Markus Thömmes 02e86d394a
Change github.com links to the new home (#424) 2021-07-26 10:30:15 -07:00
Julian Friedman ff35740b45
Bump cloudevents dep to 4.0.3 (#434) 2021-07-23 09:43:45 -07:00
Julian Friedman 7e5fd9a526
Bump node dependencies (#433) 2021-07-23 08:27:45 -07:00
Dejan Bosanac a08b843a9c
feat: Configure Rust functions (#430)
* Add ability to add all custom function configuration in a separate module.

Co-authored-by: Dejan Bosanac <dejan@sensatic.net>
Co-authored-by: Jim Crossley <jcrossley3@gmail.com>

Co-authored-by: Jim Crossley <jcrossley3@gmail.com>
2021-07-23 07:02:45 -07:00
Luke Kingland ede284bf01
doc: DEVELOPMENT.md (#432)
* doc: DEVELOPMENT.md

* Update docs/DEVELOPMENT.md

Co-authored-by: Lance Ball <lball@redhat.com>

* Update docs/DEVELOPMENT.md

Co-authored-by: Lance Ball <lball@redhat.com>

Co-authored-by: Lance Ball <lball@redhat.com>
2021-07-23 07:01:45 -07:00
Luke Kingland 66c26115b8
test: confirm repositories search path (#431) 2021-07-22 13:39:44 -07:00
jrangelramos 8cfb448382
ci: e2e test support for typescript runtime (#429)
* ci: Added minimal e2e test for typescript runtime

* ci: resolve lint warning on e2e test
2021-07-22 20:48:29 +09:00
Luke Kingland c257de807d
src: Makefile developer accessibility (#428)
* ci: increase dns update max retries

* src: Makefile accessibility

Restructures the Makefile for better readibility
Separates core unit tests from template unit tests
Adds a `help` target highlighting core targets
Removes unused 'cluser' and 'release' targets
Removes unused targets
2021-07-21 00:45:38 -07:00
Matej Vasek ed0c246ada
CI integration test with podman (#422)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-07-16 06:47:09 -07:00
Markus Thömmes 892558bf2a
Rename module to knative.dev/kn-plugin-func (#423)
Co-authored-by: Lance Ball <lball@redhat.com>
2021-07-15 11:33:32 -07:00
Matej Vasek 771a2307a1
fix: update builders version (#421)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-07-15 11:29:32 -07:00
Luke Kingland b1d840ad60
ci: move to inbuilt cluster config (#419)
Restructures repository cluster setup and configuration scripts
to be used both for local testing as well as in CI.  Adds a
CI-specific ci.sh script for the differences.  Additionally:
- Upgrades to knative v0.23.0
- Upgrades eventing from v1beta1 API to v1
- Adds binary installation script (linux)
- Serializes Build, Int Test, e2e test steps
- Installs Broker and Channel to support Knative Quickstart tutorial.
- Runs a test echo server during installation
- Adds event-based waits in place of most blind time-based waits
- Adds explicit Kubernetes version for KinD
- Replaces a NodePort patched Koourier with an explicit ingress
- Adds retries while activator webhook becomes available
- Merges allocate and configure
2021-07-15 07:45:32 -07:00
Matej Vasek 894f4febda
fix: do not trust builder when using podman (#420)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-07-14 15:47:28 -04:00
Jim Crossley c2c1b999e0
Define handler in terms of CloudEvents rather than http/payload (#412)
This should simplify the unit tests. Only the invalid_event test uses
the actix-web test helpers, just as an example to show it's the HTTP
plumbing that will fail the request when it tries to construct an
Event from invalid (or missing) headers.
2021-07-12 09:04:13 -04:00
Zbynek Roubalik 795cd7251e
docs: fix link to func.yaml docs in language guides (#418)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-07-12 09:02:58 -04:00
Luke Kingland afcde2d551
src: testable commands (#415)
* feat: client progress listener 'stopping' state

* src: testable commands

Restructures commands to accept a fn.Client constructor on command
instantiation.  This allows the concrete implementations, or entire
client to be mocked for testing.
Also some minor refacotring as necessary to shoehorn into the pattern.

* fix: increase default timeout to 120s for service creation

* chore: bump kind, knative and kubectl versions
2021-07-09 11:15:23 -04:00
Lance Ball 346cae0192
chore: add AUTHORS and OWNERS files (#413)
Preparation for the move to knative-sandbox.
See: https://github.com/knative/community/issues/613

Signed-off-by: Lance Ball <lball@redhat.com>
2021-07-07 10:35:33 -04:00
Lance Ball 08df25b9bf
chore(CI): use container-tools/kind for integration tests (#407)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-06-24 14:08:23 -04:00
Matej Vasek 6f40b29d3e
fix: closing stdout
pack client was closing stdout
this commit prevents that

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-06-24 14:30:01 +02:00
Matej Vasek e7b0c375d4
doc: how to use podman
how to use podman

Signed-off-by: Matej Vasek <mvasek@redhat.com>

Co-authored-by: Lance Ball <lball@redhat.com>
2021-06-24 14:29:15 +02:00
Luke Kingland 4222e34aa6
src: test create command validates name 2021-06-24 21:08:06 +09:00
Luke Kingland 1591fa6759
src: refactor create command to be testable 2021-06-24 21:08:06 +09:00
github-actions[bot] 0ad7b548a3
chore: release 0.16.0 (#370)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-23 12:55:44 -04:00
Lance Ball bfa5746442
chore: bump to buildpacks v0.8.3 for all versions (#402)
* chore: bump to buildpacks v0.8.2 for all versions

This is causing me to rethink using versions in these templates, and our
overall buildpack version/release strategy. But for now, we should land
this before 0.16.0

* adds trust for any quay.io/boson builder

Signed-off-by: Lance Ball <lball@redhat.com>
2021-06-23 12:44:42 -04:00
Luke Kingland 5ded87368b
src: rename bosonFunc fn 2021-06-22 23:08:11 +09:00
Luke Kingland 8fb99a37af
src: test temp dir helper standardization (#400)
* src: test temp dir helper standardization

* src: test nonempty windows-compatible path
2021-06-21 17:14:17 -04:00
Zbynek Roubalik 6f96011d7c
src: `create`- use Select for specifying runtime in interactive mode (#399)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-21 17:11:35 -04:00
Matej Vasek 88ea081cc0
fix: use credsStore
use credsStore when searching for credentials

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-06-21 15:51:56 +02:00
Luke Kingland 16c3c4de3c
src: filled out templates unit tests 2021-06-21 20:12:08 +09:00
Zbynek Roubalik 12c5cda8e2
feat: allow setting resource requests/limits (#386)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-21 08:38:50 +02:00
Zbynek Roubalik 7a24a103ef
src: refactor prompt to use `AlecAivazis/survey` (#397)
* src: refactor prompt to use `AlecAivazis/survey`

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-21 08:38:26 +02:00
Zbynek Roubalik 83a9ca684f
feat: `func config envs` - interactive prompt (#396)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-21 08:37:48 +02:00
Jim Crossley 4711638495
feat: Rust templates (#376)
* Rust templates for http/event triggers

Each template is a fully-formed actix-web application that includes a
main.rs providing the server configuration and a handler.rs showing an
example function and a few simple unit tests. A README.md provides a
bit more detail to get the user started. The events handler is similar
to the example in the old faas-rust-runtime project.

* With developer guide for Rust
2021-06-18 13:08:50 -04:00
Luke Kingland 40f10277a4
feat: typed errors for templates use cases 2021-06-18 19:08:01 +09:00
Jim Crossley 947fcaa968
feat: add a URL output type for `func describe` (#389)
* Added a URL output type for 'func describe'

Fixes #387

Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com>
2021-06-18 09:50:36 +02:00
Zbynek Roubalik 76b5800c62
src: envs: use `:` instead of `.` as separators (#394)
* src: envs: use `:` instead of `.` as separators

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* leftovers

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-18 09:50:07 +02:00
Zbynek Roubalik 54f60a2552
src: validate Env Var name (#395)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-18 09:12:45 +02:00
Zbynek Roubalik 4ba95b69a8
feat: `func config volumes` - interactive prompt (#391)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-17 09:21:07 +02:00
Matej Vasek 6e8517c023
fix: disable selinux labeling
disable selinux labeling

prevents permission denied on docker socket mount

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-06-16 23:54:28 +02:00
Zbynek Roubalik b92eaa796b
chore: fix typo in commands guide (#392)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-16 17:59:00 +02:00
Matej Vasek 84f896b329
fix: password read on windows
* fix: password read on windows

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-06-16 04:18:40 +02:00
Zbynek Roubalik a937c490b7
feat: allow setting autoscaling options to deployed KService (#374)
* feat: allow setting autoscaling options to deployed KService

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* incorporate feedback

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* move `target` & `utilization` to `scale` section

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* don't include concurrency.limit

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-15 09:26:36 +02:00
Luke Kingland 8041a25486
extensible repositories flag (#384)
The flag pointing to extensible template repositories is now called
repositories.  This fits with the expectation that this location
will most likely be filled with git repositories containing templates.
2021-06-14 14:57:05 -04:00
Luke Kingland 2147f97ba2
use 'a' for 'additional packages' parameter --packages 2021-06-10 22:42:53 +09:00
Luke Kingland 8ebf56e5f1
template parameter docs re-added 2021-06-10 22:42:33 +09:00
Lance Ball ce29ff6285
refactor!: change --trigger and --templates flags
This commit is a breaking change.

Change the `--trigger` flag to be `--template` and the `--templates` flag
to be `--packages`. This is being done in anticipation of future work focused
on making `func` extensibility friendlier, and in an attempt to finalized some
of the naming conventions we have used to date.

In fact, the `--trigger` flag used to be `--template` but we decided to
change that a few months ago. This commit reverses that decision. The reason
behind this is twofold.

1. Using 'trigger' has proved to be confusing. Even if I create a function
with an HTTP trigger, it will still be invoked when a CloudEvent is sent
to the function process. Or alternatively, it is possible to send a raw
HTTP request to a function with an event trigger. Using 'template' instead
implies that the incoming request does not determine how the function is
invoked - rather it is the structure of the function signature that informs
the invocation.

2. The `trigger` terminology is not inclusive enough for our use cases. For
example, a third party provider of function templates may provide a template
for multiplexing incoming HTTP requests in Go using `gorilla-mux`. It doesn't
really make sense to say that `gorilla-mux` is the trigger. It's just a
defining feature of how the template is structured. I think this:

```sh
func create --runtime go --template gorilla-mux
```

Makes more sense than this:

```sh
func create --runtime go --trigger gorilla-mux
```

In changing this flag to be `--template`, we then need to come up with
another name for our existing `--templates` flag. I chose `--packages`
because what is being specified here is more than just the template. The
user sees only the function template when they run `func create...` but
the filesystem from which this template is pulled also contains metadata
about the template - most importantly right now, `.builders.yaml`. It is
conceivable that we may ultimately want to stuff these directories with
event more metadata in the future.

Something like `--packages` makes sense to me, but I am open to suggestion.

Thinking of these as a package also allows for better extensibility features
down the road. For example, users could reference packages at a URI like so.

```
func create --packages https://mycompany.com/function/templates.tgz
```

This would result in `func` downloading the tarball, extracting it to the
config directory, and using it for additional templates.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-06-09 21:33:21 +09:00
Luke Kingland b30e883e67
refactor!: function signatures implied from trigger
Renames trigger to template, removing it as an unnecessary configuration.
This reiterates that a Function implementation can change function sig
implemented at any time, and it is not part of the configuration.  This
sets the stage for renaming 'templates', and the finalization of the
use cases enabling extensible templates.
2021-06-09 21:18:55 +09:00
Lucas Holmquist b3a6bdf398
chore: fix dead link on the developers guide. (#380)
* The link from the developers guide to the cli command reference guide was missing the file extension
2021-06-09 00:13:43 -04:00
Zbynek Roubalik 1dbb5aecbf
feat: reference ConfigMaps in `envs` and `volumes` sections in config (#371)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-04 15:25:41 +02:00