https://github.com/josecelano/mandelbrot-api
API to generate two types of Mandelbrot images: tiles and point orbits
https://github.com/josecelano/mandelbrot-api
Last synced: about 2 months ago
JSON representation
API to generate two types of Mandelbrot images: tiles and point orbits
- Host: GitHub
- URL: https://github.com/josecelano/mandelbrot-api
- Owner: josecelano
- Created: 2020-06-28T18:03:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-02T17:17:20.000Z (over 4 years ago)
- Last Synced: 2025-04-01T21:54:37.858Z (2 months ago)
- Language: Python
- Size: 67.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.com/github/josecelano/mandelbrot-api)
# Mandelbrot API
Online demo: https://mandelbrot-set-periods.online/api
This service is an API to generate two types of Mandelbrot images:
* Image tiles: a tile of the Mandelbrot Set fractal.
* Orbit graphs: graph representing the iterations values for a given Mandelbrot Set point, calculating recursively the formula `f(z) = z² + c` where `z` and `c` are complex numbers.Sample image tile:
Sample point orbit for point (-0.1,0.7) with period 3:
## Development
Setup (docker build)
```
./bin/dev-setup
```Run API (dev mode):
```
./bin/dev-serve
```
And open http://0.0.0.0:5000/## Usage
```
docker pull josecelano/mandelbrot-api
docker run -it --rm \
-p 80:80 \
-w /app \
mandelbrot-api
```## Deploy
The demo environment was deployed to [Digital Ocean Kubernetes](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-on-digitalocean-kubernetes-using-helm).
You can see the `yaml` files in [deploy/k8s](deploy/k8s) folder.
Init cluster:
```shell
helm install nginx-ingress stable/nginx-ingress --set controller.publishService.enabled=true
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.crds.yaml
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm install cert-manager --version v0.14.1 --namespace cert-manager jetstack/cert-manager
kubectl create -f ./deploy/k8s/production-issuer.yaml
```Deploy app:
```shell
kubectl create -f ./deploy/k8s/mandelbrot-api.yaml
kubectl create -f ./deploy/k8s/mandelbrot-api-ingress.yaml
```Re-deploy app after changing docker image:
```
kubectl rollout restart deployment mandelbrot-api
```## Related projects
This API uses these two command line applications:
* [Console command to generate tiles](https://github.com/josecelano/c-mandelbrot-arbitrary-precision)
* [Console command to generate orbits](https://github.com/josecelano/mandelbrot-orbit)