Coder Social home page Coder Social logo

clonemapy's People

Contributors

kwe712 avatar s-daehling avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

clonemapy's Issues

Prevent use of signal in other threads than the main thread

When new agents are started, the create_agent method is executed in a thread other than the main thread.
Since signal handlers are altered in this method, this causes problems.
To fix this issue make create_agent always be executed in the main thread.

Agency reaction on fatal Agent error

Current behavior: When an Agent's task() function ends with a runtime error, it stops running without further consequence

Desired behaviour: Runtime error should be returned to agency and logged properly, and the agency should come to a graceful stop

Feature: adding new agent to specific agency

Currently the AMS assigns a new agent to the first agency it finds that has space left, or creates a new agency if there is none.

The idea is to give the AMS a preferred AgencyID when registering a new agent, so that the AMS will add the agent to that specific agency if possible.

The current workflows for adding new agents in clonemapy is as follows (writing this down half for clarity and half so @s-daehling can correct me if i'm wrong):

  1. Clonemapy: update_or_create_agent() is called in clonemapy/ams.py
  2. Clonemapy: Calls new_agent(), which posts specs for new agent(s) to "http://"+host+"/api/clonemap/mas/"+str(masid)+"/agents"
  3. Clonemap: Handler for this (as defined in clonemap/pkg/ams/handler.go) unmarshals content and calls ams.createAgents()
  4. Clonemap: ams.createAgents() adds new agent(s) and either posts them to an existing agency or creates a new one if no space is left

The posting of the agents to the clonemap AMS (step 2) gives the needed information in the format of the ImageGroupSpec schema. This contains the ImageGroupConfig as well as the AgentSpec struct, which does not contain a field for the AgencyID.

So the question is how to communicate an AgencyID along this path while sticking to the existing data models as much as possible.
If we were to add e.g. a function post_agents_to_agency() to clonemapy/ams.py, which takes the preferred AgencyID as an additional parameter, we would need to post using a data model that contains that ID in addition to AgentSpec and ImageGroupConfig, in order for a (new) handler within the ams to be able to parse it.

I'm posting this issue here because the question came up with @FWuellhorst regarding clonemapy first. To implement this though, changes to clonemap itself (adding a new handler and updating createAgents() with e.g. an optional parameter for the AgencyID) would also be necessary.

@s-daehling what do you think about this? Do you think there is a least-invasive way to do this?

Log error on invalid angency host name

if an agency is created and the socket hostname doesn't conform to the intended pattern we get an index out of range. there is a check for this, but no consequence:

'''
temp = socket.gethostname()
logging.info("Agency: Starting agency " + temp)
hostname = temp.split("-")
self.hostname = hostname
if len(hostname) < 4:
pass
masid = int(hostname[1])
'''

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.