mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 22:33:23 +00:00
Remove deprecated files
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
42
.DEREK.yml
42
.DEREK.yml
@ -2,7 +2,7 @@ curators:
|
||||
- alexellis
|
||||
- LucasRoesler
|
||||
- viveksyngh
|
||||
- Waterdrips
|
||||
- nitishkumar71
|
||||
- rgee0
|
||||
- welteki
|
||||
|
||||
@ -13,43 +13,3 @@ features:
|
||||
- release_notes
|
||||
|
||||
contributing_url: https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md
|
||||
|
||||
required_in_issues:
|
||||
- "## Why do you need this?"
|
||||
- "## Expected Behaviour"
|
||||
- "## Current Behaviour"
|
||||
- "## Steps to Reproduce (for bugs)"
|
||||
- "## Your Environment"
|
||||
|
||||
custom_messages:
|
||||
messages:
|
||||
- name: template
|
||||
value: |
|
||||
Your issue has been marked as *invalid* because you've deleted or removed questions from our issue template.
|
||||
|
||||
If you wish to participate in this community, then you need to follow guidelines set by the maintainers.
|
||||
|
||||
You will find the template in the .github folder, edit your issue and use the whole issue template, so that we can help you.
|
||||
|
||||
- name: propose
|
||||
value: |
|
||||
This project follows a contributing guide which states that all
|
||||
changes must be proposed with an Issue before being worked on.
|
||||
|
||||
Please raise an Issue and update your Pull Request to include
|
||||
the ID or link as part of the description.
|
||||
|
||||
Thank you for your contribution.
|
||||
|
||||
- name: test
|
||||
value: |
|
||||
This project follows a contributing guide which requires that
|
||||
all changes are tested before being merged. You should include
|
||||
worked examples that a maintainer can run to prove that the
|
||||
changes are good.
|
||||
|
||||
Screenshots and command line output are also accepted, but
|
||||
must show the positive, and negative cases, not just that
|
||||
what was added worked as you expected.
|
||||
|
||||
Thank you for your contribution.
|
||||
|
106
DEV.md
106
DEV.md
@ -1,106 +0,0 @@
|
||||
## Develop your own function
|
||||
|
||||
### Working on the API Gateway or Watchdog
|
||||
|
||||
To work on either of the FaaS Golang components checkout the "./build.sh" scripts and acompanying Dockerfiles.
|
||||
|
||||
* [Roadmap and Contributing](https://github.com/openfaas/faas/blob/master/ROADMAP.md)
|
||||
|
||||
### Creating a function
|
||||
|
||||
Functions run as Docker containers with the Watchdog component embedded to handle communication with the API Gateway.
|
||||
|
||||
You can find the [reference documentation for the Watchdog here](https://github.com/openfaas/faas/tree/master/watchdog).
|
||||
|
||||
**Markdown Parser**
|
||||
|
||||
This is the basis of a function which generates HTML from MarkDown:
|
||||
|
||||
```
|
||||
FROM golang:1.9.7
|
||||
RUN mkdir -p /go/src/app
|
||||
COPY handler.go /go/src/app
|
||||
WORKDIR /go/src/app
|
||||
RUN go get github.com/microcosm-cc/bluemonday && \
|
||||
go get github.com/russross/blackfriday
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
||||
ADD https://github.com/openfaas/faas/releases/download/0.9.14/fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
ENV fprocess="/go/src/app/app"
|
||||
|
||||
CMD ["/usr/bin/fwatchdog"]
|
||||
```
|
||||
|
||||
The base Docker container is not important, you just need to add the watchdog component and then set the fprocess to execute your binary at runtime.
|
||||
|
||||
Update the Docker stack with this:
|
||||
|
||||
```
|
||||
markdown:
|
||||
image: alexellis2/faas-markdownrender:latest
|
||||
labels:
|
||||
function: "true"
|
||||
networks:
|
||||
- functions
|
||||
```
|
||||
|
||||
**Word counter with busybox**
|
||||
|
||||
```
|
||||
FROM alpine:latest
|
||||
|
||||
ADD https://github.com/openfaas/faas/releases/download/0.9.14/fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
ENV fprocess="wc"
|
||||
CMD ["fwatchdog"]
|
||||
```
|
||||
|
||||
Update your Docker stack with this definition:
|
||||
|
||||
```
|
||||
wordcount:
|
||||
image: alexellis2/faas-alpinefunction:latest
|
||||
labels:
|
||||
function: "true"
|
||||
networks:
|
||||
- functions
|
||||
environment:
|
||||
fprocess: "wc"
|
||||
```
|
||||
|
||||
**Tip:**
|
||||
|
||||
You can optimize Docker to cache getting the watchdog by using curl, instead of ADD.
|
||||
To do so, replace the related lines with:
|
||||
|
||||
```
|
||||
RUN apt-get update && apt-get install -y curl \
|
||||
&& curl -sL https://github.com/openfaas/faas/releases/download/0.9.14/fwatchdog > /usr/bin/fwatchdog \
|
||||
&& chmod +x /usr/bin/fwatchdog \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
```
|
||||
|
||||
or with the following for Alpine based images:
|
||||
|
||||
```
|
||||
RUN apk --no-cache add curl \
|
||||
&& curl -sL https://github.com/openfaas/faas/releases/download/0.9.14/fwatchdog > /usr/bin/fwatchdog \
|
||||
&& chmod +x /usr/bin/fwatchdog
|
||||
```
|
||||
|
||||
### Testing your function
|
||||
|
||||
You can test your function through a webbrowser against the UI portal on port 8080.
|
||||
|
||||
http://localhost:8080/
|
||||
|
||||
You can also invoke a function by name with curl:
|
||||
|
||||
```
|
||||
curl --data-binary @README.md http://localhost:8080/function/func_wordcount
|
||||
```
|
||||
|
@ -1,10 +0,0 @@
|
||||
## contrib
|
||||
|
||||
This folder contains miscellaneous scripts and packages for CI, development and custom Docker images.
|
||||
|
||||
* Hack on the UI Portal with [HACK.md](./HACK.md)
|
||||
* Deploy a [Grafana dashboard](./grafana.json)
|
||||
* Build and publish all project images for ARMHF with [publish-armhf.sh](./publish-armhf.sh)
|
||||
* Run experimental end-to-end tests with Docker in Docker with [dind.sh](./dind.sh)
|
||||
|
||||
Custom Docker images for ARMHF/ARM64 are available for AlertManager and Prometheus in this folder.
|
@ -1,84 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# "openfaas/nats-queue-worker"
|
||||
# ^ Already multi-arch
|
||||
|
||||
declare -a repos=("openfaas/faas")
|
||||
|
||||
HERE=`pwd`
|
||||
ARCH=$(uname -m)
|
||||
|
||||
#if [ ! -z "$CACHED" ]; then
|
||||
rm -rf staging || :
|
||||
mkdir -p staging/openfaas
|
||||
mkdir -p staging/openfaas-incubator
|
||||
|
||||
#fi
|
||||
|
||||
get_image_names() {
|
||||
if [ "openfaas-incubator/faas-idler" = $1 ]; then
|
||||
images=("openfaas/faas-idler")
|
||||
elif [ "openfaas/faas" = $1 ]; then
|
||||
images=("openfaas/gateway" "openfaas/basic-auth-plugin")
|
||||
elif [ "openfaas/nats-queue-worker" = $1 ]; then
|
||||
images=("openfaas/queue-worker")
|
||||
elif [ "openfaas-incubator/openfaas-operator" = $1 ]; then
|
||||
images=("openfaas/openfaas-operator")
|
||||
else
|
||||
images=($1)
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$ARCH" = "armv7l" ] ; then
|
||||
ARM_VERSION="armhf"
|
||||
elif [ "$ARCH" = "aarch64" ] ; then
|
||||
ARM_VERSION="arm64"
|
||||
fi
|
||||
|
||||
echo "Target architecture: ${ARM_VERSION}"
|
||||
|
||||
for r in "${repos[@]}"
|
||||
do
|
||||
cd $HERE
|
||||
|
||||
echo -e "\nBuilding: $r\n"
|
||||
git clone https://github.com/$r ./staging/$r
|
||||
cd ./staging/$r
|
||||
pwd
|
||||
export TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "Latest release: $TAG"
|
||||
|
||||
get_image_names $r
|
||||
|
||||
for IMAGE in "${images[@]}"
|
||||
do
|
||||
TAG_PRESENT=$(curl -s "https://hub.docker.com/v2/repositories/${IMAGE}/tags/${TAG}-${ARM_VERSION}/" | grep -Po '"message": *"[^"]*"' | grep -io 'not found')
|
||||
if [ "$TAG_PRESENT" = "not found" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$TAG_PRESENT" = "not found" ]; then
|
||||
make ci-${ARM_VERSION}-build ci-${ARM_VERSION}-push
|
||||
else
|
||||
for IMAGE in "${images[@]}"
|
||||
do
|
||||
echo "Image is already present: ${IMAGE}:${TAG}-${ARM_VERSION}"
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Docker images"
|
||||
|
||||
for r in "${repos[@]}"
|
||||
do
|
||||
cd $HERE
|
||||
cd ./staging/$r
|
||||
export TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "$r"
|
||||
get_image_names $r
|
||||
for IMAGE in "${images[@]}"
|
||||
do
|
||||
echo " ${IMAGE}:${TAG}-${ARM_VERSION}"
|
||||
done
|
||||
done
|
@ -1,14 +0,0 @@
|
||||
groups:
|
||||
- name: prometheus/alert.rules
|
||||
rules:
|
||||
- alert: service_down
|
||||
expr: up == 0
|
||||
- alert: APIHighInvocationRate
|
||||
expr: sum(rate(gateway_function_invocation_total{code="200"}[10s])) BY (function_name) > 5
|
||||
for: 5s
|
||||
labels:
|
||||
service: gateway
|
||||
severity: major
|
||||
annotations:
|
||||
description: High invocation total on {{ $labels.function_name }}
|
||||
summary: High invocation total on {{ $labels.function_name }}
|
@ -1,26 +0,0 @@
|
||||
route:
|
||||
group_by: ['alertname', 'cluster', 'service']
|
||||
group_wait: 5s
|
||||
group_interval: 10s
|
||||
repeat_interval: 30s
|
||||
receiver: scale-up
|
||||
routes:
|
||||
- match:
|
||||
service: gateway
|
||||
receiver: scale-up
|
||||
severity: major
|
||||
inhibit_rules:
|
||||
- source_match:
|
||||
severity: 'critical'
|
||||
target_match:
|
||||
severity: 'warning'
|
||||
equal: ['alertname', 'cluster', 'service']
|
||||
receivers:
|
||||
- name: 'scale-up'
|
||||
webhook_configs:
|
||||
- url: http://gateway:8080/system/alert
|
||||
send_resolved: true
|
||||
http_config:
|
||||
basic_auth:
|
||||
username: admin
|
||||
password_file: /run/secrets/basic-auth-password
|
@ -1,43 +0,0 @@
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
||||
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
external_labels:
|
||||
monitor: 'faas-monitor'
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
- 'alert.rules.yml'
|
||||
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
|
||||
# Override the global default and scrape targets from this job every 5 seconds.
|
||||
scrape_interval: 5s
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: "gateway"
|
||||
scrape_interval: 5s
|
||||
dns_sd_configs:
|
||||
- names: ['tasks.gateway']
|
||||
port: 8082
|
||||
type: A
|
||||
refresh_interval: 5s
|
||||
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
- alertmanager:9093
|
Reference in New Issue
Block a user