ome / infrastructure

A repository containing scripts for managing infrastructure
BSD 2-Clause "Simplified" License
20 stars 19 forks source link

Getting started docs #262

Open will-moore opened 7 years ago

will-moore commented 7 years ago

I recently tried to 'Get Started' running some Ansible examples, with no particular idea what I wanted to achieve, but hoping that getting something working would help me understand / learn something!

However, starting at https://github.com/openmicroscopy/infrastructure/blob/master/ansible/README.md I never managed to get anything working.

Followed instructions at https://github.com/openmicroscopy/infrastructure/blob/master/docs/ansible/installation.md until

Clone the repository containing the inventory, host and group vars files. Ansible will automatically look for host_vars and group_vars directories in the parent directory of the inventory file. This should be located at ../../ansible/inventory such that -i ../../ansible/inventory would be correct.

but didn't know where to look for example repositories. The only "Getting started" example I could see was https://github.com/openmicroscopy/ansible-role-omero-server but this doesn't seem to have the required files mentioned above and there were also no alternative instructions on that page on how to actually get started with the example.

Tried looking at "infrastructure" repo for examples, but don't know what's expected to work. Tried a few things e.g.

$ cd /Users/wmoore/Desktop/INFRASTRUCTURE/infrastructure/ansible 
$ ansible-playbook -u wmoore --ask-become-pass -C -v os-devspace.yml
...
 [WARNING]: Host file not found: ../../ansible/inventory/
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "vm_key_name is required"}

In the end I gave up and went to https://github.com/openmicroscopy/devspace which is probably where I should have started.

To summarise, if the "Getting Started" instructions are designed for newbies to get something running then they need the step-by-step instructions to go a bit further. Maybe some more high-level intro to the various repos (Infrastructure, Management tools & devspace) would also help, since the relationship & differences between these is still kinda confusing so figuring out where to start is hard.

joshmoore commented 7 years ago

Clone the repository containing the inventory, host and group vars files.

In our case, this is management_tools which is private.

joshmoore commented 7 years ago

I guess @will-moore that we'd need to choose some task that you want to achieve, since I'm not sure we have much in the way of "just learn ansible".

will-moore commented 7 years ago

What about https://github.com/openmicroscopy/ansible-role-omero-server ? Isn't that a kind of ansible "Hello World"? I think it would be OK to say "those with access to https://github.com/openmicroscopy/management_tools/tree/master/ansible can continue there." although I don't know if that gives a "Hello World" example either?

I think part of the problem is that even understanding what the task is that I want to achieve and which repo to start at is tricky, since a high-level picture of the relationship between all the repos and what they do is lacking. I'd be happy to try and create a diagram that represented this, since it would certainly help my understanding too.

joshmoore commented 7 years ago

Isn't that a kind of ansible "Hello World"?

Not exactly. It is the "official" way of installing a server on centos7 so assuming you have a centos box (docker, openstack, virtualbox/vagran, etc.) then you can use it.

"those with access to https://github.com/openmicroscopy/management_tools/tree/master/ansible can continue there."

We try not to mix private repositories into public ones because that will leave the rest of the community wondering: "What's that?" If we need to have a README starting point in management_tools (or ome-internal) for team members, :+1:

I think part of the problem is that even understanding what the task is that I want to achieve and which repo to start at is tricky, since a high-level picture of the relationship between all the repos and what they do is lacking. I'd be happy to try and create a diagram that represented this, since it would certainly help my understanding too.

That's fair, and I'm certainly interested to see your and others' representation of the relationship, but most of these roles/playbooks are atomic. The types of things they try to do are:

If you are looking for something more holistic ("a fully functional OMERO installation") , the best example previously was likely the training playbook. Now, it might be idr/deployment but that is quite a complicated (though certainly complete) example.

manics commented 7 years ago

@will-moore Is something like https://www.ansible.com/webinars-training/introduction-to-ansible helpful?

joshmoore commented 7 years ago

And in terms of a target would:

be sensible?

will-moore commented 7 years ago

@joshmoore Sorry - not sure what you mean by those 'targets'. 'ansible-role-figure-web' sounds like a role for setting up OMERO.web with figure. 'ansible-role-figure-server' is more confusing? Server + web + figure?

I understand we have a lot of "atomic" roles, but when I do

$ ansible-playbook -l devspace-test -u centos devspace.yml

there's a ton of pieces that are run, but what exactly are they and where are they running? E.g. are the https://github.com/ome/omero-install scripts used in this process? What about https://github.com/ome/omego? Does most of the work happen on my laptop, or is it a single command that's issued to an OpenStack machine and everything runs there? etc!

joshmoore commented 7 years ago

By targets I meant the task you're currently looking into. By "ansible-role-figure-server" I mean the role that installs the dependencies that the decoupled /opt/omero/server needs as opposed to the /opt/omero/web (since they can be on different servers).

If you are looking at devspace.yml, then the task is: "set up a CI system that can be used for independent development", and we can certainly start there, but it's certainly one of the bigger ones:

but what exactly are they

It configures docker and a jenkins running in it which will replicate much of http://ci.openmicroscopy.org

and where are they running?

In docker, on whatever server you run it on. All docker playbooks must be targeted at some intended host (even if just localhost).

E.g. are the https://github.com/ome/omero-install scripts used in this process?

Partially, yes, though we will move ever more to ansible roles.

What about https://github.com/ome/omego?

In some ways, certainly.

Does most of the work happen on my laptop

In general, ansible works by running remote commands from wherever you execute. So if you are on your laptop and you run ansible-playbook then it is using your laptop as the command center, but it will make remote commands (almost always via ssh) to whatever host is listed.

or is it a single command that's issued to an OpenStack machine and everything runs there?

No.