Giter Site home page Giter Site logo

thequeenisdead / go-faas-t Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 35 KB

A full-stack application hosted in a local kubernetes server, leveraging functions-as-a-service, redis, and rabbitmq.

Makefile 10.64% HCL 56.48% Dockerfile 2.73% Go 30.16%

go-faas-t's Introduction

go-faas-t

Overview

Just a playground for watching services scale to meet demand, with a bunch of DevOps goodies thrown in. Great opportunity to learn more about the self-hosted functions as a service.

WIP: A backend service receives / retrieves different images from a remote URI. It pushes the image data onto a message queue, storing the message / job id in redis in order to reference the state of the job later. A serverless process receives the message and resizes the image, then pops it back into redis for persistent storage (For simplicities sake). Hopefully, there might come a UI to tie it all in together?

TODO

Everything!

  • Create a backend service that retrieves images from a data source.
  • Enable data push to a RabbitMQ.
    • This simply grabs a URL and puts it on the queue, but it will suffice for a demo :-)
  • [] Enable job id persistence in Redis.
  • [] Create a function that is triggered on message creation in RabbitMQ.
  • [] Enable function to push resized image to Redis.
  • [] Create UI to display job progress.
    • TODO: Add steps as this is undertaken.

Requirements

Quickstart

Use the following makefile directives to bring the stack up quickly.

make          # Bring up a kind cluster with rabbit, faas, and connector.
make build    # Build the consumer and producer applications
make deploy   # Push apps and config to Kubernetes

You may need to setup your .kubeconfig file to talk to the kind cluster, and faas-cli will require a login once the gateway is forwarded locally.

To export cluster credentials to your kubeconfig file run:

make kubeconfig

To forward the FaaS gateway and authenticate with the default token run:

kubectl port-forward -n openfaas svc/gateway 6969:8080 &
make faas-login

Credentials

Throughout this example the default credentials for each service are used widely.

These can be found in the following Kubernetes secrets, and will differ on each install.

OpenFaas

kubectl get secret basic-auth -n openfaas -o json | jq -r '.data | map_values(@base64d)'
{
  "basic-auth-password": "uiikDojwnzFA",
  "basic-auth-user": "admin"
}

RabbitMQ

kubectl get secret rabbitmq-default-user -n default -o json | jq -r '.data | map_values(@base64d)'
{
  "default_user.conf": "default_user = default_user_0T58DCWQFcWQbLrv3hy\ndefault_pass = b2aC2VCipg608CN76_qjw4cMrB5_dSkY\n",
  "host": "rabbitmq.default.svc",
  "password": "b2aC2VCipg608CN76_qjw4cMrB5_dSkY",
  "port": "5672",
  "provider": "rabbitmq",
  "type": "rabbitmq",
  "username": "default_user_0T58DCWQFcWQbLrv3hy"
}

Services

Infrastructure

go-faas-t's People

Contributors

thequeenisdead avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.