Git Product home page Git Product logo

deploy-pub's Introduction

deploy-pub

A set of ansible playbooks that can be used to deploy Artefactual projects like AtoM and Archivematica.

These are samples, that require some local customization

To create a working development environment, you can use the Vagrantfiles included with each playbook. See the READMEs in each playbook for details.

deploy-pub's People

Contributors

amayita avatar djjuhasz avatar hakamine avatar jhsimpson avatar joel-simpson avatar jraddaoui avatar jrwdunham avatar mamedin avatar mcantelon avatar misilot avatar replaceafill avatar sbreker avatar scollazo avatar sevein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deploy-pub's Issues

Problem: default archivematica deploy uses non-existent oracle java installer

This is an example: https://github.com/artefactual/deploy-pub/blob/master/playbooks/archivematica/vars-singlenode-qa.yml#L15-L16

As described in artefactual-labs/ansible-elasticsearch#5 and artefactual-labs/ansible-elasticsearch#3 the oracle java installer referenced in the lines above no longer exists.

These lines could be removed entirely from the vars-singlenode files, relying on the defaults defined in the ansible-elasticsearch role instead.

Unable to provision using archivematica playbook with vars-singlenode-qa.yml (on Windows)

I've tried to provision a few times now using vars-singlenode-qa.yml instead of vars-singlenode-1.6.yml, and I keep getting the same error.

TASK [artefactual.archivematica-src : Checkout archivematica-storage-service code] ***
fatal: [am-local]: FAILED! => {"changed": false, "cmd": "/usr/bin/git checkout --track -b qa/0.x origin/qa/0.x", "failed": true, "msg": "Failed to checkout qa/0.x", "rc": 1, "stderr": "error: Your local changes to the following files would be overwritten by checkout:\n\t
storage_service/static/js/vendor/base64.js\nPlease, commit your changes or stash them before you can switch branches.\nAborting\n", "stderr_lines": ["error: Your local changes to the following files would be overwritten by checkout:", "\tstorage_service/static/js/vendor/
base64.js", "Please, commit your changes or stash them before you can switch branches.", "Aborting"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/vagrant/singlenode.retry

When I look at src/archivematica-storage-service, I see that branch stable/0.10.x is checked out even though archivematica_src_ss_version is set to "qa/0.x".

roles/artefactual.archivematica-src/tasks/ss-main.yml looks good. The version corresponds to the yml file and force is set to "yes".

Investigating...

Vagrant support for Windows

I was looking at installing Archivematica via Vagrant today, but I have a Windows workstation and Windows isn't supported as a control machine with Ansible. I suppose I could try using the Windows Subsystem for Linux, but that's not really supported by anyone either.

In any case, I think this could be the solution:
https://www.vagrantup.com/docs/provisioning/ansible_local.html

This has been used with Koha to allow Windows-based developers to use Vagrant as well.

I'm going to look at trying this out tomorrow, and then I'll send a pull request if I get it up and running.

Problem: minor details missing in digital ocean instructions

I installed Archivematica 1.7 using digital-ocean-install-example.rst

I used Ubuntu 16.04. The instructions still work great, but I noticed a few details that would be helpful to add / correct:

  • using Ubuntu 16.04, digital ocean only installs Python 3 by default. I had to add python 2.7 manually first.
  • the step about using user.yml wasn't totally clear to me, if nothing else because it was missing the actual ansible command $ ansible-playbook user.yml

I also had real troubles executing this deployment from either my Mac Air latop or iMac desktop. In both cases I had repeated problems with a particular dependency because of TLS errors, due to my Macs using an old version of OpenSSL.

- downloading role 'nodejs', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-nodejs/archive/4.1.1.tar.gz
 [ERROR]: failed to download the file: Failed to validate the SSL certificate for github.com:443. Make sure your managed systems have a valid CA certificate installed. You can use
validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/ansible,
/usr/local/etc/openssl. The exception msg was: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590).

 [WARNING]: - geerlingguy.nodejs was NOT installed successfully.

I tried to resolve this by updating OpenSSL but couldn't get it to work. In the end, I found it faster to simply set up another digital ocean droplet from which to run the ansible scripts. (I'm not sure whether any of this last issue is worth noting in the installation instructions, but I note it here just in case anyone else comes across this problem).

Task: Create Binder playbook

Since we have two branches in Binder now, stable/0.8.x (using ES 1.x) and qa/0.9.x (using ES 5.x), which will require to use the official Ansible role from ES, and considering that Binder can only run in PHP 5.6 in both cases; I think it's better to create a new playbook for Binder using Ubuntu Trusty and the ES Ansible role or the ES Artefactual role based on the version.

Problem: error generating special sampledata transfers in playbooks/archivematica

Using master at 86d70f4 without any changes, vagrant up fails in the following task:

TASK [artefactual.archivematica-src : Generate special sampledata transfers] ***
fatal: [am-local]: FAILED! => {"changed": false, "cmd": "/home/vagrant/archivematica-sampledata/createtransfers.py create-variously-encoded-files", "msg": "[Errno 2] No such file or directory", "rc": 2}

Problem: AM services require manual start up in Vagrant environment

When restarting the vagrant VM (vagrant halt -> vagrant up), archivematica services (archivematica-dashboard, archivematica-mcp-server, archivematica-mcp-client) require manual start up:
$ sudo start archivematica-storage-service
$ sudo start archivematica-mcp-server
$ sudo start archivematica-mcp-client
$ sudo start archivematica-dashboard

Seeing the following errors in the upstart log files:

Invalid value for chdir: /usr/lib/archivematica/storage-service
Error: can't chdir to '/usr/lib/archivematica/storage-service'

Invalid value for chdir: /usr/share/archivematica/dashboard
Error: can't chdir to '/usr/share/archivematica/dashboard'

/proc/self/fd/9: 4: /proc/self/fd/9: /usr/lib/archivematica/MCPServer/archivematicaMCP.py: not found

/proc/self/fd/9: 7: /proc/self/fd/9: /usr/lib/archivematica/MCPClient/archivematicaClient.py: not found

Allow to create AIPs using local content

Currently, we sync the "current" folder (the one we use to run "vagrant up") using "/vagrant" as path in the virtual machine.

Changing this path to /home/local-sync (or any other name), would allow users to put their own transfers on the same folder than the playbooks, and process them, beacause /home is configured as the default transfer source in the storage service

remove unused roles, and add packer to the repo

We have a working packer configuration to build atom boxes, we should move it here and build also archivematica vagrant boxes.

On the other side, the elasticsearch replication role available here, doesn't seem to fit with the repo, we should create a new git repo for it.

Problem: some vars- files are missing MySQL users and databases

Compare the following two files

The first contains the following but the second does not:

mysql_databases:
  - name: "{{ archivematica_src_am_db_name }}"
    collation: "utf8_general_ci"
    encoding: "utf8"

mysql_users:
  - name: "{{ archivematica_src_am_db_user }}"
    pass: "{{ archivematica_src_am_db_password }}"
    priv: "{{ archivematica_src_am_db_name }}.*:ALL,GRANT"
    host: "{{ archivematica_src_am_db_host }}"

Problem: Need a way to deploy Archivematica without Elasticsearch

Columbia University Library would like a way to install Archivematica without Elasticsearch
As described here: artefactual-labs/archivematica-acceptance-tests#23.

This is not meant to be the only way to deploy Archivematica, so the solution needs to allow a person deploying Archivematica to pick whether or not Elasticsearch is installed.

This will be one step towards being able to deploy a 'headless' Archivematica instance, where the dashboard is used only as a REST api, driven by requests from outside applications (such as the automation tools).

Problem: Archivematica 1.7 playbook fails due to missing java dependency

I installed Archivematica version 1.7.0 onto a digital ocean VM (using the digital-ocean-install-example.rst)

Running the singlenode.yml playbook failed attempting to install dependencies for ElasticSearch:

TASK [artefactual.elasticsearch : Install dependencies] *******************************************************************************************************************
fatal: [am-local]: FAILED! => {"changed": false, "msg": "No package matching 'openjdk-7-jre-headless' is available"}

I updated the playbook to replace '7' with '8' in the following 2 lines:
elasticsearch_apt_java_package: "openjdk-7-jre-headless"
elasticsearch_java_home: "/usr/lib/jvm/java-7-openjdk-amd64"

I was then able to re-run the playbook and complete the installation successfully.

Problem: playbooks/archivematica doesn't explain how to deploy QA

As f80bf57, if someone tries to deploy Archiveamtica using the deploy-pub/playbooks/archivematica it's unclear for a newcomer if stable or qa branches are being deployed. This just beat @mcantelon which is a sign that we're doing a poor job explaining it.

I suggest to have two environments:

  • deploy-pub/playbooks/archivematica
  • deploy-pub/playbooks/archivematica-qa

Or we could do a better job in the README file explaning how to download the right branch of the AM role (e.g. qa/1.7.x branch targets AM 1.7 and so on) and the right vars file.

Playbook does not upgrade MySQL 5x to 8x as required in 1.16

TASK [artefactual.archivematica-src : Run SS django database migrations] *********************************************************************************************************************************************
le \"/usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.9/site-packages/django/db/backends/base/base.py\", line 214, in check_database_version_supported\n    raise NotSupportedError(\ndjango.db.utils.NotSupportedError: MySQL 8 or later is required (found 5.7.44).

Problem: error installing front-end dependencies in playbooks/archivematica

Using master at 86d70f4 without any changes, vagrant up fails in the following task:

TASK [artefactual.archivematica-src : Install front-end dependencies] **********
changed: [am-local] => (item=/vagrant/src/archivematica/src/dashboard/frontend/appraisal-tab)
failed: [am-local] (item=/vagrant/src/archivematica/src/dashboard/frontend/transfer-browser) => {"changed": true, "cmd": ["npm", "install"], "delta": "0:00:16.859546", "end": "2018-03-20 15:43:55.774615", "item": "/vagrant/src/archivematica/src/dashboard/frontend/transfer-browser", "msg": "non-zero return code", "rc": 1, "start": "2018-03-20 15:43:38.915069", "stderr": "npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.\nnpm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.\nnpm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.\nsh: 1: webpack: not found\nnpm ERR! file sh\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno ENOENT\nnpm ERR! syscall spawn\nnpm ERR! [email protected] prepublish: `webpack --progress --colors --entry ./app.js`\nnpm ERR! spawn ENOENT\nnpm ERR! \nnpm ERR! Failed at the [email protected] prepublish script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /var/lib/archivematica/.npm/_logs/2018-03-20T15_43_55_756Z-debug.log", "stderr_lines": ["npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.", "npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.", "npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.", "sh: 1: webpack: not found", "npm ERR! file sh", "npm ERR! code ELIFECYCLE", "npm ERR! errno ENOENT", "npm ERR! syscall spawn", "npm ERR! [email protected] prepublish: `webpack --progress --colors --entry ./app.js`", "npm ERR! spawn ENOENT", "npm ERR! ", "npm ERR! Failed at the [email protected] prepublish script.", "npm ERR! This is probably not a problem with npm. There is likely additional logging output above.", "", "npm ERR! A complete log of this run can be found in:", "npm ERR!     /var/lib/archivematica/.npm/_logs/2018-03-20T15_43_55_756Z-debug.log"], "stdout": "\n> [email protected] prepublish /vagrant/src/archivematica/src/dashboard/frontend/transfer-browser\n> webpack --progress --colors --entry ./app.js", "stdout_lines": ["", "> [email protected] prepublish /vagrant/src/archivematica/src/dashboard/frontend/transfer-browser", "> webpack --progress --colors --entry ./app.js"]}

Nginx requires a restart after vagrant up

You need to manually restart it currently to get it working:

sudo service nginx reload

Also I think this repo could use some version tags as a lot of things are changed in it and it's quite hard to install and older version. You need to explicitly lookup a certain commit where it was changed.

Problem: we're not using Ansible pipelining support

This is perhaps more of a question, or a suggestion. When using deploy-pub locally with Vagrant I see that deployments are significantly faster when I enable SSH pipelining with:

[ssh_connection]
pipelining = True

Would it be a good idea to include that directive in the ansible.cfg documents in this repository? It seems like a good default, officially supported by Ansible. Or would that be a conflict with other tools you use like mitogen?

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.