Update OpenFaaS template readme

This commit is contained in:
ZhongbaoShi
2020-01-20 10:44:21 +08:00
committed by ZhongbaoShi
parent e73be7f0e5
commit 7d15c29a2d
6 changed files with 46 additions and 23 deletions
+3 -1
View File
@@ -2,11 +2,13 @@
## What are these templates
> These templates are all based on the Clear Linux* OS.
> Using OpenFaaS template, you can create new functions in a given programming language quickly.
> Here, these templates are all based on the Clear Linux* OS.
> They are from the published container images per the function as below.
* [clearlinux:base](https://hub.docker.com/_/clearlinux)
* [clearlinux/python](https://hub.docker.com/r/clearlinux/python)
* [clearlinux/numpy-mp](https://hub.docker.com/r/clearlinux/numpy-mp)
* [clearlinux/golang](https://hub.docker.com/r/clearlinux/golang)
* [clearlinux/node](https://hub.docker.com/r/clearlinux/node)
@@ -1,7 +1,10 @@
Based on clearlinux:base image
This is following part of [OpenFaaS tempalte Readme](https://github.com/clearlinux/dockerfiles/blob/master/FaaS/OpenFaaS/template/README.md).
This template is based on [clearlinux:base](https://hub.docker.com/_/clearlinux) image.
### dockerfile-clearlinux
1. `faas-cli new --lang dockerfile-clearlinux hello-openfaas --prefix="<your-docker-username-here>"`
1. Create a function named hello-openfass
`faas-cli new --lang dockerfile-clearlinux hello-openfaas --prefix="<your-docker-username-here>"`
Files tree as below.
>
@@ -17,7 +20,9 @@ Based on clearlinux:base image
`echo "openblas" >> hello-openfaas/bundles.txt`
`echo "wget" >> hello-openfaas/bundles.txt`
2. `faas-cli up -f hello-openfaas.yml`
2. Deploy function
Then you can invoke your python function by OpenFaas UI or faas-cli.
`faas-cli up -f hello-openfaas.yml`
Then you can invoke your function by OpenFaas UI or faas-cli.
@@ -1,7 +1,10 @@
Based on clearlinux/golang container image
This is following part of [OpenFaaS tempalte Readme](https://github.com/clearlinux/dockerfiles/blob/master/FaaS/OpenFaaS/template/README.md).
This template is based on [clearlinux/golang](https://hub.docker.com/r/clearlinux/golang) container image.
### go-clearlinux
1. `faas-cli new --lang go-clearlinux go-openfaas --prefix="<your-docker-username-here>"`
1. Create a function named go-openfass
`faas-cli new --lang go-clearlinux go-openfaas --prefix="<your-docker-username-here>"`
Files tree as below.
>
@@ -17,6 +20,9 @@ Based on clearlinux/golang container image
`echo "openblas" >> go-openfaas/bundles.txt`
`echo "wget" >> go-openfaas/bundles.txt`
2. `faas-cli up -f go-openfaas.yml`
2. Deploy function
`faas-cli up -f go-openfaas.yml`
Then you can invoke your go function by OpenFaas UI or faas-cli.
@@ -1,7 +1,10 @@
Based on clearlinux/node:12 container image.
This is following part of [OpenFaaS tempalte Readme](https://github.com/clearlinux/dockerfiles/blob/master/FaaS/OpenFaaS/template/README.md).
This template is based on [clearlinux/node:12](https://hub.docker.com/r/clearlinux/node) container image.
### node-clearlinux
1. `faas-cli new --lang node-clearlinux node-openfaas --prefix="<your-docker-username-here>"`
1. Create a function named node-openfass
`faas-cli new --lang node-clearlinux node-openfaas --prefix="<your-docker-username-here>"`
Files tree as below.
>
@@ -12,7 +15,6 @@ Based on clearlinux/node:12 container image.
├── node-openfaas.yml
└── template
* The entry is "handler.js", do any change you want in this file.
* Put the required Clear Linux bundles in the "bundles.txt".
@@ -21,8 +23,9 @@ Based on clearlinux/node:12 container image.
`echo "openblas" >> node-openfaas/bundles.txt`
`echo "wget" >> node-openfaas/bundles.txt`
2. Deploy function
2. `faas-cli up -f node-openfaas.yml`
`faas-cli up -f node-openfaas.yml`
Then you can invoke your python function by OpenFaas UI or faas-cli.
Then you can invoke your node function by OpenFaas UI or faas-cli.
+9 -6
View File
@@ -1,10 +1,11 @@
Based on clearlinux/python:3 container image.
Current version is 3.8.
It can set OMP_NUM_THREADS dynamically at runtime to accelerate
performance according to assigned computing resources.
This is following part of [OpenFaaS tempalte Readme](https://github.com/clearlinux/dockerfiles/blob/master/FaaS/OpenFaaS/template/README.md).
This template is based on [clearlinux/numpy-mp](https://hub.docker.com/r/clearlinux/numpy-mp) container image. Python version is 3.8.
It can leverage AVX512 advantage and set OMP_NUM_THREADS dynamically at runtime to accelerate performance according to assigned computing resources.
### numpy-clearlinux
1. `faas-cli new --lang numpy-mp numpy-openfaas --prefix="<your-docker-username-here>"`
1. Create a function named numpy-openfass
`faas-cli new --lang numpy-mp numpy-openfaas --prefix="<your-docker-username-here>"`
Files tree as below.
>
@@ -35,6 +36,8 @@ performance according to assigned computing resources.
* Entry is "handler.py", do any change you want here.
2. `faas-cli up -f numpy-openfaas.yml`
2. Deploy function
`faas-cli up -f numpy-openfaas.yml`
Then you can invoke your python function by OpenFaas UI or faas-cli.
@@ -1,8 +1,10 @@
Based on clearlinux/python:3 container image.
Current version is 3.8.
This is following part of [OpenFaaS tempalte Readme](https://github.com/clearlinux/dockerfiles/blob/master/FaaS/OpenFaaS/template/README.md).
This template is based on [clearlinux/python:3](https://hub.docker.com/r/clearlinux/python) container image. Python version is 3.8.
### python3-clearlinux
1. `faas-cli new --lang python3-clearlinux hello-openfaas --prefix="<your-docker-username-here>"`
1. Create a function named hello-openfass
`faas-cli new --lang python3-clearlinux hello-openfaas --prefix="<your-docker-username-here>"`
Files tree as below.
>
@@ -29,6 +31,8 @@ Current version is 3.8.
* Put any initial/helper operation in the "help_script.sh"
2. `faas-cli up -f hello-openfaas.yml`
2. Deploy function
`faas-cli up -f hello-openfaas.yml`
Then you can invoke your python function by OpenFaas UI or faas-cli.