Commit Graph

319 Commits

Author SHA1 Message Date
Matthias Wessendorf e4430de1f2
Invoke instanced CE function's handle withNew() (#2119)
* 💄 Adding New() to make the file compile

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Checkin stuff to make test in IDE pass

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

---------

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
2024-01-16 15:00:37 +00:00
Matej Vasek 8ecf77d4c4
chore: use Quarkus BP instead of expicit envvars (#2117)
The envvars do not have to be set manually anymore since Quarkus BP will
set them for us.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2024-01-16 13:51:10 +00:00
Luke Kingland 32f6d8de7d
func-go v0.19.0 (#2103) 2023-12-18 09:51:37 +00:00
Matej Vasek 76fde174de
fix: update Quarkus template readme (#2101)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-12-07 15:35:08 +00:00
github-actions[bot] a8bbec33e7
chore: update Quarkus platform version to 3.5.3 (#2092)
Co-authored-by: Knative Automation <automation@knative.team>
2023-11-21 18:41:47 +00:00
github-actions[bot] 39155b73b6
chore: update Quarkus platform version to 3.5.2 (#2085)
Co-authored-by: Knative Automation <automation@knative.team>
2023-11-17 11:09:16 +00:00
github-actions[bot] d526272b8d
chore: update Quarkus platform version to 3.5.1 (#2076)
Co-authored-by: Knative Automation <automation@knative.team>
2023-11-13 16:15:17 +00:00
github-actions[bot] bc1acd1ff3
chore: update Quarkus platform version to 3.5.0 (#2057)
Co-authored-by: Knative Automation <automation@knative.team>
2023-10-27 18:41:53 +00:00
github-actions[bot] a3ac5e7248
chore: update Springboot platform version to 3.1.5 (#2045)
Co-authored-by: Knative Automation <automation@knative.team>
2023-10-21 17:20:04 +00:00
dependabot[bot] 714d5e3fd2
chore(deps): bump flask from 2.2.3 to 2.2.5 in /templates/python/flask (#2010)
* chore(deps): bump flask from 2.2.3 to 2.2.5 in /templates/python/flask

Bumps [flask](https://github.com/pallets/flask) from 2.2.3 to 2.2.5.
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/flask/compare/2.2.3...2.2.5)

---
updated-dependencies:
- dependency-name: flask
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fixup: regenerate zz_filesystem_generated.go

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
2023-10-20 12:29:33 +00:00
github-actions[bot] 335de806e7
chore: update Quarkus platform version to 3.4.3 (#2040)
Co-authored-by: Knative Automation <automation@knative.team>
2023-10-20 11:22:21 +00:00
Thomas Risberg 84ad7d7f17
chore: update maven profile buildEnv in springboot templates (#2014)
- Update the documentation for springboot arm based builds

- Add the generated filesystem
2023-10-18 19:32:51 +00:00
github-actions[bot] 358a816354
chore: update Quarkus platform version to 3.4.2 (#2006)
Co-authored-by: Knative Automation <automation@knative.team>
2023-10-06 16:51:04 +00:00
github-actions[bot] 975cc91b46
chore: update Quarkus platform version to 3.4.1 (#1989)
Co-authored-by: Knative Automation <automation@knative.team>
2023-09-25 17:50:46 +00:00
Matej Vasek 8e660e1c21
chore: update mvn wrapper in Quarkus template (#1987)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-09-20 19:01:27 +00:00
github-actions[bot] 812855a1e9
chore: update Quarkus platform version to 3.3.3 (#1978)
Co-authored-by: Knative Automation <automation@knative.team>
2023-09-18 14:54:55 +00:00
github-actions[bot] 1e271ae15f
chore: update Quarkus platform version to 3.3.1 (#1955)
Co-authored-by: Knative Automation <automation@knative.team>
2023-08-30 12:21:31 +00:00
github-actions[bot] 1ff01a30ba
chore: update Springboot platform version to 3.1.3 (#1947)
Co-authored-by: Knative Automation <automation@knative.team>
2023-08-29 16:12:30 +00:00
Matej Vasek 4af9c39e36
chore: update CA certs (#1944)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-28 16:16:29 +00:00
github-actions[bot] c8abe3e307
chore: update Quarkus platform version to 3.2.4.Final (#1927)
Co-authored-by: Knative Automation <automation@knative.team>
2023-08-14 14:38:44 +00:00
Matej Vasek efb04bef0f
Use custom jammy paketo builder (#1911)
* chore: use custom jammy paketo builder

Use our own modified jammy builder with additional buildpacks for
GoFunc and Rust. This enables on cluster build for Go and Rust functions.
Where possible (Go, Java) we use "tiny" variant, other runtimes use "base"
variant.

The updated task is new file instead of modifying existing task
this is done for sake of keeping compatiblility.

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

* fixup: remove unnecessary code per review request

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

* fixup

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

* fixup: podman test refers correct tkn task yamls

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-10 03:25:35 +00:00
github-actions[bot] fe08004b3f
chore: update Quarkus platform version to 3.2.3.Final (#1909)
Co-authored-by: Knative Automation <automation@knative.team>
2023-08-05 01:41:07 +00:00
github-actions[bot] 8630175fc4
chore: update Springboot platform version to 3.1.2 (#1907)
Co-authored-by: Knative Automation <automation@knative.team>
2023-08-04 17:35:08 +00:00
Matej Vasek e13d0296f3
chore: update scaffolding sandbox => extensions (#1902)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-03 20:17:21 +00:00
Luke Kingland a2834c2283
src: update func go runtime dep (#1879)
* src: update func go runtime dep

* func-go v0.18.2

---------

Co-authored-by: Matej Vasek <mvasek@redhat.com>
2023-07-25 19:44:40 +00:00
github-actions[bot] a3a45d3514
chore: update Quarkus platform version to 3.2.2.Final (#1883)
Co-authored-by: Knative Automation <automation@knative.team>
2023-07-24 17:21:39 +00:00
github-actions[bot] 0def26fa79
chore: update Quarkus platform version to 3.2.1.Final (#1881)
Co-authored-by: Knative Automation <automation@knative.team>
2023-07-21 14:24:13 +00:00
Lance Ball 36489f3a55
chore: bump faas-js-runtime and cloudevents for node & TS (#1873)
* chore: bump faas-js-runtime and cloudevents for node & TS

The Node.js and TypeScript templates have been bumped to the latest
versions of faas-js-runtime (2.2.2) and CloudEvents (7.0.1).

There is an issue with the `expectType` test for TypeScript CloudEvent
functions which I can't quite figure out, but the type test is not
critical and does not do anything to validate other than whether the
function signature is what's expected by faas-js-runtime, and in this
case, I think type exported type for faas-js-runtime may actually be the
issue here.

Signed-off-by: Lance Ball <lball@redhat.com>

* chore: pin all github actions to go 1.20.2

There was a change in how go parses URLs in versions higher than 1.20.2
(likely 1.20.6 and up) which breaks the Docker API's handling of daemon
URIs. This fix pins the Go version at a version known to work with the
existing Docker API and `func` implementation.

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-07-19 04:17:11 +00:00
Luke Kingland ba798408de
src: update func-runtime-go and dapr (#1836)
* func-rumtime-go v0.2.4

* dapr v1.11.1

* func-runtime-go v0.3.2
2023-07-18 09:57:10 +00:00
github-actions[bot] f671918124
chore: update Quarkus platform version to 3.2.0.Final (#1844)
Co-authored-by: Knative Automation <automation@knative.team>
2023-07-05 19:00:39 +00:00
Luke Kingland 883dcbb203
src: make test and check go (#1828)
- Updates make test-go to include scaffolding
- Creates make check-go to run basic source quality checks
2023-06-30 05:37:27 +00:00
Luke Kingland 19509e5053
feat: scaffolded functions certs (#1823) 2023-06-26 18:57:51 +00:00
Luke Kingland 8a078cea0c
src: make update-runtimes (#1822)
- Updates func-runtime-go 20 v0.2.3
- Create an 'update-runtimes' make target
- Standardizes plurality of "Cloudevents" throughout
2023-06-22 07:00:35 +00:00
github-actions[bot] 7b5bd335d5
chore: update Quarkus platform version to 3.1.2.Final (#1816)
Co-authored-by: Knative Automation <automation@knative.team>
2023-06-21 18:16:34 +00:00
Thomas Risberg 339608a733
Update springboot template pom.xml dependencies (#1807)
- update to use spring-cloud.version 2022.0.3
- remove springboot.platform.version property, not needed, rely on parent version
- remove import scope and pom type from spring-boot dependencies
2023-06-14 17:02:46 +00:00
Sascha Grunert 529957e837
Cleanup Rust cloudevents example (#1799)
By:

- Using a more opinionated release profile to optimize binary
- Removing not required dependencies
- Updating the rest of the dependencies
- Switch to Rust edition 2021
- Cleanup imports by importing the concrete types
- Avoid unnecessary type assertions
- Do not unwrap port

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-10 03:32:59 +00:00
Sascha Grunert 44978970f6
Cleanup Rust http example (#1798)
By:

- Using a more opinionated release profile to optimize binary
- Removing not required dependencies
- Updating the rest of the dependencies
- Cleanup imports by importing the concrete types
- Avoid unnecessary type assertions
- Do not unwrap port

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-06-09 13:10:59 +00:00
github-actions[bot] 0cce3f01ce
chore: update Quarkus platform version to 3.1.1.Final (#1793)
Co-authored-by: Knative Automation <automation@knative.team>
2023-06-07 17:47:57 +00:00
Luke Kingland 7175a554ff
feat: source-defined buildpacks (#1774)
Allows buildpacks to be updated by updating to a newer version of
func.  Previously, buildpacs were fixed at time of function creation
without a manual edit of func.yaml.  Currently using Go as the reference
implementation in this commit.
2023-06-05 09:49:41 +00:00
github-actions[bot] 70fd17642e
chore: update Springboot platform version to 3.1.0 (#1763)
Co-authored-by: Knative Automation <automation@knative.team>
2023-05-27 00:42:26 +00:00
ningyan325 f528a70881
Automated platform update for springboot templates (#1762)
* initial chg

* fix parent version selection

* change from `false` to false

* move platform checking as first task in main

* re-make generate/zz_filesystem_generated.go

* fixes of spaces in code at line 105, in following lint rules
2023-05-26 21:51:26 +00:00
github-actions[bot] 2656a7e910
chore: update Quarkus platform version to 3.0.4.Final (#1758)
Co-authored-by: Knative Automation <automation@knative.team>
2023-05-25 13:41:25 +00:00
Luke Kingland 530ea4fe53
feat: write instanced and static scaffolding (#1732) 2023-05-18 20:03:14 +00:00
Matej Vasek b04fe51796
chore: remove Procfile from Rust templates (#1736)
It appears that the file is no longer needed.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-05-10 18:07:01 +00:00
github-actions[bot] f99e074690
chore: update Quarkus platform version to 3.0.3.Final (#1734)
Co-authored-by: Knative Automation <automation@knative.team>
2023-05-10 17:31:01 +00:00
Matej Vasek dc3a85112c
chore: update maven wrapper in Quarkus template (#1721)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-05-04 19:50:57 +00:00
github-actions[bot] e014de5820
chore: update Quarkus platform version to 3.0.2.Final (#1720)
Co-authored-by: Knative Automation <automation@knative.team>
2023-05-04 19:13:57 +00:00
Matej Vasek 818c5ae20a
fix: Quarkus template Integration Tests (#1714)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-28 17:14:51 +00:00
github-actions[bot] 46076a581d
chore: update Quarkus platform version to 3.0.1.Final (#1706)
Co-authored-by: Knative Automation <automation@knative.team>
2023-04-27 12:53:32 +00:00
Lance Ball 177c15bfb3
feat: custom health checks for node and typescript (#1682)
* feat: custom health checks for node and typescript

This commit bumps the faas-js-runtime for Node.js and TypeScript
dependencies to version 1.1.0, which includes an API allowing function
developers to override the liveness and readiness checks for their
functions.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-04-25 06:31:44 +00:00
Lumír 'Frenzy' Balhar 36d7b23b66
Add Python templates for gunicorn and uwsgi + Flask (#1655)
* Add Python templates for gunicorn and uwsgi + Flask

These templates represents the most common and simple ways
how to implement FAAS in Python either directly via gunicorn
or using Flask and uwsgi.

* feat: runtime envvar definition in templates

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

* fixup: use APP_MODULE not app.sh

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

* fixup: update docs

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

* test: better diffing in tests

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

* fixup: update tests

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

* fixup: style

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
2023-04-10 19:03:48 +00:00
Matej Vasek ae1b0c5eef
fix: actix listent on 0.0.0.0 (#1664)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-01 14:57:01 +00:00
Andrejus Chaliapinas c6c0f7eb66
Update Rust templates dependencies and UTs for Actix 4.x (#1661) 2023-03-31 15:57:01 +00:00
andrejusc 79430e9542
Update springboot templates to Spring Boot 3.0.5 (#1658)
* Update springboot templates to Spring Boot 3.0.5

* Regenerated embedded file

* Regenerated embedded file one more time
2023-03-30 21:53:00 +00:00
github-actions[bot] 6a4518454b
chore: update Quarkus platform version to 2.16.5.Final (#1646)
Co-authored-by: Knative Automation <automation@knative.team>
2023-03-23 18:56:53 +00:00
Manoel Marques f2238be7ed
Correctly format Node.js code (#1602) 2023-03-08 12:17:20 +00:00
Lance Ball c20c887cd2
chore: update faas-js-runtime to 0.10.0 (#1570)
* chore: update faas-js-runtime to 0.10.0

Fixes: https://github.com/nodeshift/faas-js-runtime/issues/120

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: try ignoring package-lock.json files in linter

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: actually add package-lock.json

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: better globbing

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: best globbing

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-02-20 20:32:25 +00:00
Matej Vasek 6d4565158b
feat: enabled s2i for python (#1562)
* feat: enable s2i for python

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

* fixup: update zz_filesystem_generated.go

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

* fixup: test

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

* fixup: test

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

* fixup: test

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

* fixup: script

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

---------

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-02-20 16:45:26 +00:00
Lance Ball ab194d421d
feat(templates): remove liveness and readiness from defaults (#1555)
* feat(templates): remove liveness and readiness from defaults

The liveness and readiness URLs are defined in code as defaulting to
`/health/liveness` and `/health/readiness` respectively. The deploy
command handles these defaults without requiring them to exist in the
`func.yaml` file. Existing tests for defaults and overrides already
exist, so this change does not require additional tests to be included.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove default endpoints from repository.go

Signed-off-by: Lance Ball <lball@redhat.com>

---------

Signed-off-by: Lance Ball <lball@redhat.com>
2023-02-16 08:23:51 +00:00
Zbynek Roubalik 5a4803bf95
chore: refactor repository layout (#1554)
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
2023-02-15 08:46:52 +00:00
github-actions[bot] 34fed117bc
chore: update Quarkus platform version to 2.16.2.Final (#1538)
Co-authored-by: Knative Automation <automation@knative.team>
2023-02-08 20:29:46 +00:00
github-actions[bot] 6a5655ef91
chore: update Quarkus platform version to 2.16.1.Final (#1531)
Co-authored-by: Knative Automation <automation@knative.team>
2023-02-07 21:31:47 +00:00
github-actions[bot] 53339454f3
chore: update Quarkus platform version to 2.16.0.Final (#1521)
Co-authored-by: Knative Automation <automation@knative.team>
2023-01-27 17:47:40 +00:00
Thomas Risberg d090d5dd5e
Update springboot templates to Spring Boot 3.0.2 (#1509)
- add needed buildEnv properties
- add class to register runtime hints for MessageUtils.MessageStructureWithCaseInsensitiveHeaderKeys
- update README files
- update unit tests to use Java 17

Signed-off-by: Thomas Risberg <trisberg@pivotal.io>

Signed-off-by: Thomas Risberg <trisberg@pivotal.io>
2023-01-24 15:16:38 +00:00
Luke Kingland ed7592cd6b
chore: re-bump springboot template versions (#1511) 2023-01-20 09:57:02 +00:00
Luke Kingland 554e74a309
chore: remove underscore prefix from test packages (#1503)
* remove underscore prefix from test packages

* springboot patch attempt
2023-01-20 09:01:02 +00:00
Thomas Risberg 63aab77884
Update Spring Boot to 2.7.7 (#1502)
* Update Spring Boot to 2.7.7

- also add function-template springboot.md doc

Signed-off-by: Thomas Risberg <trisberg@pivotal.io>

* Fix lint errors

Signed-off-by: Thomas Risberg <trisberg@pivotal.io>
2023-01-18 19:30:03 +00:00
Lance Ball 7b1e0c0f99
deps(node,typescript): update dependencies (#1468)
Updates dependencies in Node.js and TypeScript functions to eliminate
some security warnings and bump to faas-js-runtime 0.9.7, which allows
for ESM modules now.

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2023-01-16 02:33:53 +00:00
github-actions[bot] 9edb8739cb
chore: update Quarkus platform version to 2.15.3.Final (#1491)
Co-authored-by: Knative Automation <automation@knative.team>
2023-01-11 14:05:49 +00:00
github-actions[bot] 07fa54444c
chore: update Quarkus platform version to 2.15.2.Final (#1483)
Co-authored-by: Knative Automation <automation@knative.team>
2023-01-05 12:49:19 +00:00
github-actions[bot] 78ce7ffc86
chore: update Quarkus platform version to 2.15.1.Final (#1478)
Co-authored-by: Knative Automation <automation@knative.team>
2023-01-04 13:09:18 +00:00
github-actions[bot] c799e47318
chore: update Quarkus platform version to 2.15.0.Final (#1473)
Co-authored-by: Knative Automation <automation@knative.team>
2022-12-15 16:22:51 +00:00
github-actions[bot] 2e03ee015e
chore: update Quarkus platform version to 2.14.3.Final (#1456)
Co-authored-by: Knative Automation <automation@knative.team>
2022-12-09 15:11:17 +00:00
github-actions[bot] 1a210c8802
chore: update Quarkus platform version to 2.14.2.Final (#1447)
Co-authored-by: Knative Automation <automation@knative.team>
2022-11-28 17:37:13 +00:00
github-actions[bot] cef8691981
chore: update Quarkus platform version to 2.14.1.Final (#1435)
Co-authored-by: Knative Automation <automation@knative.team>
2022-11-17 20:43:39 +00:00
David Fridrich 13fde9025d
feat: Change Invocation.format to Invoke (#1415)
* test1

* d

* templates/* manifest remove http

* docs fix

* migration test a template tests

* docs func_run

* docs last

* misspell

* suggested changes

* def http

* zz

* zz

* change invocation struct name

* zz file
2022-11-11 11:20:19 +00:00
Lance Ball 06693859be
enhancement(templates): use latest faas-js-runtime + cloudevents (#1422)
* enhancement(templates): use latest faas-js-runtime + cloudevents

Better typing of handle functions and return values for typescript based functions.

/kind enhancement

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: improvements

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: missing FUNC_LOG_LEVEL

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-11-10 12:59:15 +00:00
github-actions[bot] a4a09fd129
chore: update Quarkus platform version to 2.14.0.Final (#1421)
Co-authored-by: Knative Automation <automation@knative.team>
2022-11-09 16:13:15 +00:00
github-actions[bot] f8b3197605
chore: update Quarkus platform version to 2.13.4.Final (#1417)
Co-authored-by: Knative Automation <automation@knative.team>
2022-11-08 20:27:20 +00:00
Lance Ball 64e7452c9a
chore(deps): update node and typescript deps (#1394)
Eliminates some security issues found by dependabot and bumps to latest faas-js-runtime. Also cleans up the typescript code to be slightly less ugly.

/kind chore

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-10-31 21:59:12 +00:00
github-actions[bot] 236d66becd
chore: update Quarkus platform version to 2.13.3.Final (#1362)
Co-authored-by: Knative Automation <automation@knative.team>
2022-10-19 20:49:11 +00:00
github-actions[bot] 9071312b5b
chore: update Quarkus platform version to 2.13.2.Final (#1348)
Co-authored-by: Knative Automation <automation@knative.team>
2022-10-17 16:17:10 +00:00
Lance Ball 5adec03c7b
chore: update all references to kn-plugin-func (#1311)
* chore: update all references to kn-plugin-func

I did not change references in CHANGELOG.md but otherwise, I believe
this should cover all configuration settings, image names, package
names, etc.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix instances_test.go

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: still some stray kn-plugin-func

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
2022-10-13 16:31:53 +00:00
github-actions[bot] 7bd95e5d54
chore: update Quarkus platform version to 2.13.1.Final (#1302)
Co-authored-by: Knative Automation <automation@knative.team>
2022-10-06 18:26:32 +00:00
Ali Ok 1a6c42f01b
Fix a typo in Quarkus template README.md (#1296)
* Update README.md

* fixup: updated zz_filesystem_generated.go

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

Signed-off-by: Matej Vasek <mvasek@redhat.com>
Co-authored-by: Matej Vasek <mvasek@redhat.com>
2022-10-05 12:45:29 +00:00
github-actions[bot] ecd75430a1
chore: update Quarkus platform version to 2.13.0.Final (#1290)
Co-authored-by: Knative Automation <automation@knative.team>
2022-10-04 14:01:29 +00:00
github-actions[bot] 74b57c2a65
chore: update Quarkus platform version to 2.12.3.Final (#1267)
Co-authored-by: Knative Automation <automation@knative.team>
2022-09-20 21:01:09 +00:00
github-actions[bot] e21ce5b44f
chore: update Quarkus platform version to 2.12.2.Final (#1236)
Co-authored-by: Knative Automation <automation@knative.team>
2022-09-13 23:51:47 +00:00
github-actions[bot] 58a6d07fe6
chore: update Quarkus platform version to 2.12.1.Final (#1221)
Co-authored-by: Knative Automation <automation@knative.team>
2022-09-08 18:47:20 +00:00
github-actions[bot] f4a410ab0f
chore: update Quarkus platform version to 2.12.0.Final (#1208)
Co-authored-by: Knative Automation <automation@knative.team>
2022-08-31 16:06:18 +00:00
Gunjan Vyas 02c0ae775d
chore: update rust dependencies (#1201) 2022-08-30 17:05:16 +00:00
github-actions[bot] b3ced5ebd5
chore: update Quarkus platform version to 2.11.3.Final (#1187)
Co-authored-by: Knative Automation <automation@knative.team>
2022-08-24 14:21:32 +02:00
Gunjan Vyas e465348210
chore: update springboot dependencies (#1183) 2022-08-23 12:05:17 +00:00
github-actions[bot] 849c2cd7a1
chore: update Quarkus platform to 2.11.2.Final (#1157)
Co-authored-by: Knative Automation <automation@knative.team>
2022-08-08 14:17:24 +00:00
Jefferson Ramos f72b23fe76
doc: fix doc reference on nodejs template (#1154) 2022-08-04 14:35:21 +00:00
Matej Vasek a906b8866c
chore: update Quarkus templates to 2.10.3.Final (#1132)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-07-20 17:24:01 +00:00
Lance Ball 29f3aadb47
chore: update node and typescript dependencies (#1110)
This commit updates both the Node.js and TypeScript cloudevents
templates to use the most recent version of the CloudEvents module, and
bumps transitive dependencies that needed updates via `npm audit fix`.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-07-14 08:02:14 +00:00
Matej Vasek d4f96bb694
Preserve func.yaml for Quarkus BP build (#1092)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-06-30 18:29:31 +00:00
Daniel 5f8c01829e
feat: introduce echo return for Python http template (#1078)
* Introduce echo return for Python http template

* Updated tests and regenerated zz* file

* Updated output to dict-only

* Changed output type from Python dict literal to proper JSON
2022-06-28 16:21:30 +00:00
Matheus Cruz f828b0998c
feat: add echo for springboot http template (#1072)
* feat: add echo func

* chore: package

* docs: update docs

* refactor: add space between headers

* refactor: regenerate zz file

* refactor: clean with pre-commit

* refactor: add func_yaml-schema.json file

* refactor: rename test and fix white-spaces

* refactor: remove .idea files

* test: change http test

* test: change expected result
2022-06-17 17:05:18 +00:00
Matej Vasek 041bb9fd66
Make JS/TS Function templates async by default (#1020)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-05-27 16:03:09 +02:00
Luke Kingland 867d4c26d6
feat: improved invoke verbosity (#1007)
* feat: improved invoke verbosity

* e2e test updates

* regen filesystem

* e2e tests: add to query what is expected as an echo
2022-05-11 19:16:35 +00:00
Matej Vasek 8949484ffb
Update S2I envvars to work with fast-jar (#1012)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-05-10 18:21:33 +00:00
Matej Vasek 5ac6c25a4a
User fast-jar packaging for Quarkus (#1009)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-05-09 15:37:33 +00:00
Matej Vasek 8661253be6
Remove unnecesary files from Java template (#1008)
* Remove unnecesary files from Quarkus template

The jar will be automatically downloaded first time maven wrapper is used.

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

* Remove unnecesary files from Sprint Boot templates

The jar will be automatically downloaded first time maven wrapper is used.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-05-06 15:06:29 +00:00
Lance Ball 31c1d66eb3
chore: use paketo builders for all runtimes (#1001)
All runtimes were actually using paketo builders already, but the
builders were still being explicitly set in manifest.yaml instead of
existing as a default in builder.go like all of the others.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-05-06 01:23:28 +00:00
Thomas Risberg a694cf54b3
Update spring boot cloud and native versions (#999) 2022-04-30 17:00:55 +00:00
Lance Ball 83c081d34a
chore(deps): bump faas-js-runtime version (#1000)
* chore(deps): bump faas-js-runtime version

There were a couple of bug fixes in the latest release. This commit
picks those up for functions projects in JavaScript and TypeScript.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update package-lock.json for node/typescript tmpls

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-29 13:08:54 +00:00
Luke Kingland 397ce65598
feat: s2i builder quarkus support (#993)
* feat: s2i builder quarkus support

* use manifest for quarkus s2i build envs
2022-04-27 00:40:56 +00:00
Matej Vasek bed3dfc9f6
Paketo BuildPack for Quarkus (#985)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-20 19:26:29 +00:00
Lance Ball 5af934be8d
feat: enable Paketo builders for Python functions (#979)
This commit changes the Python functions to use the open source Paketo
builders. The Paketo builders allow the use of a Procfile to indicate
the desired default start process for the container, so this has been
added to invoke Parliament at startup.

Also, there were no README.md files for Python, so I added them too.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-20 00:09:28 +00:00
Jefferson Ramos 01f113969a
CI enhancements (e2e tests) and Go template fix (#970)
* Adding timeout and additional logs on e2e http test

* Better revision check on e2e http update test

* ci: Adding workflow to run e2e for all runtimes

* fix: server error 500 for Go cloudevents template
2022-04-19 14:18:28 +00:00
Luke Kingland 3be1a77388
feat: s2i builder typescript support (#957) 2022-04-14 10:48:10 +00:00
Lance Ball 13d4222461
feat: make templates consistent across runtimes (#948)
* fix: make templates consistent across runtimes

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/572

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: review feedback

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix embedded fs

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-08 11:28:46 +00:00
Matej Vasek 1ee9fa163b
Update spring-boot in templates (#947)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-04-06 18:11:45 +00:00
Luke Kingland a91bcc5fcf
feat: s2i builder with preliminary node support (#923)
* fix: stuck build ticker

* feat: s2i builder prototype

* default builders

* use s2i fork with updated docker

* in-code builder defaults

* s2i builder verbosity constructor arg

* typed errors

* typed error tests

* remove unneeded env code

* s2i build e2e test

* e2e tests

* update licenses

* cleanup

* codegen debug

* update licenses

* Revert "Update actions (#921)"

This reverts commit 8312b5c560.

* update licenses

* e2e test updates

* use GetDefaultDockerConfig for s2i config

* docker.NewClient docs
2022-04-05 13:08:44 +00:00
Lance Ball 4a4cebb1ea
fix: apply updated spring-boot-function dependency (#936)
This commit updates the spring-boot-function dependency explicitly as there
is not yet a CVE fix for spring-cloud 2021.0.1.

```
❯ ./mvnw clean install dependency:tree | grep spring-cloud-function
[INFO] |  +- org.springframework.cloud:spring-cloud-function-web:jar:3.2.2:compile
[INFO] +- org.springframework.cloud:spring-cloud-function-context:jar:3.2.3:compile (optional)
[INFO] |  +- org.springframework.cloud:spring-cloud-function-core:jar:3.2.2:compile (optional)
```

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/929
Fixes: https://spring.io/blog/2022/03/29/cve-report-published-for-spring-cloud-function

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-04 16:52:43 +00:00
Thomas Risberg 9a6aaa5474
Support using 'func invoke' for springboot templates (#920)
* Support using 'func invoke' for springboot templates

- add README notes for using 'func invoke' to springboot templates
- update ce-type used for cloudevents template tests

* Re-generate zz_filesystem_generated.go after rebase
2022-03-23 09:31:18 -07:00
Thomas Risberg 03e53287d1
Update springboot http template (#914)
- http should match cloudevents template
- update Spring Boot version
- update README for cloudevents template
2022-03-22 08:31:12 -07:00
Lance Ball 166313b541
improve template comments for Node.js and TypeScript (#902)
* improve template comments for Node.js and TypeScript

See: https://github.com/knative-sandbox/kn-plugin-func/issues/572

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add zz_ file

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace

Signed-off-by: Lance Ball <lball@redhat.com>
2022-03-15 15:36:59 -07:00
salaboy 57909f71fe
Updating to latest spring cloud release and refactoring code (#838)
* updating to latest spring cloud release and refactoring code

* new health endpoints

* implementing simplified echo function in template

* adding banner

* adding NL at EOF

* updating native to release

* fixing trailing whitespace

* adding invocation back

* adding Newline

* whitespaces

* fix lint and regenerate

* regenerate zz filesystem after rebase
2022-03-11 07:22:32 -08:00
Matej Vasek fa17dc9e4b
Update wrt switch from pkger to custom ZIP pkging (#889)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-09 17:39:46 -08:00
salaboy b97fe9c4ec
Adding sample function in go template (#840)
* adding sample function in go template

* adding simple echo, using the correct signature

* fixing readme
2022-03-01 07:38:42 -08:00
Helio Frota efc3b208cb
fix: minor typos in docs (#862) 2022-02-23 07:25:39 -08:00
Lance Ball ad42f3a258
chore: update manifest.yamls (#846)
* chore: update manifest.yamls

In a couple of cases, the `invoke` parameter was missing. And there was an
outdated use of a typescript buildpack in the typescript/cloudevent templates.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: I should set VSCode to autosave on focus change

Signed-off-by: Lance Ball <lball@redhat.com>
2022-02-22 09:10:04 -08:00
Matej Vasek 5fad42ba55
Update python builder version (#845)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-02-22 08:17:03 -08:00
Lance Ball b8370c139e
chore: bump node builder to latest (#826)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-02-11 05:54:17 -08:00
Matej Vasek b4e6318ce5
chore: update boson builder image references (#810)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-02-02 05:06:33 -08:00
Lance Ball ece9ac3645
fix: use paketo base image for springboot (#792)
The build actually seems to require `base` vs `tiny.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-27 09:26:47 -08:00
Lance Ball 6097b8d790
fix: use domain qualified registry for springboot (#789)
* fix: use domain qualified registry for springboot

The builder image name should include the registry name. Also it seems
that the tiny builder doesn't actually work. We need base.

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/775

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: regenerate pkged.go with go 1.17

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-26 11:28:45 -08:00
Luke Kingland e918f74b9e
feat!: invoke (#705)
* feat!: rename 'emit' to 'invoke' and default to local

This commit renames 'func emit' command to 'func invoke' and makes the
default behavior to send an event to localhost. The special '--sink'
value 'local' is changed to 'cluster' to indicate that the function
should be invoked on the cluster instead of locally. All other behavior
has remained the same.

BREAKING CHANGE

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update commands.md doc

Signed-off-by: Lance Ball <lball@redhat.com>

* squash: change Emitter interface to Invoker

Changes Emit() to Send() in the (now named) Invoker interface, and changes
Emit() to Invoke() in the client.

BREAKING CHANGE

Signed-off-by: Lance Ball <lball@redhat.com>

* squash: use a common Invoker interface for HTTP and events

Signed-off-by: Lance Ball <lball@redhat.com>

* checkpoint

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: change Emitter to EventInvoker

Signed-off-by: Lance Ball <lball@redhat.com>

* Invoke v2 Draft

* feat: client invoke function

* static invoke defaults and methods

* remove assimilated invoker package

* includes an ignored .func directory on create

* Instances manager with local and remote defaults

Funciton Info is now Instance, representing a Function in a given
environment.

Describing a Function instance is now Instances().Get(f, environment)

Moves Runner to be async with a Stop method to enable returning runtime pid
and port for persisting.

Instances now have a place for primary Route in addition to all routes slice

Running Functions write PID and Port to .func

* cascading targets: local vs remote vs ad-hoc endpoint

* runner start signals and cancel cleanup

* return run on context done or err on channel

* async runner

Refactors the image runner to start the container asynchronously,
reporting back the port on which it started.  Errors are communicated
back via a provided channel and stop is signaled using context
cancelation.

* pid neither required nor available

* add withTransport option

Incorporates addition of custom transport of the emitter into the
renamed version invoker. Flag and help text cleanup.  Re-additionof the
Info accessor.

* schema now includes invocation data

* loop build msg

* run jobs

Externally exposed port is now chosen based on availability, with 8080
preferred and falling back to an os-chosen open port.
The Client Run method is now async, returning the port assigned to the
running Function, a stop/cleanup function and a runtime errors channel.
The Runner is internally divided into the runner and its started Jobs.

* job metadata

Extracts job metadata tracking to a Job object in the core,
Handles multiple instances of the same Function by creating a single
file for each instances in .func/instances/<port>

* remove superfluous error types and flag bindings

* feat: enable invoke target remote

* feat: preferentially invoke local, remote if running

* feat: read --file for invoke

* feat: invoke confirm prompts

* fixup cli tests

- Updates to handle asynchronous Runner
- Standardize on the naming convention for selective running

* docker runner tests and lint errors

* test refactor

* feat: invoke format override

* comments, spelling and other cleanup

* invoke command doc

* feat: invoke format interactive option

* rename runjob.go to job.go

* e2e test flag update

* test naming homoginization

* silence build activity messages when verbose

* test debugging

* code review updates

- return Job from Client.Run rather than constituent members
- Treat .gitignore as contentious, punting on feature to mutate if
  extant.
- docs wording changes
- add invocation format to pertinent manifest.yaml files

* help text spelling etc.

Co-authored-by: Lance Ball <lball@redhat.com>
2022-01-21 12:04:05 -08:00
Luke Kingland 4504b21369
src: simplify go templates (#741) 2022-01-10 13:59:12 -08:00
Fabian Lopez 866728dbc0
mitigate log4j dependency vulnerability (#723)
* mitigate log4j dependency vulnerability

* bump log4j version to 2.16.0

* update pkged.go

* manually fix pkged.go annotation

* Revert "manually fix pkged.go annotation"

This reverts commit dc67a48185.

* fix pkged.go

* podman test trigger

* e2e test trigger
2021-12-16 03:32:17 -08:00
Lance Ball d7cfe6ead7
feat: add telemetry to Node.js and TypeScript function templates (#719)
* feat: add telemetry to Node.js and TypeScript function templates

This commit pulls in the latest version of faas-js-runtime which supports
metrics exposed at /metrics. Also, concidentally, adds CloudEvent batch
support, so Node.js and TypeScript functions may be invoked with a set of
more than one event simultaneously.

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/710

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: regenerate and commit pkged.go

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove stray go.sum and update pkged.go file

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: try to make knative code style happy

Signed-off-by: Lance Ball <lball@redhat.com>

* Revert "fixup: try to make knative code style happy"

This reverts commit 91d625be7b.

* fixup: update package-lock.json files

Signed-off-by: Lance Ball <lball@redhat.com>
2021-12-15 03:00:29 -08:00
Matej Vasek 834e8ae46c
fix: use specific version of paketo builder (#670)
For some reason latest version is not working with node.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-11-18 14:40:22 -08:00
Lance Ball 3935747b91
chore: use buildEnvs instead of custom buildpack (#663)
The TypeScript templates have been using a small buildpack from the boson
project. The sole purpose of the buildpack was to run the `npm run build`
command so that a TypeScript project would be transpiled before deployment.

The Paketo buildpack for Node.js supports using environment variables at
build time to enable additional scripts to be run, such as `build`. Prior
to the addition of `buildEnvs` by @salaboy in
https://github.com/knative-sandbox/kn-plugin-func/pull/646 it was not
possible to set this value for TypeScript projects. That new feature allows
us to stop using the small buildpack from boson.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-11-16 17:37:33 -08:00
salaboy c70a21e9a4
feat: make SpringBoot template SpringNative by default (#649)
* move springboot template to use springnative

* improving templates to use spring-cloud-deps and ce-type routing

* updating readmes

* removing trailing spaces and adding newline at EOF
2021-11-16 10:31:53 -08:00
Shashank Sharma dc0f0c1289
MethodNotAllowed for rust cloudevents template (#639) 2021-11-08 11:32:42 -08:00
Lance Ball c810efc7a4
fix: remove stray manifest.yaml files (#628)
Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/626

Signed-off-by: Lance Ball <lball@redhat.com>
2021-11-05 12:07:12 -07:00
Lance Ball e319ea3b62
feat: add support for manifest.yaml at repo/language/template levels (#558)
* feat!: add support for manifest.yaml and runtime.yaml

BREAKING CHANGE
This commit adds the concepts of a manifest.yaml file at the top level
of a template repository, and a runtime.yaml file for each language/runtime
within the repository. Prior to this, repository metadata was primarily
restricted to information that could be gleaned from the file system, such
as the directory name used as the Name.

A manifest.yaml file contains a Name, URL, Version, and a list of supported
runtimes; and if all of the runtimes expose the same health endpoints, these
can be set here.

Within a runtime directory, there may exist a runtime.yaml file which allows
language pack providers to set the health endpoints, overriding the values
set in manifest.yaml, as well as Builders and Buildpacks.

This change removes support for a builders.yaml file in a runtime/template
directory, as this was guaranteed to be redundant with the builders.yaml
file in a sibling template directory. The choice was to move these up a
level to runtime/runtime.yaml.

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: bump go version for unit tests

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: using go 1.16 now requires 'go mod tidy'
See: https://golang.org/doc/go1.16

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: restore support for directory traversal

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace linting

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update func_yaml-schema.json

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: spelling errors caught by reviewdog

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: use os.ReadDir

Signed-off-by: Lance Ball <lball@redhat.com>

* squash: restore project creation from remote repos

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove billyFilesystem

Signed-off-by: Lance Ball <lball@redhat.com>

* doc: expand on language pack documentation

Adds more detail around how language packs can be provided by third
parties, and the expected structure and metadata required.

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/452

Signed-off-by: Lance Ball <lball@redhat.com>

* doc: update language pack documentation

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: cleanup deps

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: cleanup deps - again

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: reviewdog whitespace cleanup

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: custom repo template listing

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: bump go version for integration tests

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust test-templates repo uri for e2e

Signed-off-by: Lance Ball <lball@redhat.com>

* fix: don't fail when extended templates don't support a given runtime

Signed-off-by: Lance Ball <lball@redhat.com>

* src: repo and template type hierarchy

As the client API increases in complexity, upgrading to a more correct
type hierarchy for the object managers serves to keep things clean.  In
this update, the Repository and Templates manager now use constructors
with private members, including a backreference to the root Client
object, which provides the mangers with full access to the current
client instance API for implementing their (growing) features.

* src: template manager writes

The templateWriter struct has now been upgraded to integrate with the
newly-added type system which includes a Templates Manager by adding a
.Write method which writes a template at the given location.  This
encapsulation of the write functionality moves us towards having a
cleaner abstraction atop writing any template to disk from any
repository.

In addition, the "Get" prefix was removed from many accessor methods, as
this is standard a Go idiom.

* src: templates write including denormalize

- merges templateWriter into templates manager
- denormalization of builders, health endpoints etc. made part of .Write
- write logic now works on a Template rather than string paths etc

The templates manager can now write out a template given a function directy.
Included internnaly to write is the denormalization logic, which is now closer
to where it is used, which should improve cohesion and decouple the template
implementation detail from the Client. Also moves the write logic closer to the
template itself, with the expectation the same will happen for functions when
Config and Function are merged.

* src: vendor

* src: merge manifests into domain model

In general, the manifests sytsem is merged more tightly into the overall
system while also expalding it to use a path to templates to avoid
having to create a full filesystem shadow-copy in yaml. Preserves
backwards-compatiblity by keeping the base case a yaml-free repo of only
templates.  Creaets a hierarchical inheritance from repository to
runtime to template for builders, endpoints etc.  whcih allows for the
manifest within templates to be a first-class citizen, though its use
will be rather rare.  Some more in-depth explanations of the more
substantive changes are as follows:

- Merges Manifest with Repository

The Manifest structure is essentially a serialized Repository, so they
are now the same object.

- Converts repo URL to a calculated field

The URL is informative and entirely dependent on the current state of
the repo, so it should be calculated to avoid confusion and avoid being
serialized to the manifest.

- Merge FunctionTemplate with Template

The struct being serialized here is a Template, so they are now the same object

- Extracts new "BuildConfig" embedded struct

The Builders and Buildpacks members are shared between Repository,
Runtime and Template, so they are now an embedded stuct in the same
manner as HealthEndpoints.

- yaml 'inline' declaration for embedded structs

The HealthEndpoints and other embedded structs were not actually being
read from their configs because of a nuance of yaml which (in contrast
to json unmarshallers) requires the `,inline` tag on the struct member
to trigger inclusion in decode.

- Replaces Repository's runtimes member with templates

While it is true that on disk templates are subdivided into their
effective runtime, this is for ease of development.  The logical
structure is: repositories have templates.  Templates are applicabe to
runtimes.  Therefore the correct API is to have templates a direct
member of repository but requiring a runtime filter for access.

- Use repository templates path instead of full list

The goal is to support the use of repositories which contain more than
just templates.  The solution is to define an alternate location for
templates (such as ./templates).  Creating an entire exhaustive manifest
where each runtime and each template is defined with a name and path is
a usurpation of the responsibilities of a filesystem, and causes
unintend negative knock-on effects.  Let's try this simple solution
before jumping to the nuclear option of defining a filesystem-in-yaml.

- Use filesystems when loading repository objects

The fact that a file exists on the disk, embedded, or remote should be
of no concern to most of the code.  This is accomplished by using the
filesystem abstraction which is used during template writing.  This will
be further improved in future versions by upgrading to use the fs.FS
interface and tooling.

- Uses manifest.yaml at all levels

Once the hierarchical nature of the manifest was instituted, it seemed
more intuitive to have the same filename at each level.  This also has
the nice benefit of being backwards-compatible with template-level
manifest.  This is not a correctness issue, but a guess that remembering
a single filename which can exist at different levels in a hierarchy is
easier to remember than different filenames, and its location in the
hierearchy sufficient differentiator making the different filenames
_perhaps_ unencssary.  The constants are left as separate for an easy
revert.

- Moves static defaults into code wherever possible

Wherever yaml was being statically compiled in, it was updated such that
canonical values for static defaults were defined on the Go structure,
with the yaml being for overrides.  For example Default Readiness and
Liveness endpoints.

Some notable benefits of letting the filesystem do it's thing:
* Preserves the ability to create a repository of templates without
  hacking yaml
* Reflects changes directly in IDEs which have native support for
  filesystem, not so for a proprietary manifest.yaml
* the builtin repository has no name, so parsing a manifest from within
  it is both prone to error and confusing, as it could lead future
  developers to submit PRs which change its name.

* fix: revert repository.git to a bare server repo

* src: repository default name

The Repository struct now includes a Name and DefaultName. The former is
the current name of the repository, and corresponds to the path on disk.
The latter is the name specified in the manifest.yaml, and is used as
the default name of the repository when no name is provided.

Fixes an issue where there could be name collisions using a uuid for the
initial name until the manifest is read in.

Restructures the embedded repositories such that one exemplifies a base
case repo with no metadata and only templates, the other specifying a
manifest to exemplify for example a complete language pack.

Adds a test such that all three cases are covered: explicit name, no
name but manifest-defined default name, URI-derived name.

* feat: single repo mode

Enables single repository mode suystem-wide, which fully implements the
logic intended by the WithRepository option.

The default repoisitory is now programatically defined, and while by
default is the embedded repo, it can be overriden using the
WithRepository option.  This keeps the logic internal to the
repositories managet, removeing the need for a crossp-cutting concern in
other parts of the system.

* src: manifest inheritance and existence tests

Respects alternate templates location when defined in a manifest.
Respects manifest embedded structs HealthEndpoints and BuildConfig at
each of the three levels, with inheritance:  Repo, Runtime and Template.
Separates test repositories into the two cases of a templates-only repo
(with no manifest) and a complex repo (with manifests) such as for
language packs.
Leaves the BuildConfig struct as inline but sets the HealthEndpoints as
being named, such that the latter has its fields in the yaml under the
key 'healthEndpoints' but the former does not (passthrough).
Adds error checks when attempting to access named repo when in
single-repo mode.

* src: remove function merge

Removes feature of mergine a func.yaml defined in a template in favor of
sticking with the manifest.yaml until such time as this is requested.
Assuming YAGNI.

* src: repo filesystems

- Embeds repositories with an internal filesystem
- Replaces filesystem disk checkouts with in-memory until final write
- Combines template Write of various types into a single write which uses the
  filesystem of the applicable templates's repository
- Template is now a simple noun, with logic localized to the templates manager
- Adds better error message regarding single repo mode conditions

The reason for replacing filesystem-based repository instances with in-memory
(especially remote for WithRepository mode) is for a few reasons:  First, 'Add'
will fail without using the temporary UUID hack if there already exists a
repository of the _repo_ name (due to a filesystem collision).  We have
to read the repo to determine the default name as well, so it's messy to avoid.
Second, using an on-disk version is potentially leaky because it may leave
files on the system in the event of a process interruption; able to be
mitigated, but with a likewise hacky use of a os temp directory.  Third, it
may cause racing conditions when using multiple instances the Client as a lib.
Lastly, it precludes our ability to run without touching the filesystm: a
useful mode when running as a pure library or in security-restricted
environments.

* fix: paths within embedded fs

* src: repositories code cleanup

* Removes the manual 0_18 version suffix
* Reanames "single" (uri for single-mode) to the more descriptive
  "remote" (with associated accessor api)
* Default repo name when no URI provided is set to default
* Various wording improvements in error text and comments

* src: error formatting

* feat: templates from local file paths

Adds back the local os filesystem as a fallthrough to support loading
template repositories from file:// paths on disk, without the
requirement that they also be git repositories.

* fix: clone once

Fixes the shortcut of performing a clone to read the manifest prior to
cloning the repository to disk.  This double-clone was replaced by a
single clone (applying the manifest) followed by a file copy from the
in-memory FS to the on-disk repository location.

* src: test fixes

* respect explict name on repository .Add
* fail if repository already exists
* update expected test filenames to new general (non-go-specific) setup
* adds the default repo name to the NewRepository constructor,
  internalizing the somewhat tricky default logic.
* move repo write logig to repo itself, as it will contain impl-specific
  nuances.
* invalid repo path is an error, but only if defined
* temporarily disable repository URL test

* src: update templates test to reflect new name 'cloudevents'

* src: fix go templates and repackage

* fixup: reviewdog spelling errors

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: reviewdog whitespace cleanup

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: run ./hack/update-codegen.sh

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: restore boson-project templates for e2e

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: do not error if default repo location does not exist

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: typo

Signed-off-by: Lance Ball <lball@redhat.com>

* paketo builder and paket community rust buildpack (#599)

* fixup: apply f161d50084

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update documentation to match impl

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: add git attributes to ignore linting on binary files

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: remove whitespace

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: tweak linter rules

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: tweak .gitattributes

Signed-off-by: Lance Ball <lball@redhat.com>

Co-authored-by: Luke Kingland <lkingland2038@gmail.com>
Co-authored-by: Shashankft9 <48708039+Shashankft9@users.noreply.github.com>
2021-10-27 07:09:01 -07:00
Lance Ball fb7504a900
src: improve usability of Node.js and TypeScript templates (#608)
* src: improve usability of Node.js and TypeScript templates

Fixes: https://github.com/knative-sandbox/kn-plugin-func/issues/596
Related: https://github.com/knative-sandbox/kn-plugin-func/issues/572

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: whitespace again

Signed-off-by: Lance Ball <lball@redhat.com>
2021-10-27 04:39:01 -07:00
Shashankft9 f161d50084
paketo builder and paket community rust buildpack (#599) 2021-10-25 05:57:38 -07:00
Matthias Wessendorf 7d78de98a8
chore: remove unused Context import (#570)
* 💄 Remove unused Context import

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* ♻️ regenerate pkged.go

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
2021-10-14 03:15:43 -07:00
Lance Ball 68b0904b17
feat!: rename event templates to 'cloudevents' (#584)
* feat!: rename event templates to 'cloudevents'

This commit renames the templates for cloudevents to be named "cloudevents".

BREAKING CHANGE

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: update commands.md doc

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: fix make test-templates

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: missed an e2e test change

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: gitignore and pkged.go

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: adjust Makefile recipe for pkged.go

Signed-off-by: Lance Ball <lball@redhat.com>
2021-10-13 14:19:42 -07:00
Matthias Wessendorf 52fb215c3c
chore: Cloudevents sdk 2.5.0 (#566)
* Bumping templates to 2.5.0

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>

* Bump the project to 2.5.0 as well

Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
2021-10-11 02:31:15 -07:00
Matej Vasek 4b47dbba78
Update Quarkus version in templates (#557)
* Update Quarkus version in templates

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

* Update Java to 11 in GH actions

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-09-27 14:33:13 -07:00
Luke Kingland 4fe9fdcab0
feat: create cli (#547)
* feat: create cli prompts

* feat: display effective runtimes in prompt

replaces the static list of supported runtimes with a dynamic list of
currently installed+available runtimes; called the effective runtimes.
Used for both prompting and validation.

* feat: dynamic create help and error text

Output from create help text and the create commands now show valid
options for both language runtimes and templates.

* feat: runtime tab completion for runtmes and templates

* feat: support FUNC_PARENT_COMMAND in help

* feat: confirmation of successful create

* fix: include name in initial creation

* src: remove unnecessary comments on create name

* fix: associate prompt questions with struct members in create

* e2e: update tests for language flag

* fix: support nonexistent repositories path

Listing installed repositories considers a missing path equivalent to a
lack of installed repositories.  This will change to an error when the
logic to determin default config directory, and automatically create
initial structure, is moved into the client library.

* fix: only CLI-validate when no repo override
2021-09-22 13:00:12 -07:00
Matej Vasek 16ee28c83d
fix: use full image names (#535)
This is useful when working with `podman` which dislikes short names.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-09-16 08:51:40 -07:00
Luke Kingland ae638c349c
feat: repository management cli (#514)
* feat: repository management cli

* src: cleanup imports, newlines, spelling and trailing whitespace
2021-09-09 08:09:00 -07:00
Luke Kingland 232101d83b
remove superfluous headers from go template (#515) 2021-09-08 04:41:34 -07:00