writing new microservices

27 views
Skip to first unread message

dericed

unread,
May 24, 2011, 3:39:20 PM5/24/11
to archivematica
Hi all,
I'm testing archivematica out and am looking to see if there is any
documentation or hints to help users write new microservices, such as
calling a shell or ruby script at some point in the ingest or check
procedures. I see some xml documents that give an overview of the
details associated with each microservice, but am not sure where to go
next or how possible it is for users to extend functionality on their
own.
Thanks all,
Dave Rice

Joseph Perry

unread,
May 24, 2011, 4:33:37 PM5/24/11
to archiv...@googlegroups.com
Hi Dave Rice,
There is no such wiki page for a how to on extending the microservices.
It sounds like a good idea, and I've created issue 597 to that end:
http://code.google.com/p/archivematica/issues/detail?id=597

I'll give you a heads up now, that we are discussing changing some
aspects of how the MCP creates and manages tasks.

There is some information on the wiki that might be helpful:
http://archivematica.org/wiki/index.php?title=MCP
http://archivematica.org/wiki/index.php?title=MCP_Basic_Configuration
http://archivematica.org/wiki/index.php?title=MCP_Configuration

What you really need to know though, is clients support tasks. Their
list of supported tasks is defined in the archivematicaClientModules file:
/etc/archivematica/MCPClient/archivematicaClientModules

You'll notice these are mapped to executables in the system, most of
them scripts in the client scripts directory:
/usr/lib/archivematica/MCPClient/clientScripts/

This is a security measure, so clients will only execute specified
executables, they tell the server they support.

You'll notice the watched directories and output directories in the
mcpModulesConfig are chained, so the output feeds the input of the next one.
/etc/archivematica/MCPServer/mcpModulesConfig

To add a microservice:
You need to create a new watched directory, in the shared directory,
watched directories:
/var/archivematica/sharedDirectory/watchedDirectories/
Create the .xml microservice Config file
/etc/archivematica/MCPServer/mcpModulesConfig
Modify the surrounding config files in the chain, so it properly feeds
in and out of the watch directories.
**NOTE: all directories in the config files end with a '/'
Modify the /etc/archivematica/MCPClient/archivematicaClientModules to
include the supported task, and specify the script to run, preferably
located in the client scripts directory:
/usr/lib/archivematica/MCPClient/clientScripts/
and of course create your script.

I think this is a decent example of such a commit:
http://code.google.com/p/archivematica/source/detail?r=1391


I hope that helps,
I'd really like to see other developers patches and ideas, so please
feel free to share what you create:
http://archivematica.org/wiki/index.php?title=Contribute_code

Joseph

--
Joseph Perry,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | P: 604.527.2056 | F: 604.521.2059

Reply all
Reply to author
Forward
0 new messages