nanoserverless

command module
v0.0.0-...-1c932c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2017 License: MIT Imports: 20 Imported by: 0

README

nanoserverless

Go Report Card Build Status License Docker Automated buil

ABANDONNED

Cause there is other projects for that now, like :
https://github.com/alexellis/faas
https://github.com/iron-io/functions

Example

You can test that on http://play-with-docker.com

Swarm init if needed
docker swarm init
Up service
docker network create -d overlay nanoserverless
docker service create \
  --name nanoserverless \
  --mount type=bind,source=/var/run/docker.sock,destination=/var/run/docker.sock \
  --network nanoserverless \
  --publish 1664:80 \
  nanoserverless/nanoserverless:master
Create pi function in node7 (time to build FROM node:7 image)
time curl 'http://<ip_manager>:<port>/node7/pi/create?url=https://raw.githubusercontent.com/nanoserverless/nanoserverless/master/examples/pi/pi.js'
real    0m6.701s
Exec that function (in serverless mode)
time curl 'http://<ip_manager>:<port>/node7/pi/exec'
3.1415926445762157
real    0m0.891s
Up a service for that function
time curl 'http://<ip_manager>:<port>/node7/pi/up'
Service id  pylnihmv8w0ymuf3ovniuzuvb created
real    0m0.061s
Exec that function (in service mode now)
time curl 'http://<ip_manager>:<port>:10080/node7/pi/exec'
3.1415926445762157
real    0m0.440s
Down service
time curl 'http://<ip_manager>:<port>/node7/pi/down'
Service nanoserverless-node7-pi removed
real    0m0.015s

Next

Multiple nodes

If you have a swarm cluster, you need to place the REGISTRY environment variable
Creating function will push image to that registry
So other nodes can pull if needed

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
examples
pi

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL