sogno-platform / clonemapy Goto Github PK
View Code? Open in Web Editor NEWPython library for cloneMAP (https://github.com/sogno-platform/clonemap)
License: Other
Python library for cloneMAP (https://github.com/sogno-platform/clonemap)
License: Other
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.
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
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):
update_or_create_agent()
is called in clonemapy/ams.py
new_agent()
, which posts specs for new agent(s) to "http://"+host+"/api/clonemap/mas/"+str(masid)+"/agents"
clonemap/pkg/ams/handler.go
) unmarshals content and calls ams.createAgents()
ams.createAgents()
adds new agent(s) and either posts them to an existing agency or creates a new one if no space is leftThe 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?
Currently, deleting an agent does not work.
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])
'''
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.