Difference between revisions of "Getting started"
(→Ansible & Vagrant: Specify Ubuntu is the expected distro for apt-get) |
(→Projects: SS docs now has its own repo) |
||
Line 24: | Line 24: | ||
* [https://github.com/artefactual/archivematica-devtools Development tools]: Scripts to help with development. E.g. restarting services, workflow analysis | * [https://github.com/artefactual/archivematica-devtools Development tools]: Scripts to help with development. E.g. restarting services, workflow analysis | ||
* [https://github.com/artefactual/archivematica-fpr-tools FPR tools]: All the tools, commands and rules used to populate the FPR database. Changes to the FPR should be submitted here. | * [https://github.com/artefactual/archivematica-fpr-tools FPR tools]: All the tools, commands and rules used to populate the FPR database. Changes to the FPR should be submitted here. | ||
− | * [https://github.com/artefactual/archivematica-docs Archivematica Documentation]: Documentation found at https://www.archivematica.org/en/docs/ | + | * [https://github.com/artefactual/archivematica-docs Archivematica Documentation]: Documentation found at https://www.archivematica.org/en/docs/ for Archivematica |
+ | * [https://github.com/artefactual/archivematica-storage-service-docs Storage Service Documentation]: Documentation found at https://www.archivematica.org/en/docs/ for the Storage Service | ||
* [https://github.com/artefactual/automation-tools Automation Tools]: Scripts used to automate processing material through Archivematica | * [https://github.com/artefactual/automation-tools Automation Tools]: Scripts used to automate processing material through Archivematica | ||
* [https://github.com/artefactual/deploy-pub Deployment]: Ansible scripts for deploying and configuring Archivematica | * [https://github.com/artefactual/deploy-pub Deployment]: Ansible scripts for deploying and configuring Archivematica |
Revision as of 12:14, 11 May 2016
Main Page > Development > Getting Started
This wiki page describes getting started with Archivematica as a developer. For user and administrative manuals, please see http://www.archivematica.org.
Vital Stats
- Language: Python (primarily)
- License: AGPL
- VCS: git
- Major libraries: Django, gearman (Python API)
- Contribution guidelines
Projects
Archivematica consists of several projects working together.
- Archivematica: Main repository containing the user-facing dashboard, task manager MCPServer and clients scripts for the MCPClient
- Storage Service: Responsible for moving files to Archivematica for processing, and from Archivematica into storage
- Format Policy Registry: Submodule shared between Archivematica and the Format Policy Registry (FPR) server that displays and updates FPR rules and commands
There are also several smaller repositories that support Archivematica in various ways. In general, you will not need these to develop on Archivematica.
- Development tools: Scripts to help with development. E.g. restarting services, workflow analysis
- FPR tools: All the tools, commands and rules used to populate the FPR database. Changes to the FPR should be submitted here.
- Archivematica Documentation: Documentation found at https://www.archivematica.org/en/docs/ for Archivematica
- Storage Service Documentation: Documentation found at https://www.archivematica.org/en/docs/ for the Storage Service
- Automation Tools: Scripts used to automate processing material through Archivematica
- Deployment: Ansible scripts for deploying and configuring Archivematica
- Deployment-Archivematica: Ansible playbook for Archivematica package install.
- Deployment-Archivematica-dev: Ansible playbook for Archivematica github install.
- Fixity checker: Commandline tool that assists in checking fixity for AIPs stored in Archivematica Storage Service instances.
- Sample data: Data to test and show off Archivematica's processing
- History: Contains the pre-git history of Archivematica. Useful for checking the origins of code.
Installation
There are two main ways to run Archivematica in development.
- Use ansible and vagrant to install Archivematica in a VM
- Install Archivematica on your development machine
- Alternate vagrant based installations exist as well
Ansible & Vagrant
To install and run Archivematica from source on a VM:
- Checkout deployment repo
git clone https://github.com/artefactual/deploy-pub.git
cd deploy-pub/playbooks/archivematica
- Install VirtualBox, Vagrant, Ansible
sudo apt-get install virtualbox vagrant
(Ubuntu)- Vagrant must be at least 1.5 (it can also be downloaded from vagrantup.com)
vagrant --version
sudo pip install -U ansible
- Download Ansible roles
ansible-galaxy install -f -r requirements.yml
- (Optional) Change the branch by modifying
vars-singlenode.yml
archivematica_src_am_version: "branch-name"
archivematica_src_ss_version: "branch-name"
- Create virtual machine and provision it
vagrant up
(it takes a while)
- Login now available via:
vagrant ssh
- Services available:
- Archivematica - http://192.168.168.192
- Archivematica Storage Service: http://192.168.168.192:8000 (user: test, pass: test)
- Provisioning (via ansible) can be re-run
vagrant provision
- Or with ansible directly
ansible-playbook -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory singlenode.yml -u vagrant --private-key .vagrant/machines/am-local/virtualbox/private_key [--extra-vars=archivematica_src_dir=/path/to/code]
This allows you to pass ansible-specific parameters, such as--start-at="name of task"
Development Machine
See development environment setup instructions
Alternative Vagrant projects
- https://github.com/emltech/eml-archivematica-vagrant
- https://github.com/statsbiblioteket/archivematica-vagrant
Tests
Archivematica and the related projects have a small but growing test suite. We use py.test to run our tests, which should be listed as a requirement in the development/local requirements file.
To run the tests, go to the repository root and run py.test
See below for project-specific setup or changes to running the tests.
Archivematica
Before running Archivematica tests, set the following environment variable.
#!/usr/bin/fish set -xg PYTHONPATH /usr/share/archivematica/dashboard/:/usr/lib/archivematica/archivematicaCommon/
#!/usr/bin/bash export PYTHONPATH=$PYTHONPATH:/usr/share/archivematica/dashboard/:/usr/lib/archivematica/archivematicaCommon/
Storage Service
Before running Storage Service tests, set the following environment variables
#!/usr/bin/fish set -xg PYTHONPATH (pwd)/storage_service # The project root set -xg DJANGO_SETTINGS_MODULE storage_service.settings.test set -xg DJANGO_SECRET_KEY 'ADDKEY'
#!/usr/bin/bash export PYTHONPATH=$(pwd)/storage_service # The project root export DJANGO_SETTINGS_MODULE=storage_service.settings.test export DJANGO_SECRET_KEY='ADDKEY'