From 72785b4dbc9a4bc3c20837a551a5807908728779 Mon Sep 17 00:00:00 2001 From: JockDaRock Date: Wed, 13 Sep 2017 15:19:06 -0500 Subject: [PATCH 1/3] improved UI updates Signed-off-by: JockDaRock --- k8s_templates/aci-beta.yml | 2 +- k8s_templates/faas_function_k8s.yml | 194 ++-------------------------- time2code-faas-cli-functions.yml | 6 +- time2code-ide-deploy.yml | 166 ++++++++++++++++++++++++ 4 files changed, 186 insertions(+), 182 deletions(-) create mode 100644 time2code-ide-deploy.yml diff --git a/k8s_templates/aci-beta.yml b/k8s_templates/aci-beta.yml index 528904e..f6e0141 100644 --- a/k8s_templates/aci-beta.yml +++ b/k8s_templates/aci-beta.yml @@ -139,7 +139,7 @@ spec: image: jockdarock/time2csharp:latest imagePullPolicy: Always name: csharp-experimental - nodename: aci-connector + nodeName: aci-connector --- apiVersion: extensions/v1beta1 diff --git a/k8s_templates/faas_function_k8s.yml b/k8s_templates/faas_function_k8s.yml index 3954738..bb3028e 100644 --- a/k8s_templates/faas_function_k8s.yml +++ b/k8s_templates/faas_function_k8s.yml @@ -1,195 +1,32 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: csharp-experimental -spec: - replicas: 0 - rollbackTo: - revision: 0 - selector: - matchLabels: - app: time2code - component: csharp-experimental - strategy: - rollingUpdate: - maxSurge: 1000 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - app: time2code - component: csharp-experimental - spec: - containers: - - env: - - name: fprocess - value: python3 time2CSharp.py - - name: https_proxy - value: $https_proxy - - name: no_proxy - value: gateway - - name: read_timeout - value: "60" - - name: write_timeout - value: "60" - image: jockdarock/time2csharp:latest - imagePullPolicy: Always - name: csharp-experimental - nodeSelector: - dedicated: aci-connector - ---- -apiVersion: extensions/v1beta1 -kind: Deployment +apiVersion: v1 +kind: Service metadata: - name: golang -spec: - replicas: 1 - rollbackTo: - revision: 0 - selector: - matchLabels: - app: time2code - component: golang - strategy: - rollingUpdate: - maxSurge: 1000 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - labels: - app: time2code - component: golang - spec: - containers: - - env: - - name: fprocess - value: python3 time2go.py - - name: https_proxy - value: $https_proxy - - name: no_proxy - value: gateway - - name: read_timeout - value: "60" - - name: write_timeout - value: "60" - image: jockdarock/time2go:latest - imagePullPolicy: Always - name: golang - nodeSelector: - dedicated: aci-connector - ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: nodejs -spec: - replicas: 0 - rollbackTo: - revision: 0 - selector: - matchLabels: - app: time2code - component: nodejs - strategy: - rollingUpdate: - maxSurge: 1000 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - app: time2code - component: nodejs - spec: - containers: - - env: - - name: fprocess - value: python3 time2nodejs.py - - name: https_proxy - value: $https_proxy - - name: no_proxy - value: gateway - - name: read_timeout - value: "60" - - name: write_timeout - value: "60" - image: jockdarock/time2nodejs:latest - imagePullPolicy: Always - name: nodejs - nodeSelector: - dedicated: aci-connector - ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: powershell + name: python + namespace: default spec: - replicas: 0 - rollbackTo: - revision: 0 + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 selector: - matchLabels: - app: time2code - component: powershell - strategy: - rollingUpdate: - maxSurge: 1000 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - app: time2code - component: powershell - spec: - containers: - - env: - - name: fprocess - value: python3 time2powershell.py - - name: https_proxy - value: $https_proxy - - name: no_proxy - value: gateway - - name: read_timeout - value: "60" - - name: write_timeout - value: "60" - image: jockdarock/time2powershell:latest - imagePullPolicy: Always - name: powershell - volumeMounts: null - volumes: null - nodeSelector: - dedicated: aci-connector - + faas_function: python --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: python spec: - replicas: 0 + replicas: 1 rollbackTo: revision: 0 selector: matchLabels: - app: time2code - component: python - strategy: - rollingUpdate: - maxSurge: 1000 - maxUnavailable: 0 - type: RollingUpdate + faas_function: python template: metadata: + name: python labels: - app: time2code - component: python + faas_function: python spec: containers: - env: @@ -206,7 +43,4 @@ spec: image: jockdarock/time2py:latest imagePullPolicy: Always name: python - volumeMounts: null - volumes: null - nodeSelector: - dedicated: aci-connector \ No newline at end of file + nodeName: aci-connector \ No newline at end of file diff --git a/time2code-faas-cli-functions.yml b/time2code-faas-cli-functions.yml index db1a797..292d809 100644 --- a/time2code-faas-cli-functions.yml +++ b/time2code-faas-cli-functions.yml @@ -1,8 +1,12 @@ provider: name: faas - gateway: http://localhost:31112 + gateway: http://localhost:8080 functions: + time2code: + fprocess: python handler.py + image: jockdarock/cgi_t2c:latest + golang: fprocess: python3 time2go.py image: jockdarock/time2go:latest diff --git a/time2code-ide-deploy.yml b/time2code-ide-deploy.yml new file mode 100644 index 0000000..afc39b7 --- /dev/null +++ b/time2code-ide-deploy.yml @@ -0,0 +1,166 @@ +version: "3" +services: +# Setup FaaS Framework First +# Core API services for FaaS are pinned, HA is provided for functions. + gateway: + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + ports: + - 8080:8080 + image: jockdarock/faasgateway:latest-dev + networks: + - functions + environment: + dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD + read_timeout: "60" + write_timeout: "60" + deploy: + placement: + constraints: [node.role == manager] + + prometheus: + image: functions/prometheus:latest # autobuild from Dockerfile in repo. + command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093" + ports: + - 9090:9090 + depends_on: + - gateway + - alertmanager + environment: + no_proxy: "gateway" + networks: + - functions + deploy: + placement: + constraints: [node.role == manager] + + alertmanager: + image: functions/alertmanager:latest # autobuild from Dockerfile in repo. + environment: + no_proxy: "gateway" + command: + - '-config.file=/alertmanager.yml' + networks: + - functions + ports: + - 9093:9093 + deploy: + placement: + constraints: [node.role == manager] + + # IDE and Code execution functions on OpenFaaS + # IDE as a function + time2code: + image: jockdarock/cgi_t2c:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python handler.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # Python Code Execution + python: + image: jockdarock/time2py:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python3 time2py.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # Golang Code Execution + golang: + image: jockdarock/time2go:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python3 time2go.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # Powershell Code Execution + powershell: + image: jockdarock/time2powershell:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python3 time2powershell.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # DotNet / C# Code Execution + csharp-experimental: + image: jockdarock/time2csharp:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python3 time2CSharp.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # NodeJS Code Execution + nodejs: + image: jockdarock/time2nodejs:latest + labels: + function: "true" + depends_on: + - gateway + networks: + - functions + environment: + fprocess: "python3 time2nodejs.py" + no_proxy: "gateway" + https_proxy: $https_proxy + read_timeout: "60" + write_timeout: "60" + + # Time2Code Code Editor / Flask Web Server + time2codeserver: + depends_on: + - gateway + build: + context: . + dockerfile: Dockerfile.nofaas + deploy: + replicas: 2 + image: jockdarock/time2codeserver:latest + networks: + - functions + ports: + - "5555:5555" + +networks: + functions: + driver: overlay + From f97a31f2d53ffc13e7312befdd2455b65a907cb1 Mon Sep 17 00:00:00 2001 From: JockDaRock Date: Wed, 13 Sep 2017 16:19:32 -0500 Subject: [PATCH 2/3] update yaml for testing IDE as a function Signed-off-by: JockDaRock --- time2code-ide-deploy.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/time2code-ide-deploy.yml b/time2code-ide-deploy.yml index afc39b7..18d3773 100644 --- a/time2code-ide-deploy.yml +++ b/time2code-ide-deploy.yml @@ -145,21 +145,6 @@ services: read_timeout: "60" write_timeout: "60" - # Time2Code Code Editor / Flask Web Server - time2codeserver: - depends_on: - - gateway - build: - context: . - dockerfile: Dockerfile.nofaas - deploy: - replicas: 2 - image: jockdarock/time2codeserver:latest - networks: - - functions - ports: - - "5555:5555" - networks: functions: driver: overlay From f9ba953688971b3c8621e8c66ee0400d3bcd4295 Mon Sep 17 00:00:00 2001 From: JockDaRock Date: Thu, 14 Sep 2017 15:36:55 -0500 Subject: [PATCH 3/3] stack update for testing Signed-off-by: JockDaRock --- Dockerfile | 2 +- templates/index-panel.html | 16 +++++++++++----- time2code-ide-deploy.yml | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5826e8a..72ec573 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apk add -Uuv --no-cache python3 \ && apk add ca-certificates && pip3 install --no-cache-dir --upgrade pip setuptools wheel \ && pip3 install requests flask markdown -ADD https://github.com/alexellis/faas/releases/download/0.5.6-alpha/fwatchdog /usr/bin +ADD https://github.com/alexellis/faas/releases/download/0.5.8-alpha/fwatchdog /usr/bin RUN chmod +x /usr/bin/fwatchdog diff --git a/templates/index-panel.html b/templates/index-panel.html index 5ad1e83..dff9889 100644 --- a/templates/index-panel.html +++ b/templates/index-panel.html @@ -13,9 +13,11 @@ - - - + + + + +