Skip to content

Commit

Permalink
rename faas to function
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
  • Loading branch information
Zbynek Roubalik committed Nov 5, 2020
1 parent 29ca077 commit b33329a
Show file tree
Hide file tree
Showing 35 changed files with 5,946 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/faas
/function
22 changes: 11 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ jobs:
- name: Lint
run: make check
- name: Permissions
run: chmod a+x faas_*amd*
run: chmod a+x function_*amd*

# Upload all build artifacts whether it's a release or not
- uses: actions/upload-artifact@v2
with:
name: OSX Binary
path: faas_darwin_amd64
path: function_darwin_amd64
- uses: actions/upload-artifact@v2
with:
name: Linux Binary
path: faas_linux_amd64
path: function_linux_amd64
- uses: actions/upload-artifact@v2
with:
name: Windows Binary
path: faas_windows_amd64.exe
path: function_windows_amd64.exe

# Build and push a latest image with each commit
- name: Image
Expand All @@ -57,7 +57,7 @@ jobs:
# The following steps are only executed if this is a release
- name: Compress Binaries
if: ${{ steps.release.outputs.release_created }}
run: gzip faas_darwin_amd64 faas_linux_amd64 faas_windows_amd64.exe
run: gzip function_darwin_amd64 function_linux_amd64 function_windows_amd64.exe

# Upload all binaries
- name: Upload Darwin Binary
Expand All @@ -67,8 +67,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./faas_darwin_amd64.gz
asset_name: faas_darwin_amd64.gz
asset_path: ./function_darwin_amd64.gz
asset_name: function_darwin_amd64.gz
asset_content_type: application/x-gzip
- name: Upload Linux Binary
uses: actions/upload-release-asset@v1
Expand All @@ -77,8 +77,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./faas_linux_amd64.gz
asset_name: faas_linux_amd64.gz
asset_path: ./functionlinux_amd64.gz
asset_name: function_linux_amd64.gz
asset_content_type: application/x-gzip
- name: Upload Windows Binary
uses: actions/upload-release-asset@v1
Expand All @@ -87,6 +87,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./faas_windows_amd64.exe.gz
asset_name: faas_windows_amd64.exe.gz
asset_path: ./function_windows_amd64.exe.gz
asset_name: function_windows_amd64.exe.gz
asset_content_type: application/x-gzip
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/faas
/faas_*
/function
/function_*
/templates/go/events/go.sum
/templates/go/http/go.sum
/coverage.out
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ RUN make

FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=build /src/faas /bin/
ENTRYPOINT ["faas"]
COPY --from=build /src/function /bin/
ENTRYPOINT ["function"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REPO := quay.io/boson/faas
BIN := faas
REPO := quay.io/boson/function
BIN := function

DARWIN=$(BIN)_darwin_amd64
LINUX=$(BIN)_linux_amd64
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# faas
# Boson Function CLI

[![Main Build Status](https://github.com/boson-project/faas/workflows/Main/badge.svg?branch=main)](https://github.com/boson-project/faas/actions?query=workflow%3AMain+branch%3Amain)
[![Develop Build Status](https://github.com/boson-project/faas/workflows/Develop/badge.svg?branch=develop&label=develop)](https://github.com/boson-project/faas/actions?query=workflow%3ADevelop+branch%3Adevelop)
Expand All @@ -9,7 +9,7 @@

[Demo Screencast]

faas is a "Function as a Service" Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.
function is a Client Library and CLI for enabling the development of implicitly deployed, platform agnostic code.

[Read the Documentation](docs/README.md)

Expand Down
12 changes: 6 additions & 6 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
func init() {
root.AddCommand(buildCmd)
buildCmd.Flags().StringP("builder", "b", "default", "Buildpacks builder")
buildCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FAAS_CONFIRM")
buildCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FAAS_IMAGE")
buildCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FAAS_PATH")
buildCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FAAS_REGISTRY")
buildCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
buildCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNCTION_IMAGE")
buildCmd.Flags().StringP("path", "p", cwd(), "Path to the Function project directory - $FUNCTION_PATH")
buildCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FUNCTION_REGISTRY")

err := buildCmd.RegisterFlagCompletionFunc("builder", CompleteBuilderList)
if err != nil {
Expand All @@ -31,12 +31,12 @@ var buildCmd = &cobra.Command{
Long: `Build an existing Function project as an OCI image
Builds the Function project in the current directory or in the directory
specified by the --path flag. The faas.yaml file is read to determine the
specified by the --path flag. The function.yaml file is read to determine the
image name and registry. If both of these values are unset in the
configuration file the --registry or -r flag should be provided and an image
name will be derived from the project name.
Any value provided for the --image flag will be persisted in the faas.yaml
Any value provided for the --image flag will be persisted in the function.yaml
configuration file. On subsequent invocations of the "build" command
these values will be read from the configuration file.
Expand Down
8 changes: 4 additions & 4 deletions cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ var completionCmd = &cobra.Command{
Long: `To load completion run
For zsh:
source <(faas completion zsh)
source <(function completion zsh)
If you would like to use alias:
alias f=faas
compdef _faas f
alias f=function
compdef _function f
For bash:
source <(faas completion bash)
source <(function completion bash)
`,
ValidArgs: []string{"bash", "zsh", "fish"},
Expand Down
16 changes: 8 additions & 8 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (

func init() {
root.AddCommand(createCmd)
createCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FAAS_CONFIRM")
createCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FAAS_IMAGE")
createCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
createCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FAAS_REGISTRY")
createCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'go'. Available runtimes: 'node', 'quarkus' and 'go'. - $FAAS_RUNTIME")
createCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FAAS_TEMPLATES")
createCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FAAS_TRIGGER")
createCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
createCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNCTION_IMAGE")
createCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
createCmd.Flags().StringP("registry", "r", "", "Registry for built images, ex 'docker.io/myuser' or just 'myuser'. Optional if --image provided. - $FUNCTION_REGISTRY")
createCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'go'. Available runtimes: 'node', 'quarkus' and 'go'. - $FUNCTION_RUNTIME")
createCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FUNCTION_TEMPLATES")
createCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FUNCTION_TRIGGER")

var err error
err = createCmd.RegisterFlagCompletionFunc("image", CompleteRegistryList)
Expand Down Expand Up @@ -52,7 +52,7 @@ values when an image is built or a Function is deployed. If the image name and
image registry are both unspecified, the user will be prompted for an image
registry, and the image name can be inferred from that plus the function
name. The function name, namespace and image name are all persisted in the
project configuration file faas.yaml.
project configuration file function.yaml.
`,
SuggestFor: []string{"cerate", "new"},
PreRunE: bindEnv("image", "namespace", "registry", "runtime", "templates", "trigger", "confirm"),
Expand Down
10 changes: 5 additions & 5 deletions cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func init() {
root.AddCommand(deleteCmd)
deleteCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FAAS_CONFIRM")
deleteCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be deleted - $FAAS_PATH")
deleteCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
deleteCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be deleted - $FUNCTION_PATH")
deleteCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
}

Expand All @@ -25,13 +25,13 @@ var deleteCmd = &cobra.Command{
Removes a deployed function from the cluster. The user may specify a function
by name, path using the --path or -p flag, or if neither of those are provided,
the current directory will be searched for a faas.yaml configuration file to
the current directory will be searched for a function.yaml configuration file to
determine the function to be removed.
The namespace defaults to the value in faas.yaml or the namespace currently
The namespace defaults to the value in function.yaml or the namespace currently
active in the user's Kubernetes configuration. The namespace may be specified
on the command line using the --namespace or -n flag, and if so this will
overwrite the value in faas.yaml.
overwrite the value in function.yaml.
`,
SuggestFor: []string{"remove", "rm", "del"},
ValidArgsFunction: CompleteFunctionList,
Expand Down
16 changes: 8 additions & 8 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (

func init() {
root.AddCommand(deployCmd)
deployCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FAAS_CONFIRM")
deployCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
deployCmd.Flags().StringArrayP("env", "e", []string{}, "Sets environment variables for the Function.")
deployCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FAAS_IMAGE")
deployCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
deployCmd.Flags().StringP("path", "p", cwd(), "Path to the function project directory - $FAAS_PATH")
deployCmd.Flags().StringP("registry", "r", "", "Image registry for built images, ex 'docker.io/myuser' or just 'myuser'. - $FAAS_REGISTRY")
deployCmd.Flags().StringP("image", "i", "", "Optional full image name, in form [registry]/[namespace]/[name]:[tag] for example quay.io/myrepo/project.name:latest (overrides --registry) - $FUNCTION_IMAGE")
deployCmd.Flags().StringP("namespace", "n", "", "Override namespace into which the Function is deployed (on supported platforms). Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
deployCmd.Flags().StringP("path", "p", cwd(), "Path to the function project directory - $FUNCTION_PATH")
deployCmd.Flags().StringP("registry", "r", "", "Image registry for built images, ex 'docker.io/myuser' or just 'myuser'. - $FUNCTION_REGISTRY")
}

var deployCmd = &cobra.Command{
Expand All @@ -30,18 +30,18 @@ var deployCmd = &cobra.Command{
Builds and Deploys the Function project in the current directory.
A path to the project directory may be provided using the --path or -p flag.
Reads the faas.yaml configuration file to determine the image name.
Reads the function.yaml configuration file to determine the image name.
An image and registry may be specified on the command line using
the --image or -i and --registry or -r flag.
If the Function is already deployed, it is updated with a new container image
that is pushed to an image registry, and the Knative Service is updated.
The namespace into which the project is deployed defaults to the value in the
faas.yaml configuration file. If NAMESPACE is not set in the configuration,
function.yaml configuration file. If NAMESPACE is not set in the configuration,
the namespace currently active in the Kubernetes configuration file will be
used. The namespace may be specified on the command line using the --namespace
or -n flag, and if so this will overwrite the value in the faas.yaml file.
or -n flag, and if so this will overwrite the value in the function.yaml file.
`,
Expand Down
10 changes: 5 additions & 5 deletions cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

func init() {
root.AddCommand(describeCmd)
describeCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for the Function. Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
describeCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FAAS_FORMAT")
describeCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be described - $FAAS_PATH")
describeCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for the Function. Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
describeCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNCTION_FORMAT")
describeCmd.Flags().StringP("path", "p", cwd(), "Path to the project which should be described - $FUNCTION_PATH")

err := describeCmd.RegisterFlagCompletionFunc("format", CompleteOutputFormatList)
if err != nil {
Expand All @@ -36,9 +36,9 @@ Prints the name, route and any event subscriptions for a deployed Function in
the current directory. A path to a Function project directory may be supplied
using the --path or -p flag.
The namespace defaults to the value in faas.yaml or the namespace currently
The namespace defaults to the value in function.yaml or the namespace currently
active in the user's Kubernetes configuration. The namespace may be specified
using the --namespace or -n flag, and if so this will overwrite the value in faas.yaml.
using the --namespace or -n flag, and if so this will overwrite the value in function.yaml.
`,
SuggestFor: []string{"desc", "get"},
ValidArgsFunction: CompleteFunctionList,
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (

func init() {
root.AddCommand(initCmd)
initCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FAAS_CONFIRM")
initCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'node'. Available runtimes: 'node', 'quarkus' and 'go'. - $FAAS_RUNTIME")
initCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FAAS_TEMPLATES")
initCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FAAS_TRIGGER")
initCmd.Flags().BoolP("confirm", "c", false, "Prompt to confirm all configuration options - $FUNCTION_CONFIRM")
initCmd.Flags().StringP("runtime", "l", faas.DefaultRuntime, "Function runtime language/framework. Default runtime is 'node'. Available runtimes: 'node', 'quarkus' and 'go'. - $FUNCTION_RUNTIME")
initCmd.Flags().StringP("templates", "", filepath.Join(configPath(), "templates"), "Extensible templates path. - $FUNCTION_TEMPLATES")
initCmd.Flags().StringP("trigger", "t", faas.DefaultTrigger, "Function trigger. Default trigger is 'http'. Available triggers: 'http' and 'events' - $FUNCTION_TRIGGER")

if err := initCmd.RegisterFlagCompletionFunc("runtime", CompleteRuntimeList); err != nil {
fmt.Println("Error while calling RegisterFlagCompletionFunc: ", err)
Expand Down Expand Up @@ -74,8 +74,8 @@ type initConfig struct {

// Templates is an optional path that, if it exists, will be used as a source
// for additional templates not included in the binary. If not provided
// explicitly as a flag (--templates) or env (FAAS_TEMPLATES), the default
// location is $XDG_CONFIG_HOME/templates ($HOME/.config/faas/templates)
// explicitly as a flag (--templates) or env (FUNCTION_TEMPLATES), the default
// location is $XDG_CONFIG_HOME/templates ($HOME/.config/function/templates)
Templates string

// Trigger is the form of the resultant Function, i.e. the Function signature
Expand Down
8 changes: 4 additions & 4 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (

func init() {
root.AddCommand(listCmd)
listCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FAAS_NAMESPACE")
listCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FAAS_FORMAT")
listCmd.Flags().StringP("namespace", "n", "", "Override namespace in which to search for Functions. Default is to use currently active underlying platform setting - $FUNCTION_NAMESPACE")
listCmd.Flags().StringP("format", "f", "human", "optionally specify output format (human|plain|json|xml|yaml) $FUNCTION_FORMAT")

err := listCmd.RegisterFlagCompletionFunc("format", CompleteOutputFormatList)
if err != nil {
Expand All @@ -32,10 +32,10 @@ var listCmd = &cobra.Command{
Short: "Lists deployed Functions",
Long: `Lists deployed Functions
Lists all deployed functions. The namespace defaults to the value in faas.yaml
Lists all deployed functions. The namespace defaults to the value in function.yaml
or the namespace currently active in the user's Kubernetes configuration. The
namespace may be specified on the command line using the --namespace or -n flag.
If specified this will overwrite the value in faas.yaml.
If specified this will overwrite the value in function.yaml.
`,
SuggestFor: []string{"ls", "lsit"},
PreRunE: bindEnv("namespace", "format"),
Expand Down
Loading

0 comments on commit b33329a

Please sign in to comment.