Code Monkey home page Code Monkey logo

coffeeshop-on-nomad's Introduction

coffeeshop-on-nomad

The .NET coffeeshop application runs on Nomad and Consul Connect

Services

No. Service Name URI
1 product-service http://localhost:5001 and http://localhost:15001
2 counter-service http://localhost:5002
3 barista-service http://localhost:5003
4 kitchen-service http://localhost:5004
5 reverse-proxy (local development only) http://localhost:5000
6 signalr-web (local development only) http://localhost:3000
7 datagen-app (local development only)

Get starting

Control plane UI:

Using client.http to explore the application!

devcontainer setup

F1 in vscode and choose Remote-Containers: Open Folder in Container..., then waiting until it build sucessful

# check linux version
> cat /etc/os-release
# build all images of application
> docker compose build 

Open a new tab

> cd local/
$ sudo chmod +x core-libs.sh start.sh
$ sudo ./core-libs.sh
# nomad cannot run on wsl2 image, then we need to work-around
$ sudo mkdir -p /lib/modules/$(uname -r)/
> echo '_/bridge.ko' | sudo tee -a /lib/modules/$(uname -r)/modules.builtin
# Start nomad and consul
> ./start.sh

Open another new tab

> cd nomad/jobs
> nomad job run traefik.nomad.hcl
> nomad job run postgresdb.nomad.hcl
> nomad job run rabbitmq.nomad.hcl
> nomad job run product-api.nomad.hcl
> nomad job run counter-api.nomad.hcl
> nomad job run barista-api.nomad.hcl
> nomad job run kitchen-api.nomad.hcl

Finally, you can play around using client.http to explore the application!

Clean up

> nomad job stop kitchen-api.nomad.hcl
> nomad job stop barista-api.nomad.hcl
> nomad job stop counter-api.nomad.hcl
> nomad job stop product-api.nomad.hcl
> nomad job stop rabbitmq.nomad.hcl
> nomad job stop postgresdb.nomad.hcl
> nomad job stop traefik.nomad.hcl

Troubleshooting

Couldn't run sebp/elk:latest on Docker (Windows 11 - WSL2 with Docker for Desktop integrated)

error: elasticsearch_1 | max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Jump into wsl2, then run command below

$ sudo sysctl -w vm.max_map_count=262144

Now, we can run docker-compose up again.

References

coffeeshop-on-nomad's People

Contributors

thangchung avatar

Stargazers

 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.