Commit Graph

946 Commits

Author SHA1 Message Date
Zbynek Roubalik ddbb95b075
feat: Better output of build/deploy/delete commands (#206)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-05 16:46:21 +01:00
Lance Ball 6110d50b6b
templates: Node.js event template to return event (#202)
This commit modifies the Node.js template so that it returns a CloudEvent. The
tests are also modified to test for CloudEvent attributes and headers. Additionally
the faas-js-runtime bump reverses the parameters for the function.

Fixes: https://github.com/boson-project/faas/issues/190
Fixes: https://github.com/boson-project/faas/issues/194

Signed-off-by: Lance Ball <lball@redhat.com>
2020-11-05 10:22:20 -05:00
Zbynek Roubalik c036a77d37
fix version for release builds (#208)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-05 15:59:47 +01:00
Zbynek Roubalik 29ca07768c
feat: list command - improved output (#205)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-04 13:15:06 +01:00
Zbynek Roubalik 745640d9b4
src: add boson.dev/runtime label to kservice (#203)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-03 20:58:58 +01:00
Lance Ball 61cb56aec3
feat: change default runtime to Node.js HTTP (#198)
Fixes: https://github.com/boson-project/faas/issues/191

Signed-off-by: Lance Ball <lball@redhat.com>
2020-11-02 09:27:31 -05:00
github-actions[bot] d59af679b2
chore: release 0.8.0 (#171)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-10-21 10:59:38 -04:00
Matej Vasek 6a621a5186
fix: image parsing 2020-10-20 19:54:33 +02:00
Matej Vasek 5591e7fa2c
fix: examples in readme 2020-10-20 19:37:40 +02:00
Matej Vasek 1d14a8c101
fix: regenerate pkger files (#183) 2020-10-20 09:07:35 -04:00
Zbynek Roubalik 00e5d187c2
src: use image digest (#175)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-19 11:43:50 +02:00
Lance Ball 95c1eb5e59
feat: add health probes to node & go services (#174)
Until the next release of Quarkus in November, we'll need to have some special
checks so that we don't add these probes to Quarkus based functions. In the
meantime, we can at least set the liveness and readiness endpoints on the
Node.js/Go functions to /health/liveness and /health/readiness respectively.

Fixes: https://github.com/boson-project/faas/issues/169

Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-15 15:54:57 -04:00
Zbynek Roubalik 551331925a
chore: tweak output & verbose messages (#173)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-15 19:00:28 +02:00
Paul Morie f4851fb669
Add link to CLI installation in developer guide (#176) 2020-10-15 10:14:49 +02:00
Lance Ball 74511948ce
feat: introduce CloudEvent data as first parameter for event functions (#172)
The 0.4.0 version of faas-js-runtime extracts the CloudEvent data from
an incoming event and provides that as the first parameter when invoking
a function which receives a CloudEvent. This commit bumps to that version
as well as improves the overall readability and code documentation for the
Node.js CloudEvent function.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-14 09:46:37 -04:00
Zbynek Roubalik 68351bd0ec
src: use Knative Client libraries (#167)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-14 10:42:26 +02:00
Matej Vasek ffc6a123e4
fix: update quarkus templates 2020-10-13 17:57:54 +02:00
Lance Ball 12c1dc0a94
chore(ci): tweak release-please-action to bump minor pre major. (#170)
This commit modifies the CI action so that it should bump minor versions
until we explicitly have a 1.0.0 release. I've also bumped the version
of release-please-action to the latest 2.5.5.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-13 10:44:49 -04:00
Matej Vasek 5182487df2
feat: user can set envvars 2020-10-13 14:11:06 +02:00
Navid Shaikh 89b9b73d2f
Point knative/client at v0.17.2 (#168)
- This reverts commit cc5435a84b.
 - Points knative/client at v0.17.2
2020-10-12 12:58:22 +02:00
Navid Shaikh cc5435a84b
Carry WithLabel listConfig feat (#165)
from a fork of knative.dev/client
2020-10-12 09:41:34 +02:00
David Simansky ec5327d520
fix: root cmd init 2020-10-08 18:35:18 +02:00
David Simansky 85a5f475eb
feat(kn): Enable faas to be integrated as plugin to kn (#155)
Provides capabilities for the faas CLI to exist as a plugin in the upstream kn CLI.

Tested with kn 0.17
2020-10-08 10:14:10 -04:00
Zbynek Roubalik 2c7c18dd9b
chore: commands are checking that Function is initialized (#162)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-08 15:32:46 +02:00
Lance Ball e425c8f081
src!: change all references of "repository" to "registry" for images (#156)
When dealing with images, instead of referring to an image repository,
let's instead use the more correct term "registry", even though we're
actually using "registry/namespace" in most case.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-08 10:58:17 +02:00
Lance Ball 6d301257f5
chore(templates): bump faas-js-runtime to 0.3.0 and update the name (#150)
* chore(templates): bump faas-js-runtime to 0.3.0 and update the name

The module name lost its @redhat prefix, and bumped a version. This
pulls in that latest dependency.

Running pkger for the first time on a new system also resulted in a
minor version bump for that dependency.


Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-07 17:48:30 -04:00
Zbynek Roubalik d5839ea6c1
feat!: combine deploy and update commands (#152)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-07 17:29:09 +02:00
Zbynek Roubalik 3c0b2bb4d1
chore: ignore vscode files (#153)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-10-06 21:23:36 +02:00
Matej Vasek d82230353d
feat: fish completion 2020-10-06 15:39:07 +02:00
Matej Vasek bf9b048813
fix: stop using manually edited completion 2020-10-05 22:06:49 +02:00
Matej Vasek c2b4a304bd
feat: ability for users to specify custom builders (#147)
* refactor: functionWithOverrides
* feat: custom Buildpacks builder
* fix: namespaces
2020-10-05 10:29:51 -04:00
Roland Huß 5fe70526e5
fix: update to Knative 0.17 (#145)
Also adjusted some dependencies and overwrite version to align
transitive dependencies.

Not sure why buildpack uses such an older docker dependency but that
clases with the docker dependency that is introduced by knative-dev/test-infra
(which is a dependency of the knative direct dependencies)

If there is a way to exclude a transitive dependency like that on test-infra,
this could be the better way to achieve the same result.

The build now works on macOs natively which was not the case before.
2020-10-05 10:28:37 -04:00
Lance Ball 54e9b2703e
chore(actions): update release-please-action to latest 2.4.1 (#146)
Signed-off-by: Lance Ball <lball@redhat.com>
2020-10-02 11:46:55 -04:00
Matej Vasek 06391a4243
chore: update go cloudevent sdk dep 2020-09-29 18:24:53 +02:00
Lance Ball a698f39d1d
chore: rename .faas.yaml to faas.yaml (#143)
Fixes: https://github.com/boson-project/faas/issues/142

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-29 10:27:04 -04:00
Lance Ball 05196a66b7
chore(ci): fix release binary uploads (#139)
There was a typo in the upload part of the CI. Also, there was a section
that (thankfully) did not run, which would have created a second release.
Moved the release-please action later in CI so less time elapses between
the creation of the release, and the upload of the binaries.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-09-29 09:22:00 -04:00
github-actions[bot] 40962fc645
chore: release 0.7.0 (#116)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-24 14:33:31 -04:00
Lance Ball d6e131f915
feat: set builder images in templates and .faas.yaml (#136)
This commit adds a .builder.yaml file to each template directory. In the file
there is at the moment a single key/value pair, "default: <image>", where the
actual builder image name is <image>. Using a mapping allows the future
possibility that a user may specify a builder image by name via a flag on the
command line. For example,

```console
faas build --builder native
```

When a project is initialized, the .builder.yaml file is read, and the default
builder is saved in the project's .faas.yaml file. The .faas.yaml file is then
consulted when building an image with `faas build`. If the builder image is
specified, then the builder will use it. Otherwise, it will fallback to the
defaults. This allows developers to create custom builders, and specify them
in the configuration file.

After extracting the builder image from .builder.yaml in the project directory,
this file is deleted.

This commit also adds Verbose to the init command.
2020-09-24 11:41:34 -04:00
Lance Ball 05efee8c83
src: add Long command descriptions for each of the CLI commands (#133)
Uses the Cobra "Long" configuration for each command to provide more
descriptive text.

Example:

```console
faas help create                                                                                                      1.3m  Mon 21 Sep 2020 09:55:40 PM EDT
Create a new Function, including initialization of local files and deployment

Creates a new Function project at 'path'. If 'path' does not exist, it is
created. The function name is the name of the leaf directory at path. After
creating the project, a container image is created and is deployed. This
command wraps 'init', 'build' and 'deploy' all up into one command.

The runtime, trigger, image name, image repository, and namespace may all be
specified as flags on the command line, and will subsequently be the default
values when an image is built or a Function is deployed. If the image name and
image repository are both unspecified, the user will be prompted for a
repository name, and the image name can be inferred from that plus the function
name. The function name, namespace, image name and repository name are all
persisted in the project configuration file .faas.yaml.

Usage:
  faas create <path> [options] [flags]

Flags:
  -c, --confirm             Prompt to confirm all configuration options - $FAAS_CONFIRM
  -h, --help                help for create
  -i, --image string        Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --repository) - $FAAS_IMAGE
  -n, --namespace string    Override namespace into which the Function is deployed (on supported platforms).  Default is to use currently active underlying platform setting - $FAAS_NAMESPACE
  -r, --repository string   Repository for built images, ex 'docker.io/myuser' or just 'myuser'.  Optional if --image provided. - $FAAS_REPOSITORY
  -l, --runtime string      Function runtime language/framework. - $FAAS_RUNTIME (default "go")
      --templates string    Extensible templates path. - $FAAS_TEMPLATES (default "/home/lanceball/.config/faas/templates")
  -t, --trigger string      Function trigger (ex: 'http','events') - $FAAS_TRIGGER (default "http")

Global Flags:
      --config string   config file path (default "~/.faas/config")
  -v, --verbose         print verbose logs
```
2020-09-24 10:23:55 -04:00
Zbynek Roubalik 025862689e
feat: decouple function name from function domain (#127)
* decouple function name from function domain

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-24 09:52:22 -04:00
Matej Vasek 02309a24a1
fix: sync package-lock.json (#137) 2020-09-24 09:18:02 -04:00
Zbynek Roubalik 7e298fd7d7
use go 1.14 (#134)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-22 12:43:45 -04:00
Lance Ball 1b0bb15147
feat: add local debugging to node.js templates (#132)
This commit adds nodemon and an `npm run debug` command to the Node.js
templates to support debugging on localhost.
2020-09-22 09:32:23 -04:00
Lance Ball fae27dabc9
fix: correct value for config path and robustify (#130)
* fix: correct value for config path and robustify

The hardcoded, initial value for the configuration path was set to
`.faas/config`. But `configPath()` immediately sets this to the correct
value of ~/.config. Both the create and init commands use `configPath()`
to search for additional templates, if they exist, and were each doing
`filepath.Join(configPath(), "faas", "templates")`. This commit also
changes `configPath()` so that it is `~/.config/faas` and does so in a
cross platform friendly way. If the `$HOME` directory cannot be
determined, the config is assumed to be at `./.config/faas`.

* squash: remove config variable entirely
2020-09-21 14:35:46 -04:00
Lance Ball 341d3d2064
docs: add documentation for CLI commands (#128)
Adds a document outlining each of the CLI commands
2020-09-21 14:25:50 -04:00
Matej Vasek 279e990843
chore: update Quarkus version to 1.8.1.Final 2020-09-21 15:08:15 +02:00
Lance Ball 3868ef3441 chore: remove [options] from usage string
The cobra package, magically appends "[flags]" to the usage string
if a command has flags. By adding "[options]" to the usage string,
we end up with help text that looks like this.

```
  faas init <name> [options] [flags]
```

This commit fixes that.
2020-09-19 17:23:08 -04:00
Lance Ball 5b93955f8b chore: remove dead appsody code
All of the code in `./appsody` is no longer used. This commit simply
removes it from the repo.
2020-09-16 11:34:00 -04:00
Matej Vasek b7670a3f7b
chore: run GH actions on Windows and macOS 2020-09-16 17:29:13 +02:00
Matej Vasek 7a648d2d23
chore: update `pack` dep version 2020-09-16 17:27:11 +02:00