Commit Graph

117 Commits

Author SHA1 Message Date
Matej Vasek 819b433edb
feat: build for Linux ARM64 (#1123)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-07-18 19:56:59 +00:00
salaboy a454ea9ae9
chore: adds tests for springboot templates (#1059)
* adding tests for springboot templates

* adding test-springboot to test-template goals

* removing space

* removing vendor license
2022-06-14 17:24:16 +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
Lance Ball 00d5a82722
chore: add Apple M1 build in cross-platform target (#932)
* chore: add Apple M1 build in cross-platform target

Might fix: https://github.com/knative-sandbox/kn-plugin-func/issues/377

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

* fixup: review feedback/better names

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

* fixup: adjust release workflow

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

* fixup: remove duplicate

Signed-off-by: Lance Ball <lball@redhat.com>
2022-04-01 14:47:45 +00:00
Matej Vasek fe6d9f7d70
Improve cleanup recipes in Makefile (#887)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-09 12:17:49 -08:00
Matej Vasek cc049952bb
Generate templates zip unconditionally (#879)
* Improve formant performance in template generation

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

* Improve memory footprint of template generation

Use streamlined generation which is limiting need for in memory buffers.
Might be imprtant if we had big files in templates.

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

* Generate templates unconditionally

Rationale:
The way we create prerequisites (the find command) we cannot detect deleted files.
The generation is fast (around 500ms) so we can afford that.

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

* Test embbeded templates content on push to main

This has to run prior to `make test` because the `test` recipe
enforces generation of the templates zip.
This would prevent test from being run against git commited templates
zip.

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

* Optimization don't use unnecessary io.Pipe

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-06 14:28:35 -08:00
Matej Vasek c4a7e095de
Use custom zip embedding not pkger (#835)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-03-02 06:41:43 -08:00
Matej Vasek 663fd29b76
Windows unit test fixes (#860)
* force run of `make test`

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

* fix git file:// URIs

When using file:// forward slashes should be used.

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

* fix parsing of FS path from URI path

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

* disable some test on Windows

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

* fixup: style

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

* disable some test on Windows

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

* fix some tests for Windows

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

* disable some test on Windows

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2022-02-27 17:53:07 -08:00
Luke Kingland 64091fbc39
build pkged.go directly with make (#841)
Also removes the dependency on a modern bash when building on a stock OS
X box (which ships with a 15-year old version).
2022-02-21 11:06:03 -08:00
Lance Ball 2009073591
chore: change TAG to ETAG to avoid stepping on toes (#799)
Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-28 06:23:47 -08:00
Lance Ball 210cd9a199
chore: update Makefile and hack/release.sh to accept TAG (#797)
The upstream release pipeline does not tag the source until the build and
tests have successfully completed. This should allow for our release builds
to pick up the knative infra TAG environment variable when building releases.

Signed-off-by: Lance Ball <lball@redhat.com>
2022-01-28 05:45:47 -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
Zbynek Roubalik c7d18c89ed
fix: schema-generate should point to `function.go` (#677)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-11-29 05:36:04 -08:00
Luke Kingland aabc40a1cd
ci: func-local workflow golangci-lint to v1.43.0 (#652) 2021-11-12 01:56:36 -08: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 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
Markus Thömmes 163588f5a5
Add knative/hack scripts for updating deps (#534) 2021-09-19 16:04:33 -07:00
jrangelramos 5f843f09f6
test: separated with tags common language runtime e2e tests from othe… (#492)
* test: separated with tags common language runtime e2e tests from other e2e tests

* test: rewording e2e scripts and tags to better represent its purposes
2021-08-25 13:14:31 -07:00
Luke Kingland 3f56a8fd7a
feat: repository and templates client api (#475)
* feat: repositories accessor

* feat: repository and templates client api

- Templates management api
- Repositories management api expansion

* fix: nil pointer reference on generate

* src: remove unused test functions

* src: test temp directory name consistency and comment improvements
2021-08-24 10:41:24 -07:00
Matej Vasek 25b1d63b9c
fix: better cleanup before pkger run (#479)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-08-15 21:28:54 -07:00
Matej Vasek 84ff281bed
test: `config` sub-command (#457)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-08-12 06:30:35 -07:00
Luke Kingland 6ae2157549
feat: make func schema if config updated (#468)
Adds the config schema as integrated into the general build process.
Considers schema generation a prerequisite for building, peer to
such tasks as rebuilding pkged.go, but unlike pkged.go, is triggered
on a clean.  A missing schema file or modified config.go triggers
rebuild on make.
2021-08-10 09:44:59 -07:00
Zbynek Roubalik 8939f89bea
feat: generate json schema for func.yaml (#460)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-08-09 03:28:11 -07:00
Luke Kingland 92b309f791
build: remove pkged.go from make clean (#456) 2021-08-02 08:37:42 -07:00
Luke Kingland 435d1ac2a3
fix: unnecessary template repackaging (#449)
Removes python caches on template test.  This appears to be the original
cause of unnecessary rebuilds.

Adds pkger.go as an explict entry in the CODE prerequisite var.  This
ensures pkged.go is generated if it doesn't exist, and removes the need
to explicitly enumerate it as a prerequisite to other targets.

Adds pkger.go to the clean target.  This allows a 'make clean && make' to
work as one might expect.  For example ensuring a rebuild if a template
files is removed.

The notable conceptual change here is that this does not induce a build of
pkged.go by explicitly enumarating it as a prerequisite (a difficult
thing to get right, and prone to errors in the future), but rather
directly enumerates ./templates as its prerequisite.

Additional minor modifications include:
- regenerated pkged.go such that this takes effect for main on merge
- adds an explicit target for the 'func' binary and aliases 'build'
- Makefile help text cleanup and consolidation
2021-07-30 07:34:31 -07: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
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
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
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
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
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
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
Luke Kingland 87fd7babf1
chore: remove deprecated func image 2021-05-10 21:00:23 +09:00
Luke Kingland 11164bf8d9
build: create separate target for templates.tgz 2021-05-07 14:05:38 +09:00
Luke Kingland 1e3959c045
ci: go 1.16 compatiblity updates 2021-05-07 14:05:16 +09:00
Luke Kingland 63b7f11471
feat: create templates archive on go generate 2021-05-07 14:04:41 +09:00
Luke Kingland e44c1ad74c
src: remove pkger from make targets 2021-05-07 14:00:46 +09:00
Matej Vasek 2b5814c8c8
src: cleanup after test
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-05-06 15:04:12 +02:00
lkingland 255b4fb33c
Draft releases through synchronous tagging (#320)
* feat: synchronously tag releases

* fix: missing verbose version info in inter-release binaries
2021-04-27 17:06:39 -04:00
Lance Ball ce47370654
chore: fix versioning in CI builds (#290)
* chore: fix versioning in CI builds

For unknown reasons, the git tag for a release CI build via release-please
seems to happen after the build completes. It's a bit uncleear, but the
result is that we get v0.0.0 versions for released builds.

This commit modifies the Makefile to allow for an environment override of
the $VERS variable. Since the release-please-action documents `tag_name`
as output from the action, we can use this in CI to set the environment
variable.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-04-01 09:28:08 -04:00
Lance Ball 08f4fc7bd9
feat: add python templates (#286)
Signed-off-by: Lance Ball <lball@redhat.com>
2021-03-30 17:08:42 -04:00
Luke Kingland d915554d71
src: add makefile target 2021-03-10 19:35:27 +09:00
Luke Kingland ddf4ab86c4
feat: integration tests target 2021-03-10 19:35:27 +09:00
Luke Kingland f1a6561543
src: also package templates on 'go generate' 2021-03-10 19:35:27 +09:00
Lance Ball ed9a405604
chore: use 'npm ci' instead of 'npm install' for Node.js tests (#251)
This will ensure that package-lock.json is not updated with patch releases
unintentionally - that should be done with intent.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-12-11 10:01:05 -05:00
Lance Ball 99bee20639
chore: ensure that pkger is run when templates change (#239)
This commit adds `pkger` to the Makefile, ensuring that when any changes are
made in the `templates` directory it runs. For CI, I've added a download of the
`pkger` binary.

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

Signed-off-by: Lance Ball <lball@redhat.com>
2020-12-10 10:27:59 -05:00
Zbynek Roubalik 470ebb9da4
rename function -> func (#217)
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-06 12:47:30 +01:00
Zbynek Roubalik cd57692c9d
feat!: rename faas to function (#210)
* rename faas to function

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

* function.yaml -> func.yaml

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-11-06 10:41:42 +01:00
Matej Vasek b7670a3f7b
chore: run GH actions on Windows and macOS 2020-09-16 17:29:13 +02:00
Luke K 38d41baaa3
feat: golangci-lint allow enum shorthand, use config file 2020-08-31 17:10:08 +09:00
Luke K 4918cc7eef
feat: cli usability enhancements and API simplification 2020-08-29 01:54:13 +09:00
Lance Ball c0426b5a3c
test: add test targets for go and quarkus templates (#72)
This commit adds Makefile targets for go and quarkus, and includes these
in the regular `make test` target. I've also added a couple of entries to
.gitignore.
2020-08-19 07:56:35 -04:00
Lance Ball ea7fe15376
src(templates/node): update Node.js templates (#68)
This commit updates the Node.js templates to use the latest faas-js-runtime
framework, and fixes a couple of dependency issues and broken tests. I have
also added a build time test for these templates so that if/when they change
again, we can be sure to catch any problems.
2020-08-13 17:05:25 -04:00
Matej Vasek 11692f6bd3
chore: build static binary 2020-08-10 18:54:48 +02:00
Matej Vasek 382fcf8d1e
chore: add `-race` flag for tests 2020-07-30 16:01:25 +02:00
Luke K 653dec5eae
build: reduce build verbosity for cross-platform compilations 2020-07-29 16:04:09 +00:00
Luke K ebd2c11964
fix: build using environmentally-defined settings for GOOS and GOARCH by default 2020-07-29 16:03:17 +00:00
Matej Vasek 4677b3452f
chore: add lint to GH actions CI 2020-07-29 17:47:08 +02:00
Luke K c3d983907d
Merge remote-tracking branch 'markito/develop' into develop 2020-07-29 14:54:36 +00:00
Luke K cc016db990
build: update container latest tag when releasing 2020-07-28 14:52:49 +00:00
William Markito a39a57331f Fix ordering of platforms and set default to linux 2020-07-28 09:18:02 -05:00
Lance Ball 0810d9ace4
actions: add CHANGELOG.md and a release target to Makefile (#45)
This commit adds a `release` target to the Makefile, simplifying the generation
of the CHANGELOG.md (oh, this commit also adds a CHANGELOG.md). Invoke the
make target like so.

```sh
make release VTAG=v0.4.1
```

This will update the CHANGELOG with the commits included since the last
release, commit that change, and create the version tag. Then you just need
to push to github in order to publish the binary.
2020-07-28 09:14:45 -04:00
William Markito ce8448dde6 Adding multiple platforms to Makefile 2020-07-27 17:47:58 -05:00
Luke K cb0a74714c
enable build from tag 2020-07-08 12:22:27 +00:00
Luke K 287df42499
workflows 2020-07-08 09:41:46 +00:00
Luke K 161540c789
docker image 2020-07-08 03:08:30 +00:00
Luke K a232165688
make build with version tags 2020-07-08 02:32:35 +00:00