Comments (10)
Add a new function at runtime.
Option 1
Edit the docker-compose stack file, then run ./deploy_stack.sh - this will only update changed/added services, not existing ones.
Option 2
To attach a function at runtime you can use the "New function" button on the portal UI at http://localhost:8080/
Option 3
A HTTP post can also be sent via curl
etc to the endpoint used by the UI (HTTP post to /system/functions
)
// CreateFunctionRequest create a function in the swarm.
type CreateFunctionRequest struct {
Service string `json:"service"`
Image string `json:"image"`
Network string `json:"network"`
EnvProcess string `json:"envProcess"`
}
Delete a function at runtime
No support through UI at the moment, but the Docker CLI supports this:
$ docker service rm func_echoit
from faas.
Working!
from faas.
Great! Here's the curl
method:
curl localhost:8080/system/functions -d '
{"service": "oblique", "image": "vielmetti/faas-oblique", "envProcess": "/usr/bin/oblique", "network": "func_functions"}'
or
curl localhost:8080/system/functions -d '
{"service": "stronghash", "image": "functions/alpine", "envProcess": "sha512sum", "network": "func_functions"}'
from faas.
Blog post writeup, which points back here:
http://vielmetti.github.io/post/2017/2017-W12-4-oblique-strategy-as-a-service/
from faas.
Hi @vielmetti , thanks for this blog!
I had a couple of additional ideas:
- Do you want to add a link in community.md? (PR)
- Please could you put a screenshot of the Gateway API on your blog post?
- Do you have a link to the Dockerfile or repo containing the oblique ideas code or recipe?
Thanks,
Alex
from faas.
Thanks Alex! I'll add some screen shots and will get the repo set up. When that is all properly handled I will do a PR for community.md .
from faas.
I've also added the feedback to the TestDrive guide. https://github.com/alexellis/faas/blob/master/TestDrive.md
from faas.
Alex, have you seen ever the issue of replicas spinning down? See this snapshot of the two functions I added through the API:
ID NAME MODE REPLICAS IMAGE
4eg36gwkpx5i func_base64 replicated 1/1 functions/alpine:latest
9jmsdlqjuobf func_echoit replicated 1/1 functions/alpine:latest
eof3v1jxszwl func_markdown replicated 1/1 alexellis2/faas-markdownrender:latest
fned1yerhdyf func_alertmanager replicated 1/1 quay.io/prometheus/alertmanager:latest
jyymi2er04hx func_decodebase64 replicated 1/1 functions/alpine:latest
kpbu0ktf0iqc func_nodeinfo replicated 1/1 alexellis2/faas-nodeinfo:latest
lj7j5sas6j0q func_webhookstash replicated 1/1 alexellis2/faas-webhookstash:latest
pjc92ptpu8vx func_prometheus replicated 1/1 quay.io/prometheus/prometheus:latest
pt6kncp6fyc4 func_alexacolorchange replicated 1/1 alexellis2/faas-alexachangecolorintent:latest
sbzwtyxgotmv stronghash replicated 0/1 functions/alpine:latest
se05h62iawvc func_wordcount replicated 1/1 functions/alpine:latest
xm4trevb2n2v func_hubstats replicated 1/1 alexellis2/faas-dockerhubstats:latest
yithgmf2il1r oblique replicated 0/1 vielmetti/faas-oblique:latest
zesojp59a4ao func_gateway replicated 1/1 functions/gateway:latest
Is the func_
prefix meaningful in this case to make sure things start up properly, or keep running?
from faas.
If you enable experimental mode you can look at the logs with docker service logs
. Have you left this running on your laptop since Friday?
The func_
prefix is added by Docker when using the stack
file to create the initial set of functions, it's not used by FaaS to identify functions.
Temporarily you could try docker service rm
and re-creating.
from faas.
Docs updated, thanks for this issue @vielmetti . Closing now.
from faas.
Related Issues (20)
- Cannot connect to OpenFaaS on URL: http://xx.xxxx:31112 HOT 1
- Request for CUDA access HOT 4
- how OpenFaaS handles concurrent requests in the function? HOT 1
- Function execution is not stateless HOT 2
- Can multiple functions be run on a single runtime? HOT 1
- Question: Import path for common modules HOT 2
- requests schedule policy in openfaas HOT 1
- Is there a workflow tool for OpenFaaS? HOT 3
- some companies appear twice in the adopters list HOT 2
- Support Azure service bus topic/subscription HOT 1
- RPC and openfaas HOT 1
- Question about OpenAPI Spec 3.1 HOT 2
- [Improvement] OpenFaaS operator installation
- The README.md under fass/api-docs has an incorrect URL to the api spec file
- Setup repository locally
- Function failed to deploy with status code: 500 HOT 2
- Openfaas install gateway Crash HOT 2
- Consultation on the usage permissions of the community version
- Unable to log in to the gateway - connection refused HOT 8
- How do I use a tensorflow base image in the Dockerfile template? Is it possible? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faas.