Skip to content

Commit 580eda3

Browse files
committed
Update to new faas-cli structure
1 parent 7282d84 commit 580eda3

File tree

5 files changed

+25
-134
lines changed

5 files changed

+25
-134
lines changed

.gitignore

Lines changed: 3 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,3 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
env/
12-
build/
13-
develop-eggs/
14-
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
*.egg-info/
24-
.installed.cfg
25-
*.egg
26-
27-
# PyInstaller
28-
# Usually these files are written by a python script from a template
29-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30-
*.manifest
31-
*.spec
32-
33-
# Installer logs
34-
pip-log.txt
35-
pip-delete-this-directory.txt
36-
37-
# Unit test / coverage reports
38-
htmlcov/
39-
.tox/
40-
.coverage
41-
.coverage.*
42-
.cache
43-
nosetests.xml
44-
coverage.xml
45-
*,cover
46-
.hypothesis/
47-
48-
# Translations
49-
*.mo
50-
*.pot
51-
52-
# Django stuff:
53-
*.log
54-
local_settings.py
55-
56-
# Flask stuff:
57-
instance/
58-
.webassets-cache
59-
60-
# Scrapy stuff:
61-
.scrapy
62-
63-
# Sphinx documentation
64-
docs/_build/
65-
66-
# PyBuilder
67-
target/
68-
69-
# IPython Notebook
70-
.ipynb_checkpoints
71-
72-
# pyenv
73-
.python-version
74-
75-
# celery beat schedule file
76-
celerybeat-schedule
77-
78-
# dotenv
79-
.env
80-
81-
# virtualenv
82-
venv/
83-
ENV/
84-
85-
# Spyder project settings
86-
.spyderproject
87-
88-
# Rope project settings
89-
.ropeproject
1+
master.zip
2+
template
3+
build

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
11
# faas-python-fib
2-
A [FaaS](http://get-faas.com) function to generate the first N fib numbers
2+
An [OpenFaaS](https://www.openfaas.com/) function to generate the first N fibonacci numbers
33

4-
You can execute the function like this:
5-
6-
`curl http://localhost:8080/function/func_fib -d "10"`
7-
8-
(or use the FaaS UI to send the URL)
9-
10-
![](https://pbs.twimg.com/media/C9oep7KUMAAb_eZ.jpg:large)
11-
12-
## Installation
13-
14-
You can either install `faas-python-fib` via your FaaS compose file or you can add it via the UI.
154

16-
### Compose file
5+
## Install it
176

18-
Add this to `docker-compose.yml` and then redeploy the stack
19-
20-
```Dockerfile
21-
ascii:
22-
image: developius/faas-python-fib:latest
23-
labels:
24-
function: "true"
25-
depends_on:
26-
- gateway
27-
networks:
28-
- functions
29-
environment:
30-
no_proxy: "gateway"
31-
https_proxy: $https_proxy
7+
```
8+
$ faas-cli -action build -f ./stack.yml
9+
$ faas-cli -action deploy -f ./stack.yml
3210
```
3311

34-
`docker stack deploy -c docker-compose.yml func`
12+
## Run it
3513

36-
### UI
14+
You can execute the function like this:
3715

38-
Hit the `CREATE NEW FUNCTION` button and add these details:
16+
```
17+
$ curl http://localhost:8080/function/fib -d "10"
18+
```
3919

40-
- Image: `developius/faas-python-fib:latest`
41-
- Service name: `fib`
42-
- fProcess: `python main.py`
43-
- Network: `func_functions`
20+
(or use the FaaS UI to send the URL)
4421

45-
Hit create!
22+
![](https://pbs.twimg.com/media/C9oep7KUMAAb_eZ.jpg:large)
File renamed without changes.

stack.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
provider:
2+
name: faas
3+
provider: faas
4+
gateway: http://localhost:8080
5+
6+
functions:
7+
fib:
8+
lang: python
9+
handler: ./handler
10+
image: developius/faas-python-fib

0 commit comments

Comments
 (0)