Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Ns web vm deployment #255

Merged
merged 14 commits into from
Apr 13, 2017
Merged

Ns web vm deployment #255

merged 14 commits into from
Apr 13, 2017

Conversation

kennethgillen
Copy link
Member

@kennethgillen
Copy link
Member Author

This version run yesterday to provision ns-web-vm.

LS27172:nightshade-web kenny$ echorun ansible-playbook -l ns-web.openmicroscopy.org -i ~/Forks/management_tools/ansible/inventory/prod-hosts --ask-become-pass playbook.yml | tee ns-web-provision_$(date -u +"%Y%m%d-%H%M%SZ").log

Run:
ns-web-provision_20170329-150136Z.txt

Run (after removing yum exclusions for check-mk):
ns-web-provision_20170329-152200Z.txt

@kennethgillen
Copy link
Member Author

kennethgillen commented Apr 7, 2017

This version run a few minutes ago, installing SSL config and certificate.

LS27172:nightshade-web kenny$ echorun ansible-playbook --diff -l ns-web.openmicroscopy.org -i ~/Forks/management_tools/ansible/inventory/prod-hosts --ask-become-pass --ask-vault-pass playbook.yml | tee ns-web-p
rovision_$(date -u +"%Y%m%d-%H%M%SZ").txt
# Fri  7 Apr 2017 16:41:23 BST:  ansible-playbook --diff -l ns-web.openmicroscopy.org -i /Users/kenny/Forks/management_tools/ansible/inventory/prod-hosts --ask-become-pass --ask-vault-pass playbook.yml

Dependent config in private repo https://github.com/openmicroscopy/management_tools/pull/352

ns-web-provision_20170407-154123Z.txt

https://ns-web.openmicroscopy.org/webgateway/img_detail/3933597/

@kennethgillen
Copy link
Member Author

(temporary) manual configuration of ns-web performed installs the web-extensions to bring ns-web to feature parity with Nightshade. Server ready for testing. Not added to the playbook, as it's changes that won't be necessary with 5.3.0. Can be added later if required.

@kennethgillen
Copy link
Member Author

Now added the 'manual' install steps for figure and webtagging, as mentioned in #255 (comment), as I want to use the Ansible to push more config settings, so require it to continue to work.


handlers:

# Handler for nginx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The omero-common role already includes a set of useful handlers, you should be able to use that instead of redefining one here.

Copy link
Member Author

@kennethgillen kennethgillen Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - I didn't realise I could use things defined 'underneath' the playbook when I wrote that. From programming, I wouldn't have expected global scope for defined functions like that. I subsequently used e.g. the 'restart systemd' handler too, so you can see I learned, but didn't strip the original nginx one from the playbook.

destfile: /etc/systemd/system/omero-web.service.d/pythonpath.conf
owner: "root"
group: "root"
block: |2+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the fancy formatting provided by |2+? Will just plain | do?

Copy link
Member Author

@kennethgillen kennethgillen Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't make it work any other way, so leaving it as 'this works'. Other options failed completely with errors, or didn't give the indenting in the destination. I am pretty new to YAML and the whitespace significance, though.

file:
path: "{{ omero_web_extensionsdir }}"
state: directory
owner: "{{ omero_web_system_user }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this directory need to be writeable by the web user? And similarly for the tasks below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but this works, and it's how it's set up elsewhere. If you've another suggestion, happy to hear it.

Copy link
Member

@manics manics Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it owned by root unless you have reason to believe OMERO.web needs write access to its code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it.

template:
src: templates/omero-web-config-for-webapps.j2
dest: "{{ omero_web_basedir }}/config/omero-web-config-for-webapps.omero"
owner: "{{ omero_web_system_user }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be writeable by web?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set now to root:root.

group: "{{ omero_web_system_user }}"
mode: "u=rw,go=r"
notify:
- omero-web restart omero-web
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the handler from omero-common restart omero-web instead of the one embedded in the omero-web role which was intended for internal use by the role?

Copy link
Member Author

@kennethgillen kennethgillen Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯ I just grep -R restart * and found this in use elsewhere and having learned it's possible to re-use them, I used it. I can try.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, seems to work

changed: [infra-testpr.openmicroscopy.org]

RUNNING HANDLER [openmicroscopy.omero-common : restart omero-web] **************
changed: [infra-testpr.openmicroscopy.org]

PLAY RECAP *********************************************************************
infra-testpr.openmicroscopy.org : ok=3    changed=2    unreachable=0    failed=0


config set -- omero.web.apps '["autotag", "tagsearch", "figure"]'
config set -- omero.web.ui.center_plugins '[["Auto Tag", "autotag/auto_tag_init.js.html", "auto_tag_panel"]]'
config set -- omero.web.ui.top_links '[["Data", "webindex", {"title": "Browse Data via Projects, Tags etc"}], ["History", "history", {"title": "History"}], ["Help", "http://help.openmicroscopy.org/", {"target": "new", "title": "Open OMERO user guide in a new tab"}], ["Figure", "figure_index", {"target": "new", "title": "Open OMERO.Figure in a new tab"}], ["Tag Search", "tagsearch"]]'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point: there's no significant templated variables in here, so it could be a plain file (task copy instead of a template)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 will consider it for next time.

@kennethgillen
Copy link
Member Author

Current 7003b1e successfully working on infra-testpr, figure generation and tagsearch both AOK.

PLAY RECAP *********************************************************************
infra-testpr.openmicroscopy.org : ok=65   changed=37   unreachable=0    failed=0

Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of non-blocker comments. Looks good to me.

owner="{{ item.value.owner }}"
group="{{ item.value.group }}"
mode="{{ item.value.mode }}"
with_dict: "{{ nginx_ssl_cert_files }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with_dict looks a bit weird here, though I haven't seen the actual variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, looks overly complicated since the owner/group/mode don't vary

- name: OMERO.web apps | download latest figure
become: yes
unarchive:
src: https://downloads.openmicroscopy.org/latest/figure.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For full reproducibility you should use the versioned zip https://downloads.openmicroscopy.org/figure/1.2.1/figure-1.2.1.zip since you've got creates: "{{ omero_web_extensionsdir }}/figure-{{omero_web_extensions_figure_ver}}" below

---

- name: openmicroscopy.omero-common
src: https://github.com/openmicroscopy/ansible-role-omero-common.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to add versions once these have been tagged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 see workaround in ome/pydoop-features@fec18e1 until we have tags being properly pushed to galaxy again (ansible/galaxy-issues#252)

Copy link
Member

@manics manics Apr 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively since you've got git installed on the machine that's running Ansible you can just add version: X.X.X, e.g. IDR/deployment@d74d7c3
The main advantage of ome/pydoop-features@fec18e1 is you don't need to install git.

@kennethgillen
Copy link
Member Author

ns-web reset to 'post provision' snapshot, and redeployed this playbook at current version, combined with private config at 11901be

ns-web-provision_20170412-173859Z.txt
ns-web-provision_20170412-171603Z.txt

@kennethgillen
Copy link
Member Author

kennethgillen commented Apr 13, 2017

re-ran with updated 'total cores' math (matching private config https://github.com/openmicroscopy/management_tools/pull/352/commits/9292f47b294acb09d6e043fe626ae45237357113)

ns-web-provision_20170413-101658Z.txt

PLAY RECAP *********************************************************************
ns-web.openmicroscopy.org  : ok=59   changed=4    unreachable=0    failed=0

@sbesson sbesson merged commit e75bdc7 into ome:master Apr 13, 2017
@kennethgillen kennethgillen deleted the ns-web-vm branch April 13, 2017 10:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants