Kitware / minerva

Minerva: client/server/services for analysis and visualization
Apache License 2.0
36 stars 14 forks source link

Vagrant refactor #352

Closed kotfic closed 8 years ago

kotfic commented 8 years ago

This PR refactors the Vagrantfile to work with ansible 2.0 and ansible galaxy. Also this makes a break with gobig roles.

@mgrauer PTAL thanks!

kotfic commented 8 years ago

@mgrauer @aashish24 We also need to have a discussion about what to do with romanesco.

mgrauer commented 8 years ago

@kotfic

I see a mention of deploying for NEX in your documentation. Is there a method for deploying a vanilla/non-nex Minerva? What does deploying the NEX flavor do?

Can you also update the top-level document vagrant.md in the repo if needed?

kotfic commented 8 years ago

@mgrauer I've fixed the documentation, and added code to support the .girder-version file. I've also added to to make sure the checkout of minerva inside the VM is the same as the checkout outside the VM. I've also added a 'development install' section that describes how to get up and running with NFS etc.

Currently this doesn't support the minerva-update tag. Can you remind me again the specific steps of the workflow that tag was designed to support?

mgrauer commented 8 years ago

You should change this in vagrant.md

Ansible [version >= 1.9.3 and < 2.0]
mgrauer commented 8 years ago

Also add minimum vagrant version

mgrauer commented 8 years ago

I'm running into issues, because of a change made in Ansible 2.1.

I'm on ansible 2.2.0 with vagrant 1.8.1 and virtualbox 5.0.0, on the ancient OS X 10.8.5.

This occurs on the Girder/Command "whoami", because of the become and become_user in the site.yml playbook.

A couple useful links

https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user http://stackoverflow.com/questions/36646880/ansible-2-1-0-and-git-module-how-to-use-become-become-user

I'm rerunning now with this added to my ansible.cfg

[ssh_connection]
pipelining=True

Also, it seems that when I run vagrant up, from the dir with Vagrantfile, it is not using the config settings found in ansible/ansible.cfg, I had to copy that file up to the same dir as the Vagrantfile. According to the ansible docs, the config file ansible.cfg is only recognized when in the cwd.

...

This pipelining=True change got me further, but now I failed on

TASK [Create 'admin' User] ***** task path: /Users/mgrauer/dev/geo/minerva_ansible2_refactor/minerva/ansible/site.yml:65 <127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: vagrant <127.0.0.1> SSH: EXEC ssh -C -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=2222 -o 'IdentityFile="/Users/mgrauer/dev/geo/minerva_ansible2_refactor/minerva/.vagrant/machines/minerva/virtualbox/private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 -o ControlPath=/Users/mgrauer/.ansible/cp/ansible-ssh-%h-%p-%r 127.0.0.1 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python'"'"'' fatal: [minerva]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"apiRoot": null, "assetstore": null, "blacklist": null, "collection": null, "delete": null, "dryrun": null, "files": null, "folder": null, "get": null, "group": null, "host": "10.0.2.15", "item": null, "password": null, "plugins": null, "port": "8080", "post": null, "put": null, "scheme": null, "state": "present", "token": null, "user": "{'firstName': 'Admin', 'admin': True, 'lastName': 'User', 'login': 'admin', 'password': 'letmein', 'email': 'admin.user@kitware.com'}", "username": null}, "module_name": "girder"}, "msg": "<type 'exceptions.TypeError'>: user() takes at least 3 arguments (2 given)\n\nTraceback (most recent call last):\n File \"/tmp/ansible_rrmsbX/ansible_module_girder.py\", line 1362, in main\n gcm(module)\n File \"/tmp/ansible_rrmsbX/ansible_module_girder.py\", line 686, in call\n self.__process(method)\n File \"/tmp/ansible_rrmsbX/ansible_module_girder.py\", line 714, in __process\n ret = getattr(self, method)(_args, *_kwargs)\nTypeError: user() takes at least 3 arguments (2 given)\n"}

kotfic commented 8 years ago

@mgrauer could you try again, i've updated the girder config module to 0.2.1 which resolves that issue with newer versions of ansible

mgrauer commented 8 years ago

Ran into the problem again

minerva/ansible/roles/girder/tasks/main.yml:4 fatal: [minerva]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}

kotfic commented 8 years ago

was that with or without pipelining=True?

On Wed, May 18, 2016 at 5:30 PM, mgrauer notifications@github.com wrote:

Ran into the problem again

minerva/ansible/roles/girder/tasks/main.yml:4 fatal: [minerva]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user. For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user "}

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Kitware/minerva/pull/352#issuecomment-220164308

Christopher Kotfila R&D Engineer Kitware Inc. http://www.kitware.com/company/team/kotfila.html

mgrauer commented 8 years ago

I removed any local changes to the ansible.cfg, which did not have pipelining=True at that time.

Just tried again with your newest change, but as I suspected, it failed with the same error message.

Based on my reading of the ansible config docs, the ansible.cfg has to be in the same directory as where vagrant up or vagrant provision is called from. With the branch as is, I get the message

No config file found; using defaults

When I copy that file to one dir higher, where I run vagrant from, I get

Using /Users/mgrauer/dev/geo/minerva_ansible2_refactor/minerva/ansible.cfg as config file

Also, the pipelining property needs to be in an ssh_connection section in the config file, like

[defaults]
host_key_checking = False
record_host_keys=False
[ssh_connection]
pipelining=True

Yay! I just ran it with these local changes and it finished provisioning, and I can see minerva from my host machine at http://localhost:8080.

kotfic commented 8 years ago

@mgrauer can you push these changes?

On Thu, May 19, 2016 at 9:57 AM, mgrauer notifications@github.com wrote:

I removed any local changes to the ansible.cfg, which did not have pipelining=True at that time.

Just tried again with your newest change, but as I suspected, it failed with the same error message.

Based on my reading of the ansible config docs, the ansible.cfg has to be in the same directory as where vagrant up or vagrant provision is called from. With the branch as is, I get the message

No config file found; using defaults

When I copy that file to one dir higher, where I run vagrant from, I get

Using /Users/mgrauer/dev/geo/minerva_ansible2_refactor/minerva/ansible.cfg as config file

Also, the pipelining property needs to be in an ssh_connection section in the config file, like

[defaults] host_key_checking = False record_host_keys=False [ssh_connection] pipelining=True

Yay! I just ran it with these local changes and it finished provisioning, and I can see minerva from my host machine at http://localhost:8080.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Kitware/minerva/pull/352#issuecomment-220331928

Christopher Kotfila R&D Engineer Kitware Inc. http://www.kitware.com/company/team/kotfila.html

mgrauer commented 8 years ago

@kotfic pushed

dorukozturk commented 8 years ago

@kotfic LGTM