GithubHelp home page GithubHelp logo

r1cm3d / fib Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.77 MB

This containerized reactive RESTful API implements an efficient Θ(log.n) fibonacci algorithm using Quarkus framework

License: GNU General Public License v3.0

Kotlin 10.11% Java 52.55% Dockerfile 10.77% Makefile 12.96% Shell 13.60%
java vertx quarkus reactive mutiny docker docke-compose makefile k8s

fib's Introduction

fib

This containerized reactive RESTful API implements an efficient Θ(log.n) fibonacci algorithm using Quarkus framework

Table of Contents

TLDR

./configure

Configure will check if all prerequisites are installed. It uses command application. See: Important Disclaimer at the top of the configure file for troubleshooting.

make && make install

To assemble Docker container and create executable file (just an alias for docker run command).

./fib

The output should be:

exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/quarkus-run.jar
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-07-29 18:40:32,968 INFO  [io.quarkus] (main) fib 0.0.1-SNAPSHOT on JVM (powered by Quarkus 2.0.3.Final) started in 0.996s. Listening on: http://0.0.0.0:8080
2021-07-29 18:40:32,970 INFO  [io.quarkus] (main) Profile prod activated.
2021-07-29 18:40:32,970 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy-reactive, smallrye-context-propagation, vertx]

Running on Bash

Prerequisites

Make 4.2.1 Docker 20.10.2 OpenJDK 11 Minikube 1.22.0 Kubectl 1.18.3

To run in Docker container

You only need Make (tested with GNU Make 4.2.1, but it should work on others) and Docker (tested with Docker version 20.10.2, build 2291f61) installed. It is important to give execution permission for scripts/:

chmod +x scripts/

They are safe, but you could check it out if you don't believe me. 😄

To run locally

make run-local

It will build locally and run using java executable. (Must have a JVM installed)

Test

Unit test

make test

Large n argument

[r1cm3d]@[PISMOWL114]:~/dev/projects/fib
> (main) $ time curl http://localhost:8080/fib?n=70000000
a lot of numbers...
real    3m18,691s
user    0m0,018s
sys     0m0,167s

Deploy

make start-k8s && make deploy-k8s

It will start minikube and deploy fib application and fib_hpa which is an autoscaler based on CPU and memory utilization. Autoscaler is need to be compliance with scale requirement based on workload.

fib's People

Contributors

r1cm3d avatar

Watchers

 avatar

fib's Issues

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.