Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to use deb packages #42

Merged
merged 35 commits into from
May 6, 2016

Conversation

johandahlberg
Copy link
Contributor

I've update the roles and playbook to use the new deb-packages to install st2. Essentially I've converted the install guide to a playbook.

Sorry for the massive changes. I've tried as much as possible to dived this into commits that make sense, but I might have mixed things up in some places. I can now build this in the supplied Vagrant box, and I've also added a small smoke test role, which should confirm that some basic things are working as expected.

There are probably some things which still need fixing, especially in relation to making sure that all customization relating to the variables are working, but this is at least a working draft.

@manasdk
Copy link

manasdk commented Apr 1, 2016

This is awesome!

@johandahlberg
Copy link
Contributor Author

Thanks. Don't know why Circle CI is failing though...

@manasdk
Copy link

manasdk commented Apr 1, 2016

@johandahlberg It failed on https://github.com/StackStorm/ansible-st2/blob/master/circle.yml#L28

TASK [rabbitmq : Install rabbitmq packages] ************************************
task path: /home/ubuntu/ansible-st2/roles/rabbitmq/tasks/main.yml:2
failed: [localhost] => (item=[u'rabbitmq-server']) => {"cache_update_time": 1459522939, "cache_updated": true, "failed": true, "item": ["rabbitmq-server"], "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"   install 'rabbitmq-server'' failed: invoke-rc.d: initscript rabbitmq-server, action \"start\" failed.\ndpkg: error processing rabbitmq-server (--configure):\n subprocess installed post-installation script returned error exit status 1\nErrors were encountered while processing:\n rabbitmq-server\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr": "invoke-rc.d: initscript rabbitmq-server, action \"start\" failed.\ndpkg: error processing rabbitmq-server (--configure):\n subprocess installed post-installation script returned error exit status 1\nErrors were encountered while processing:\n rabbitmq-server\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following NEW packages will be installed:\n  rabbitmq-server\n0 upgraded, 1 newly installed, 0 to remove and 1342 not upgraded.\nNeed to get 3909 kB of archives.\nAfter this operation, 4867 kB of additional disk space will be used.\nGet:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main rabbitmq-server all 3.2.4-1 [3909 kB]\nFetched 3909 kB in 1s (2817 kB/s)\nSelecting previously unselected package rabbitmq-server.\n(Reading database ... 635558 files and directories currently installed.)\nUnpacking rabbitmq-server (from .../rabbitmq-server_3.2.4-1_all.deb) ...\nProcessing triggers for man-db ...\nProcessing triggers for ureadahead ...\nSetting up rabbitmq-server (3.2.4-1) ...\nInstalling new version of config file /etc/init.d/rabbitmq-server ...\n * Starting message broker rabbitmq-server\n * FAILED - check /var/log/rabbitmq/startup_\\{log, _err\\}\n   ...fail!\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "The following NEW packages will be installed:", "  rabbitmq-server", "0 upgraded, 1 newly installed, 0 to remove and 1342 not upgraded.", "Need to get 3909 kB of archives.", "After this operation, 4867 kB of additional disk space will be used.", "Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main rabbitmq-server all 3.2.4-1 [3909 kB]", "Fetched 3909 kB in 1s (2817 kB/s)", "Selecting previously unselected package rabbitmq-server.", "(Reading database ... 635558 files and directories currently installed.)", "Unpacking rabbitmq-server (from .../rabbitmq-server_3.2.4-1_all.deb) ...", "Processing triggers for man-db ...", "Processing triggers for ureadahead ...", "Setting up rabbitmq-server (3.2.4-1) ...", "Installing new version of config file /etc/init.d/rabbitmq-server ...", " * Starting message broker rabbitmq-server", " * FAILED - check /var/log/rabbitmq/startup_\\{log, _err\\}", "   ...fail!"]}

If you login you might be able to re-run with debug ssh and can ssh to the container to see why that failure happens.

Johan Dahlberg added 2 commits April 4, 2016 09:31
It seems that the Circle CI still has old rabbit-mq configurations files
lying around. Hopefully this will fix that.
@johandahlberg
Copy link
Contributor Author

@manasdk I've been investigating this a bit closer now. One thing that I noticed now is that Circle CI is using Ubuntu 12.04 as the base image, while the install instructions for Ubuntu / Debian states that Ubuntu 14.04 is supported. When trying this our in my own repo, triggering Circle CI everything worked when I updated the configuration to build on a Ubuntu 14.04 box. Would it be possible to make those changes the configuration of the main repo as well? This should also make the builds consistent with the supplied Vagrant file.

@arm4b
Copy link
Member

arm4b commented Apr 4, 2016

Changed to Ubuntu 14 in Circle settings:
pt8tc2i 1

- name: Install exact st2-web package
sudo: yes
apt:
name: st2web={{ st2_version }}.{{ st2_revision }}
Copy link
Member

Choose a reason for hiding this comment

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

st2web has independent revision number.
Eg. revision number for st2 could be 150, while for st2web latest revision number could be 6.

@enykeev
Copy link
Member

enykeev commented Apr 4, 2016

The change itself looks logically sound to me and I can confirm the playbook produces working copy of st2 (including mistral and nginx deployment of st2web, but no chatops).

What I would like you to do is to clean up the code a little bit: remove extra empty lines, readme.md files in roles (or fill them appropriately), empty files.

I'm also kind of worried that name of the company in role meta may raise questions. I'm all for attribution, but since I'm myself struggling to figure out who we are now, we should probably escalate it to @dzimine.

@johandahlberg
Copy link
Contributor Author

@armab Thanks for the comments. I'll make the changes you suggest.

@enykeev I've not added that chatops things since we're not using that part of the StackStorm functionality around here. I can for sure clean things up a bit. When it comes to the readme's do you have any template for that I could have a look at to see what to include?

I have no problem changing meta files - or removing them completely for the time being (since I guess they are only really necessary when publishing to galaxy). Do you have any contribution guidelines somewhere detailing what to do with those things?

@enykeev
Copy link
Member

enykeev commented Apr 5, 2016

@johandahlberg I don't think we have any kind of guidelines or templates for such things. Deleting meta and readme for now seem like a good idea, though.

@@ -1,4 +1,4 @@
mistral_version: 0.13
mistral_version: 1.3.2-99
Copy link
Member

@arm4b arm4b May 2, 2016

Choose a reason for hiding this comment

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

1.4.0 is latest mistral stable version from https://packagecloud.io/StackStorm/stable. Let's stick to some revision from that version.


On related note, I would prefer to avoid such pinning in default config values. So if version is not explicitly set, playbook installs latest stable by default (with accordance with st2 version).

Anyway, it's something to rethink later. For now it's good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess you mean something like what's used here: https://github.com/johandahlberg/ansible-st2/blob/use_deb_packages/roles/st2/tasks/main.yml? If so I can fix it now, shouldn't be to tricky.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, something like that would be definitely better.

@johandahlberg
Copy link
Contributor Author

@armab Thank you for all the great comments. I've addressed them now and pushed the changes.

@arm4b
Copy link
Member

arm4b commented May 2, 2016

Another very minor issue: can you also delete that big WARNING (first lines) from the README.md as part of your PR?

@johandahlberg
Copy link
Contributor Author

Not a problem. 😃

@arm4b
Copy link
Member

arm4b commented May 2, 2016

Everything else looks good for me 👍
Thank you very much @johandahlberg for your hard work and huge amount of changes 💯

Just a notice, probably (if I'll maintain this repo) there will be more refactorings with major changes in logic. Hope that's OK.

For now @enykeev will come back later and review changes once again & merge.

@johandahlberg
Copy link
Contributor Author

@armab No problem at all. I'm just happy to be able to contribute, and that once this is merged there it makes it it easier for us to deploy the latest st2 version around here. 😄

@arm4b arm4b added the RFR label May 2, 2016
@arm4b arm4b added this to the v0.4.0 milestone May 2, 2016
with_items: st2_services
command: st2ctl restart

- name: restart st2api
Copy link
Member

Choose a reason for hiding this comment

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

We need to also restart st2stream along with st2api for pretty much every case. See https://github.com/StackStorm/st2-packages/pull/293/files. If you don't do that, attempt to connect to stream with token will result in an error, something along the lines 'unexpected query parameter x-auth-token'.

Copy link
Member

Choose a reason for hiding this comment

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

And while you at it, I'd also ask you to change st2 restart command to reflect https://github.com/StackStorm/st2-packages/pull/285/files

@enykeev
Copy link
Member

enykeev commented May 5, 2016

The rest looks good to me 👍 :shipit:

@johandahlberg
Copy link
Contributor Author

Thanks for the feedback @enykeev. I've made sure the st2stream and st2api restart together, and that a restart of st2 also triggers a reload.

@arm4b arm4b merged commit 36f63dc into StackStorm:master May 6, 2016
arm4b pushed a commit that referenced this pull request May 6, 2016
Synchronize docs with recent #42 which installs new packages
@arm4b arm4b mentioned this pull request May 6, 2016
arm4b pushed a commit that referenced this pull request May 6, 2016
@arm4b
Copy link
Member

arm4b commented May 6, 2016

Merged,
Thanks guys! 👍

@johandahlberg johandahlberg deleted the use_deb_packages branch May 6, 2016 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants