Giter Site home page Giter Site logo

alg-sem-2's Introduction

ALG seminarska 2

Run

Use docker-compose (or Docker directly if running newer version) to build and run server and agents:

docker-compose up --build

or

docker compose up --build

Server is then exposed on port 5000, so you can invoke consensus endpoint by creating HTTP request of type POST on http://localhost:5000/consensus.

cURL command: curl --location --request POST 'http://localhost:5000/consensus'.

Server then returns response in following format:

{
    // coordinates of chosen meeting point
    "meetingPoint": {
        "x": 16.943072330772665,
        "y": 26.88015977684865
    },
    // steps needed to calculate consensus
    "steps": 15
}

Run locally

Run pip install -r requirements.txt in virtualenv to install required dependencies.

Server is configured using following environment variables:

  • ALG_SERVER_PORT (port where server should run, like 5000)
  • ALG_ENV (either set to prod or dev (default), to enable debugger's logs)

Agent is configured using following environment variables:

  • ALG_AGENT_ID (unique agent id, like agent-1)
  • ALG_SERVER_ADDR (root url of server, ie. http://localhost:5000)
  • ALG_AGENT_ADDR (root url of agent, ie. http://localhost:5001)
  • ALG_AGENT_PORT (port where agent should run, like 5001+)
  • ALG_ENV (either set to prod or dev (default), to enable debugger's logs)

Build Docker image

To build docker image for either service, run from project root:

docker build -f Dockerfile.server -t alg-server:latest .
docker build -f Dockerfile.agent -t alg-agent:latest .

alg-sem-2's People

Contributors

jamsek-m avatar matejbizjak avatar

Watchers

 avatar  avatar  avatar

alg-sem-2's Issues

Izris grafa

Izris rezultata (kje so bili agenti in kje je bilo izbrano zbirališče)

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.