Giter VIP home page Giter VIP logo

zoe_agent_manager's Introduction

Zoe Agent Manager Agent version

An agent manager for Zoe.

Requirements

This agent requires git in order to work.

Installation

  • Clone or download the source code from this repository.

  • Open a terminal in the directory in which you downloaded the source and run the following:

$ export ZOE_HOME=PATH_TO_YOUR_ZOE_INSTALLATION

$ chmod +x zam/preinst

$ zam/preinst

This will download the dependencies and create the configuration directories. Check that the etc/zam/list file contains only one entry named [zam].

  • Move the agents directory into ZOE_HOME/

  • Move the cmdproc directory into ZOE_HOME/

  • Add the following to the etc/zoe.conf file (you can choose the port):

[agent zam]
port = YOUR_PORT
  • Next time you start the server, the agent should be up and running.

What can the agent do?

The etc/zam/ directory contains the agent's configuration files, including a list of agents and their files.

  • The etc/zam/list file is a list of agents for which the source URL is known and their status (installed, version).

  • The etc/zam/info directory can contain two types of files: the *.conffiles contain a list of configuration files for the agent. These files will only be removed if the agent is uninstalled using purge. The *.list contain a list of regular files for the agent. These files are removed when uninstalling an agent normally.

Now, for a proper list of actions:

  • add an agent to the repository (without installing)
  • clean the temporary directory
  • install an agent
  • launch an agent (done automatically when an agent is installed)
  • purge an agent, removing/uninstalling it and all its configuration files
  • remove/uninstall an agent
  • remove an agent from the agent list
  • restart a running agent
  • stop a running agent
  • update an agent

For examples and more information on the commands, please check the wiki.

That's nice, but how do I make my agent installable?

Again, check the wiki :)

zoe_agent_manager's People

Contributors

rmed avatar

Stargazers

Javier Honduvilla Coto avatar

Watchers

James Cloos avatar  avatar

zoe_agent_manager's Issues

Some questions and suggestions

  • zoe agents are started and stopped via zoe.sh but this agent also launches and stops installed agents. In order not to duplicate work, here are some suggestions:

A) add per-agent start/stop in zoe.sh script (trivial) and remove launch/stop from the manager, or...

B) make this agent responsible of all other agents (make it the equivalent of 'init')

  • add this agent to zoe-startup-kit and have it as an integral part of the project
  • you can assume there is an environment variable ZOE_HOME pointing to the zoe installation dir. Configuration files can be simplified under this assumption

Please let me know what do you think and if I can help in any way

Move launch and stop to the zoe.sh script

These functions should be implemented in the zoe.sh script to in order to improve usability and not duplicate code. Needed functions would be:

  • A launch function that launchs a single agent rather than the whole lot (used when installing or updating agents)
  • A stop function that stops a single agent (used when installing or updating agents)
  • A restart function that stops and launches a single agent. This one would be very important if we want to be able to update the manager like the rest of the agents.

The manager would still have these functions available, but calling to the zoe.sh script instead.

exception when installing agents

Message received: {'dst': 'zam', 'tag': 'install', 'name': 'dhl'}
Candidate found: <bound method AgentManager.install of <main.AgentManager object at 0x24c3e10>>
Calling method <bound method AgentManager.install of <main.AgentManager object at 0x24c3e10>> with parameters {'dst': 'zam', 'tag': 'install', 'name': 'dhl'}
Cloning into '/home/pi/zoe-startup-kit/var/zam/dhl'...
Traceback (most recent call last):
File "/home/pi/zoe-startup-kit/lib/python/zoe/listener.py", line 130, in connection
self._delegate.receive(parser)
File "/home/pi/zoe-startup-kit/lib/python/zoe/deco/deco.py", line 109, in receive
tags = parser.tags()
File "/home/pi/zoe-startup-kit/lib/python/zoe/deco/deco.py", line 131, in dispatch
print("Too many candidates found")
File "/home/pi/zoe-startup-kit/lib/python/zoe/deco/deco.py", line 169, in docall
elif arg in defaults:
File "./zam.py", line 126, in install
file_list = self.move_files(name)
File "./zam.py", line 541, in move_files
new_path = new_path.replace(env["ZOE_HOME"], "")
AttributeError: 'NoneType' object has no attribute 'replace'

Agent dependencies

There may be times where an agent requires an additional library or component installed in the machine. In order to prevent Zoe (and the agents) from touching system files, these additional components could be placed in the ZOE_HOME/lib directory, under their corresponding subdirectory.

This would mean that is up to the agent's developer to provide the installation of the dependencies. The preinst and postinst scripts could be used for this matter.

For instance, if an agent written in Python requires the SQLAlchemy module, it could be installed with the pip tool like so:

#!/bin/bash
# zam/preinst
# This script is executed before the installation of the agent takes place.

# Define the user directory
export PYTHONUSERBASE=${ZOE_HOME}/lib/python

# Install SQLAlchemy into that directory
pip install --user SQLAlchemy

The dependencies could also be included in the agent's repository and installed by the manager normally, but that would depend on the license of the code involved.

Any thoughts on this @voiser?

Better dependency handling

Dependency handling is quite limited right now in some points:

  • Agent developer must manage dependency installation
  • Libraries may have conflicting versions
  • If an agent is uninstalled, dependencies remain

In the long term, it would be nice to have a different way of handling external dependencies for agents (or improve the current one).

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.