From 20b62e3cc928e3092642e717f8f5da7da691f7eb Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Wed, 24 Aug 2022 12:09:52 +0100 Subject: [PATCH] Remove deprecated files Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- .DEREK.yml | 42 +------------- CNAME | 1 - DEV.md | 106 ------------------------------------ contrib/README.md | 10 ---- contrib/publish-arm.sh | 84 ---------------------------- prometheus/alert.rules.yml | 14 ----- prometheus/alertmanager.yml | 26 --------- prometheus/prometheus.yml | 43 --------------- 8 files changed, 1 insertion(+), 325 deletions(-) delete mode 100644 CNAME delete mode 100644 DEV.md delete mode 100644 contrib/README.md delete mode 100755 contrib/publish-arm.sh delete mode 100644 prometheus/alert.rules.yml delete mode 100644 prometheus/alertmanager.yml delete mode 100644 prometheus/prometheus.yml diff --git a/.DEREK.yml b/.DEREK.yml index f89a54044..df492d25e 100644 --- a/.DEREK.yml +++ b/.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. diff --git a/CNAME b/CNAME deleted file mode 100644 index f3db36761..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -docs.get-faas.com \ No newline at end of file diff --git a/DEV.md b/DEV.md deleted file mode 100644 index 4874938fd..000000000 --- a/DEV.md +++ /dev/null @@ -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 -``` - diff --git a/contrib/README.md b/contrib/README.md deleted file mode 100644 index 6ed37b643..000000000 --- a/contrib/README.md +++ /dev/null @@ -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. diff --git a/contrib/publish-arm.sh b/contrib/publish-arm.sh deleted file mode 100755 index d05880c6c..000000000 --- a/contrib/publish-arm.sh +++ /dev/null @@ -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 diff --git a/prometheus/alert.rules.yml b/prometheus/alert.rules.yml deleted file mode 100644 index dc73a0551..000000000 --- a/prometheus/alert.rules.yml +++ /dev/null @@ -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 }} diff --git a/prometheus/alertmanager.yml b/prometheus/alertmanager.yml deleted file mode 100644 index 182a07b3b..000000000 --- a/prometheus/alertmanager.yml +++ /dev/null @@ -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 diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml deleted file mode 100644 index f19d30ea0..000000000 --- a/prometheus/prometheus.yml +++ /dev/null @@ -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=` 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