Compare commits

...
6 Commits
Author SHA1 Message Date
Soam Vasani e4d42797e6 set versions to 0.3.0 2017-09-28 23:44:53 -07:00
Soam VasaniandGitHub 6a394889f6 dotnet20 build fixes (#365)
Fix the dotnet20 build, use docker for builds, and re-enable dotnet20 in the release script.
2017-09-28 23:36:11 -07:00
Erwin van EykandSoam Vasani 59c18693fa Fix workflow apiserver proxy (#363) 2017-09-28 22:45:53 -07:00
Erwin van EykandSoam Vasani 0537c4b805 Added experimental deploy script (#364) 2017-09-28 22:19:55 -07:00
Soam VasaniandGitHub 6734bfbf7b Differentiate by environment in fscache eviction (#361) 2017-09-28 10:00:23 -07:00
Soam Vasani 557c2ee6fc Time out post-install hooks in 5 sec 2017-09-27 19:03:45 -07:00
19 changed files with 142 additions and 40 deletions
+7 -7
View File
@@ -84,7 +84,7 @@ role-based access control.)
#### Minikube #### Minikube
``` ```
$ helm install --namespace fission --set serviceType=NodePort https://github.com/fission/fission/releases/download/v0.2.1/fission-all-v0.2.1.tgz $ helm install --namespace fission --set serviceType=NodePort https://github.com/fission/fission/releases/download/0.3.0/fission-all-0.3.0.tgz
``` ```
The serviceType variable allows configuring the type of Kubernetes The serviceType variable allows configuring the type of Kubernetes
@@ -94,7 +94,7 @@ want to expose anything outside the cluster.
#### Cloud hosted clusters (GKE, AWS, Azure etc.) #### Cloud hosted clusters (GKE, AWS, Azure etc.)
``` ```
$ helm install --namespace fission https://github.com/fission/fission/releases/download/v0.2.1/fission-all-v0.2.1.tgz $ helm install --namespace fission https://github.com/fission/fission/releases/download/0.3.0/fission-all-0.3.0.tgz
``` ```
#### Minimal version #### Minimal version
@@ -104,7 +104,7 @@ the NATS message queue, influxDB for logs, etc. If you want a more
minimal setup, you can install the fission-core chart instead: minimal setup, you can install the fission-core chart instead:
``` ```
$ helm install --namespace fission https://github.com/fission/fission/releases/download/v0.2.1/fission-core-v0.2.1.tgz $ helm install --namespace fission https://github.com/fission/fission/releases/download/0.3.0/fission-core-0.3.0.tgz
``` ```
### Install the Fission CLI ### Install the Fission CLI
@@ -114,19 +114,19 @@ $ helm install --namespace fission https://github.com/fission/fission/releases/d
Get the CLI binary for Mac: Get the CLI binary for Mac:
``` ```
$ curl -Lo fission https://github.com/fission/fission/releases/download/v0.2.1/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
``` ```
#### Linux #### Linux
``` ```
$ curl -Lo fission https://github.com/fission/fission/releases/download/v0.2.1/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
``` ```
#### Windows #### Windows
For Windows, you can use the linux binary on WSL. Or you can download For Windows, you can use the linux binary on WSL. Or you can download
this windows executable: [fission.exe](https://github.com/fission/fission/releases/download/v0.2.1/fission-cli-windows.exe) this windows executable: [fission.exe](https://github.com/fission/fission/releases/download/0.3.0/fission-cli-windows.exe)
### Set environment vars ### Set environment vars
@@ -159,7 +159,7 @@ svc```). Then:
Finally, you're ready to use Fission! Finally, you're ready to use Fission!
``` ```
$ fission env create --name nodejs --image fission/node-env:v0.2.1 $ fission env create --name nodejs --image fission/node-env:0.3.0
$ curl -LO https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js $ curl -LO https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js
+2 -2
View File
@@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
name: fission-all name: fission-all
version: 0.3.0-rc version: 0.3.0
description: Fission is a fast serverless framework for Kubernetes. description: Fission is a fast serverless framework for Kubernetes.
keywords: keywords:
- fission - fission
@@ -12,4 +12,4 @@ maintainers:
- name: Ta Ching Chen - name: Ta Ching Chen
email: contact@tachingchen.com email: contact@tachingchen.com
engine: gotpl engine: gotpl
appVersion: 0.3.0-rc appVersion: 0.3.0
+3 -3
View File
@@ -1,13 +1,13 @@
1. Install the client CLI. 1. Install the client CLI.
Mac: Mac:
$ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
Linux: Linux:
$ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
Windows: Windows:
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-windows.exe For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/0.3.0/fission-cli-windows.exe
2. Set the FISSION_URL and FISSION_ROUTER environment variables. 2. Set the FISSION_URL and FISSION_ROUTER environment variables.
@@ -26,5 +26,5 @@ spec:
containers: containers:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/Usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{ end }}
+2 -2
View File
@@ -13,13 +13,13 @@ image: fission/fission-bundle
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
## Fission image version ## Fission image version
imageTag: 0.3.0-rc imageTag: 0.3.0
## Fission fetcher repository ## Fission fetcher repository
fetcherImage: fission/fetcher fetcherImage: fission/fetcher
## Fission fetcher image version ## Fission fetcher image version
fetcherImageTag: 0.3.0-rc fetcherImageTag: 0.3.0
## Port at which Fission controller service should be exposed ## Port at which Fission controller service should be exposed
controllerPort: 31313 controllerPort: 31313
+2 -2
View File
@@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
name: fission-core name: fission-core
version: 0.3.0-rc version: 0.3.0
description: Fission is a fast serverless framework for Kubernetes. description: Fission is a fast serverless framework for Kubernetes.
keywords: keywords:
- fission - fission
@@ -12,4 +12,4 @@ maintainers:
- name: Ta Ching Chen - name: Ta Ching Chen
email: contact@tachingchen.com email: contact@tachingchen.com
engine: gotpl engine: gotpl
appVersion: 0.3.0-rc appVersion: 0.3.0
+3 -3
View File
@@ -1,13 +1,13 @@
1. Install the client CLI. 1. Install the client CLI.
Mac: Mac:
$ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/
Linux: Linux:
$ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/ $ curl -Lo fission https://github.com/fission/fission/releases/download/0.3.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/
Windows: Windows:
For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/0.3.0-rc/fission-cli-windows.exe For Windows, you can use the linux binary on WSL. Or you can download this windows executable: https://github.com/fission/fission/releases/download/0.3.0/fission-cli-windows.exe
2. Set the FISSION_URL and FISSION_ROUTER environment variables. 2. Set the FISSION_URL and FISSION_ROUTER environment variables.
@@ -26,5 +26,5 @@ spec:
containers: containers:
- name: post-install-job - name: post-install-job
image: "fission/alpinecurl" image: "fission/alpinecurl"
command: ["sh", "-c", "/usr/bin/curl -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"]
{{ end }} {{ end }}
+2 -2
View File
@@ -10,7 +10,7 @@ serviceType: LoadBalancer
image: fission/fission-bundle image: fission/fission-bundle
## Fission image version ## Fission image version
imageTag: 0.3.0-rc imageTag: 0.3.0
## Image pull policy ## Image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
@@ -19,7 +19,7 @@ pullPolicy: IfNotPresent
fetcherImage: fission/fetcher fetcherImage: fission/fetcher
## Fission fetcher image version ## Fission fetcher image version
fetcherImageTag: 0.3.0-rc fetcherImageTag: 0.3.0
## Port at which Fission controller service should be exposed ## Port at which Fission controller service should be exposed
controllerPort: 31313 controllerPort: 31313
+3 -3
View File
@@ -69,7 +69,7 @@ func MakeAPI() (*API, error) {
if len(u) > 0 { if len(u) > 0 {
api.workflowApiUrl = strings.TrimSuffix(wfEnv, "/") api.workflowApiUrl = strings.TrimSuffix(wfEnv, "/")
} else { } else {
api.workflowApiUrl = "http://workflow-apiserver" api.workflowApiUrl = "http://workflows-apiserver"
} }
return api, err return api, err
@@ -118,7 +118,7 @@ func (api *API) getLogDBConfig(dbType string) logDBConfig {
func (api *API) HomeHandler(w http.ResponseWriter, r *http.Request) { func (api *API) HomeHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set("Content-Type", "application/json; charset=utf-8")
fmt.Fprintf(w, "{\"message\": \"Fission API\", \"version\": \"0.3.0-rc\"}\n") fmt.Fprintf(w, "{\"message\": \"Fission API\", \"version\": \"0.3.0\"}\n")
} }
func (api *API) ApiVersionMismatchHandler(w http.ResponseWriter, r *http.Request) { func (api *API) ApiVersionMismatchHandler(w http.ResponseWriter, r *http.Request) {
@@ -178,7 +178,7 @@ func (api *API) Serve(port int) {
r.HandleFunc("/proxy/storage/v1/archive", api.StorageServiceProxy) r.HandleFunc("/proxy/storage/v1/archive", api.StorageServiceProxy)
r.HandleFunc("/proxy/buildermgr/v1/build", api.BuilderManagerBuildProxy) r.HandleFunc("/proxy/buildermgr/v1/build", api.BuilderManagerBuildProxy)
r.HandleFunc("/proxy/buildermgr/v1/builder", api.BuilderManagerEnvBuilderProxy) r.HandleFunc("/proxy/buildermgr/v1/builder", api.BuilderManagerEnvBuilderProxy)
r.HandleFunc("/proxy/workflow", api.WorkflowApiProxy) r.HandleFunc("/proxy/workflows-apiserver/{path:.*}", api.WorkflowApiserverProxy)
address := fmt.Sprintf(":%v", port) address := fmt.Sprintf(":%v", port)
+7 -5
View File
@@ -2,25 +2,27 @@ package controller
import ( import (
"fmt" "fmt"
"github.com/gorilla/mux"
"net/http" "net/http"
"net/http/httputil" "net/http/httputil"
"net/url" "net/url"
"strings"
) )
func (api *API) WorkflowApiProxy(w http.ResponseWriter, r *http.Request) { func (api *API) WorkflowApiserverProxy(w http.ResponseWriter, r *http.Request) {
u := api.storageServiceUrl u := api.workflowApiUrl
ssUrl, err := url.Parse(u) ssUrl, err := url.Parse(u)
if err != nil { if err != nil {
msg := fmt.Sprintf("Error parsing url %v: %v", u, err) msg := fmt.Sprintf("Error parsing url %v: %v", u, err)
http.Error(w, msg, 500) http.Error(w, msg, 500)
return return
} }
vars := mux.Vars(r)
path := fmt.Sprintf("/%s", vars["path"])
director := func(req *http.Request) { director := func(req *http.Request) {
req.URL.Scheme = ssUrl.Scheme req.URL.Scheme = ssUrl.Scheme
req.URL.Host = ssUrl.Host req.URL.Host = ssUrl.Host
req.URL.Path = strings.TrimPrefix(ssUrl.Path, "/proxy/workflow") req.URL.Path = path
req.URL.RawQuery = ssUrl.RawQuery
} }
proxy := &httputil.ReverseProxy{ proxy := &httputil.ReverseProxy{
Director: director, Director: director,
+1 -1
View File
@@ -63,7 +63,7 @@ Move to the build directory inside the container and restore the packages:
``` ```
cd /build cd /build
dotnet restore dotnet restore fission-dotnet20.csproj
log : Restoring packages for /source/project.json... log : Restoring packages for /source/project.json...
log : Installing System.Net.WebSockets 4.0.0. log : Installing System.Net.WebSockets 4.0.0.
log : Installing runtime.native.System.IO.Compression 4.1.0. log : Installing runtime.native.System.IO.Compression 4.1.0.
+5 -3
View File
@@ -1,4 +1,6 @@
#!/bin/sh #!/bin/sh
dotnet restore
dotnet publish -c Release -o out THIS_DIR=$(realpath $(dirname $0))
docker build -t fission/dotnet20-env .
docker run -v $THIS_DIR:/proj microsoft/dotnet:2.0.0-sdk sh -c "cd /proj && ./project-build.sh"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
dotnet restore fission-dotnet20.csproj
dotnet publish fission-dotnet20.csproj -c Release -o out
+1 -1
View File
@@ -26,7 +26,7 @@ func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "fission" app.Name = "fission"
app.Usage = "Serverless functions for Kubernetes" app.Usage = "Serverless functions for Kubernetes"
app.Version = "0.3.0-rc" app.Version = "0.3.0"
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
cli.StringFlag{Name: "server", Usage: "Fission server URL", EnvVar: "FISSION_URL"}, cli.StringFlag{Name: "server", Usage: "Fission server URL", EnvVar: "FISSION_URL"},
+91
View File
@@ -0,0 +1,91 @@
#!/usr/bin/env bash
#
# deploy.sh - (Almost) automatic setup of a Fission Workflows deployment
#
# Configs
FISSION_VERSION=0.3.0-rc
FISSION_WORKFLOWS_VERSION=0.1.0
echo "Fission Workflows Deploy Script v1"
# Check if kubectl is installed
if ! command -v kubectl >/dev/null 2>&1; then
echo "kubectl is not installed"
exit 1;
fi
# Check if minikube is installed
if ! command -v minikube >/dev/null 2>&1 ; then
echo "minikube is not installed."
exit 1;
fi
# Check if helm is installed
if ! command -v helm >/dev/null 2>&1 ; then
echo "helm is not installed."
exit 1;
fi
# Ensure that minikube is running
if ! minikube ip >/dev/null 2>&1 ; then
echo "Starting minikube cluster..."
minikube start
fi
# Install helm on cluster
if ! helm list >/dev/null 2>&1 ; then
echo "Installing helm..."
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
printf "Waiting for Helm"
until helm list >/dev/null 2>&1
do
printf "."
sleep 3
done
printf "\n"
fi
# Output debug logs
echo "---------- Debug ----------"
minikube version
printf "K8S "
kubectl version --client --short
printf "K8S "
kubectl version --short | grep Server
printf "Helm "
helm version --short -c
printf "Helm "
helm version --short -s
echo "Fission: ${FISSION_VERSION}"
echo "Fission Workflows: ${FISSION_WORKFLOWS_VERSION}"
echo "---------------------------"
# Ensure that fission-charts helm repo is added
if ! helm repo list | grep fission-charts >/dev/null 2>&1 ; then
echo "Setting up fission-charts Helm repo..."
helm repo add fission-charts https://fission.github.io/fission-charts/
helm repo update
fi
# Install Fission
if ! fission fn list >/dev/null 2>&1 ; then
echo "Installing Fission..."
helm install --namespace fission --set serviceType=NodePort -n fission-all fission-charts/fission-all --wait --version ${FISSION_VERSION}
fi
# Install Fission Workflows
if ! fission env get --name workflow >/dev/null 2>&1 ; then
echo "Installing Fission Workflows..."
if [[ -z "${FISSION_WORKFLOWS_VERSION// }" ]] ; then
helm install -n fission-workflows fission-charts/fission-workflows --wait --version ${FISSION_WORKFLOWS_VERSION}
else
helm install -n fission-workflows fission-charts/fission-workflows --wait
fi
fi
+1 -1
View File
@@ -118,7 +118,7 @@ build_and_push_all_envs() {
build_and_push_env_image $version nodejs node-env build_and_push_env_image $version nodejs node-env
build_and_push_env_image $version binary binary-env build_and_push_env_image $version binary binary-env
build_and_push_env_image $version dotnet dotnet-env build_and_push_env_image $version dotnet dotnet-env
# (See #359) build_and_push_env_image $version dotnet20 dotnet20-env build_and_push_env_image $version dotnet20 dotnet20-env
build_and_push_env_image $version go go-env build_and_push_env_image $version go go-env
build_and_push_env_image $version perl perl-env build_and_push_env_image $version perl perl-env
build_and_push_env_image $version php7 php-env build_and_push_env_image $version php7 php-env
+6 -2
View File
@@ -59,6 +59,7 @@ type (
address string address string
podName string podName string
age time.Duration age time.Duration
env *api.ObjectMeta // used for ListOld
responseChannel chan *fscResponse responseChannel chan *fscResponse
} }
fscResponse struct { fscResponse struct {
@@ -98,7 +99,9 @@ func (fsc *functionServiceCache) service() {
resp.error = err resp.error = err
} else { } else {
fsvc := fsvcI.(*funcSvc) fsvc := fsvcI.(*funcSvc)
if time.Now().Sub(fsvc.atime) > req.age { if fsvc.environment.Metadata.UID == req.env.UID &&
time.Now().Sub(fsvc.atime) > req.age {
podName := podNameI.(string) podName := podNameI.(string)
pods = append(pods, podName) pods = append(pods, podName)
} }
@@ -241,11 +244,12 @@ func (fsc *functionServiceCache) _deleteByPod(podName string, minAge time.Durati
return true, nil return true, nil
} }
func (fsc *functionServiceCache) ListOld(age time.Duration) ([]string, error) { func (fsc *functionServiceCache) ListOld(env *api.ObjectMeta, age time.Duration) ([]string, error) {
responseChannel := make(chan *fscResponse) responseChannel := make(chan *fscResponse)
fsc.requestChannel <- &fscRequest{ fsc.requestChannel <- &fscRequest{
requestType: LISTOLD, requestType: LISTOLD,
age: age, age: age,
env: env,
responseChannel: responseChannel, responseChannel: responseChannel,
} }
resp := <-responseChannel resp := <-responseChannel
+1 -1
View File
@@ -620,7 +620,7 @@ func (gp *GenericPool) CleanupFunctionService(podName string) error {
func (gp *GenericPool) idlePodReaper() { func (gp *GenericPool) idlePodReaper() {
for { for {
time.Sleep(time.Minute) time.Sleep(time.Minute)
podNames, err := gp.fsCache.ListOld(gp.idlePodReapTime) podNames, err := gp.fsCache.ListOld(&gp.env.Metadata, gp.idlePodReapTime)
if err != nil { if err != nil {
log.Printf("Error reaping idle pods: %v", err) log.Printf("Error reaping idle pods: %v", err)
continue continue