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

ome-dundeeomero next steps / cleanup #273

Merged
merged 8 commits into from
Jun 6, 2017

Conversation

kennethgillen
Copy link
Member

Next steps and cleanup for the New Nightshade server pair.

@kennethgillen
Copy link
Member Author

Full playbook run of 'nightshade-web' tested on a test system (infra-testpr), installs from pypi omero-figure and FPBioimage viewer.

@kennethgillen
Copy link
Member Author

NFS remote processing mount added to playbook and deployed on live system. Tested working.

@kennethgillen
Copy link
Member Author

@joshmoore - note the addition of an upgrade_webapps == "True" - cli-flag based upgrade for safety. Else 'state: present'.

@kennethgillen kennethgillen merged commit bb9eff0 into ome:master Jun 6, 2017
@kennethgillen kennethgillen deleted the dundeeomero-next_steps branch June 6, 2017 15:32
@kennethgillen
Copy link
Member Author

If any @openmicroscopy/devops would like to have a look-over that'd be good.

I merged to document the changes made to the live system, to continue work on the ome-demoserver, but it's still worth an 👀 from others.

- reload systemd
# Set desired state of webapps (upgrade v.s. install/keep current version)
- set_fact:
webapps_state: present
Copy link
Member

Choose a reason for hiding this comment

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

FYI set_fact will set a host-var that may persist across playbooks in the same ansible-playbook command, so there's a (small) danger of inadvertent variable conflicts, especially with shorter names and more complex deployments. Since this var is only used in one place you could get rid of it completely and in name: Omero.web plugins | plugin install via pip & pypi have state: "{{ webapps_state | default('present') }}", and pass -e webapps_state=latest on the command line to upgrade.

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 - thanks, I couldn't find how to do make that conditional just work, without registering the fact. I read that indeed it would persist, so made sure to initialise it first with no conditional to present. Thanks for the syntax, and I'll refactor this as you suggest.

no_log: true

# This to be refactored for RHEL/non-spacewalk at some point
Copy link
Member

Choose a reason for hiding this comment

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

If you refactor I can think of two options:

  • Install/configure openmicroscopy.system-monitor-agent in each server's playbook as at present
  • Remove all mentions of openmicroscopy.system-monitor-agent in individual playbooks and have a single site-wide playbook that handles internal monitoring on all servers.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've found a better way which will work with RHEL/non-spacewalk servers - by checking for the SLS nameservers in the networking config - this was introduced on the ome-dundeeomero work and continues. These are good ideas for further refactoring though, so thank you.

# Clean the files from the folder-format dump directory
rm {{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }}/*
# Create a fresh db dump
sudo -u postgres pg_dump -j {{ (ansible_processor_count * ansible_processor_cores) |round|int }} -Fd -f {{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }} {{ vault_omero_server_dbname }}
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need |round|int?

Copy link
Member Author

Choose a reason for hiding this comment

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

Jinja2 was creating doubles - or certainly values with a decimal point, which at least nginx did not appreciate.

Copy link
Member

Choose a reason for hiding this comment

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

- name: PostgreSQL Nightly Backups | Create the backups directory
become: yes
file:
path: "{{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }}"
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, the omero_server_ prefix is used by the omero-server role, so there's potential for confusion between vars specific to this playbook and those in the role.

@@ -11,6 +11,27 @@
((ansible_virtualization_type is defined)
and (ansible_virtualization_type == "VMware"))

# Not required for an OMERO server install - UoD specific implementation
Copy link
Member

Choose a reason for hiding this comment

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

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, didn't see/try it. What is there just now certainly worked.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, but that's certainly the point of the reviews is so that we express to the next person coming along here's how we think it should be done.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed - I definitely do see the value of these reviews - I didn't skip review because I thought otherwise - rather to progress ome-demoserver and have all my ansible code in one (new) branch such that I could diff / merge from my previous code.

@@ -1,35 +1,16 @@
# Install OMERO.web with a public user on localhost
# Pass the command line 'upgrade-webapps' flag to upgrade webapps
Copy link
Member

Choose a reason for hiding this comment

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

See my later comment, but if you want to keep it as it is there's a typo: _ not -

@@ -2,7 +2,23 @@
# Add web-extension OMERO.web configuration
# after web already installed and running via role

config set -- omero.web.apps '["figure"]'
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"}] ]'
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 templating in this file (apart from ansible_managed) so it could be a normal file and copy.

Copy link
Member

Choose a reason for hiding this comment

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

My 2c: I don't mind all files being templates.

Copy link
Member Author

Choose a reason for hiding this comment

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

It certainly helps when merging >1 playbook with some plain copies and some templating. A 'file' is a template which just doesn't change very much?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, unless you have a string that contains {{ or {%

Copy link
Member Author

Choose a reason for hiding this comment

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

Good tip, thanks.

@@ -42,18 +23,35 @@
lvm_lvfilesystem: "{{ provision_root_filesystem }}"

# OMERO.web configuration in host_vars in different repository
Copy link
Member

Choose a reason for hiding this comment

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

So omero_web_config_set is in hostvars, but omero_server_config_set is in ome-dundeeomero/playbook.yml?

Copy link
Member Author

Choose a reason for hiding this comment

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

As I became more confident with the Ansible, I realised I could define the vars in the playbook, and keep as much as possible public, only pulling the individual private variables from private config. Initially I thought I'd have to keep the whole omero_web_config_set together as one. ome-dundeeomero represents my having learned that lesson. A refactor of the ns-web playbook would be nice, in this style.

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.

None yet

3 participants