Commit Graph

405 Commits

Author SHA1 Message Date
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
Zbynek Roubalik 553dfa83f6
chore: e2e tests should run against Knative 0.22.0 (#372)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-02 13:51:12 -04:00
jrangelramos ae8ee9a02c
ci: implementation proposal for func e2e test (#363)
Signed-off-by: Jefferson Ramos <jrangeramos@gmail.com>
2021-06-02 09:43:04 +02:00
Zbynek Roubalik 9d7fd34649
feat: reference Secrets in `envs` and `volumes` sections in config (#369)
* feat: reference Secrets in `envs` and `volumes` sections in config

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-02 09:20:28 +02:00
Zbynek Roubalik 4f0641f586
chore: bump Knative deps to 0.22.0 (#368)
* chore: bump Knative deps to 0.22.0

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-01 16:29:41 +02:00
Lance Ball 593bfd0dc9
chore(builders): add explicit version numbers for builder images (#365)
This commit adds specific version numbers to each of the builder images
referenced in function templates, func.yaml file. Because the API for
at least some of the runtimes has changed over time (looking at you,
faas-js-runtime), we should consider publishing our func.yaml files with
known-to-be-working-with-this-release versioned builder images.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-06-01 10:03:59 -04:00
github-actions[bot] aee6180063
chore: release 0.15.1 (#367)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-05-27 16:31:00 -04:00
Lance Ball 72584ced0d
fix: Revert "chore: bump Knative deps to 0.22.0 (#358)" (#366)
This reverts commit 27f62066ee.
2021-05-27 16:18:33 -04:00
github-actions[bot] 3dda1fa9c0
chore: release 0.15.0 (#346)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-05-27 12:58:34 -04:00
Lance Ball d3eafe2a84
feat: add typescript templates (#355)
* feat: add typescript templates

Bumps the faas-js-runtime dependency to 0.7.1 and Node.js buildpack dependency to v0.8.1

fix file globbing on windows

adjust eslint/prettier for windows

improve READMEs

add usage guide

Signed-off-by: Lance Ball <lball@redhat.com>
2021-05-26 11:23:42 -04:00
Jim Crossley caf0659900
src(templates)!: modify the nodejs event template to accept a cloudevent (#356)
* Simplify the nodejs events template

Pretty-printing the contents of the event and its envelope for each
request. This is handy when invoked as a Knative event sink as some
sources, e.g. Kafka, ignore the response body.

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

* Expect the event parameter to be the entire CloudEvent

This will require a change to the faas-js-runtime, but at least the
template won't need to change when that's released

* Update nodejs guide to reflect 2nd arg's type is CloudEvent

* Templates now using faas-js-runtime 0.7.1

Co-authored-by: Lance Ball <lball@redhat.com>
2021-05-25 13:49:48 -04:00
Zbynek Roubalik f62303b091
chore: bump golangci-lint version (#360)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-05-25 15:05:28 +02:00
Zbynek Roubalik eb47dc7ab2
chore: bump to Go 1.15 (#359)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-05-25 15:05:17 +02:00
Zbynek Roubalik 27f62066ee
chore: bump Knative deps to 0.22.0 (#358)
* chore: bump Knative deps to 0.22.0

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

* update to Knative 0.22.0

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-05-25 15:05:05 +02:00
Helio Frota ea0a75a7cc
fix: minor typos in node template docs (#351) 2021-05-18 08:48:34 -04:00
Lance Ball 2a0724083b
src: fail fast with conflicting flags (#348)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-05-17 08:41:44 -04:00
Zbynek Roubalik a9bfb98f68
src: check that func.yaml is correct (#345)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-05-13 19:17:23 +02:00
Lance Ball 49594d9766
feat: add 'kn func emit' command (#332)
This commit adds an Emitter to be used by the CLI commands
for sending CloudEvents to functions, either locally, on
the cluster, or at a specified endpoint.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-05-13 12:44:11 -04:00
Matej Vasek a74e3dd5e8
src: update CLI help for env flag
Update CLI help for env flag. Now mentioning unsetting of variable.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-05-13 16:19:22 +02:00
Matej Vasek a72a9a858a
src: add tests
Tests for mergeEnvMaps.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-05-13 15:01:33 +02:00
github-actions[bot] 1595b5bb48
chore: release 0.14.0 (#342)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-05-12 14:55:12 -04:00
Lance Ball 2b025df199
src!: revert bump to go 1.16 and template changes (#340)
* Revert "src: rename boson import 'fn'"

This reverts commit c0a6f561c0.

* Revert "src: all test dirs set to 0700"

This reverts commit 99f01220c2.

* Revert "src: better error when custom template not found"

This reverts commit 6673395834.

* Revert "src: better errors when custom runtime not found"

This reverts commit a31a6f67a1.

* Revert "build: create separate target for templates.tgz"

This reverts commit 11164bf8d9.

* Revert "src: use consistent separators for fs.FS instances"

This reverts commit 4db07b412f.

* Revert "src: update go event template dependencies"

This reverts commit 3bfc13380f.

* Revert "src: tarfs assumes forward slashes internally"

This reverts commit 6cc0e67b1c.

* Revert "feat: support windows paths in embedded templates FS"

This reverts commit c2b216857b.

* Revert "feat: positive error when runtimme or template unrecognized"

This reverts commit acc56b0900.

* Revert "fix: lint issues"

This reverts commit 895872aee7.

* Revert "ci: go 1.16 compatiblity updates"

This reverts commit 1e3959c045.

* Revert "feat: preserve file modes using in-memory tar FS"

This reverts commit 7dc772ec62.

* Revert "feat: create templates archive on go generate"

This reverts commit 63b7f11471.

* Revert "ci: remove pkger from ci"

This reverts commit 876b0dd0f7.

* Revert "src: remove pkger dependency and tidy"

This reverts commit f006ab1e32.

* Revert "src: remove packaging artifact"

This reverts commit 4d9d0a7b4e.

* Revert "src: remove pkger from make targets"

This reverts commit e44c1ad74c.

* Revert "src: replace pkger with embed.FS"

This reverts commit 38874a4afd.

* Revert "src: update references to deprecated ioutil"

This reverts commit 4025460f73.

* Revert "src: require go 1.16"

This reverts commit 512d4c2580.

* chore: update pkged.go

Signed-off-by: Lance Ball <lball@redhat.com>
2021-05-12 14:37:21 -04:00