-
Notifications
You must be signed in to change notification settings - Fork 2k
Compartmentalize install files #900
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
Compartmentalize install files #900
Conversation
Logically this code is quite similar to before, it's just using the shell directly instead of going through python. This defines a trivial dependency system with `fw_depends`. Where possible, I have specified inherent dependencies (e.g. siena depends on play1), but callers should declare their dependencies in proper order to be safe. Bugs Fixed: - HHVM: Was forcing trusty name on all Ubuntu versions - WT: Was checking for installs/namak - Ruby: Removed single quotes preventing proper source - Ruby: Was attempting to use rvm before sourcing ~/.profile
|
@bhauer - I'm sure you guys are wicked busy, but if there's any way to get feedback on this soon that would be much appreciated - better than me having to rebase each time someone touches any part of the installer |
toolset/setup/linux/prerequisites.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prereqs list comes straight from installer.py#__install_server_software.
I've made two changes - it now checks if prereqs have already been installed before it does anything, and it now backs up all the ~/.bash* and ~/.profile files before it overwrites them (just in case you're running this on your normal computer instead of a VM, I'd rather not accidentally wipe out someone's customizations!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ mv ~/.bash_profile ~/.bash_profile.bak
+ mv ~/.bash_profile ~/.bash_profile.bak
+ mv ~/.bash_profile ~/.bash_profile.bak
This should be
+ mv ~/.bash_profile ~/.bash_profile.bak
+ mv ~/.profile ~/.profile.bak
+ mv ~/.bashrc ~/.bashrc.bak
|
Great Job! |
|
Thanks! |
|
Why is |
|
Ah that's a mistake - silly editor backup. I'll pull it out in a sec... EDIT: I've removed that file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is cd in script safe?
How about cd xsp && ./autogen.sh --prefix=/usr/local
I think mono and xsp should be installed in installs directory someday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd in a subshell is perfectly safe - it only changes the working directory for the currently executing file. Once xsp.sh completes, any cd done inside is effectively undone
This is on two lines because I'm trying to be consistent with other files, such as mono, where I do a single cd then configure make make make install. In these files, doing one cd is a lot cleaner than having cd foo && four times
Also removes accidentally added ._dart.sh
|
PS - you'll note that a lot of the install.sh files are a bit rough - this is only because I'm being a bit lazy. For example, |
No, it was specified in Mongrel2's install guide, so it's only for that (http://mongrel2.org/manual/book-finalch3.html). Mongrel2 depends on zeromq being installed before, else it cannot compile. This is an awesome pull request. |
|
For anyone interested, this change is part of my progress towards packaging all of the servers inside a linux container (docker, specifically) environment. I've already done this packaging once external to TechEmpower (via my webjuice project), but I've realized I can really easily do this inside the framework now due to some upgrades in docker. Once I'm done, this should remove huge dependency problems, as each server will automagically run in it's own isolated environment if you choose to use docker instead of installing locally. So yea...that's where I'm headed with this crazyness |
|
@idlewan Nice, two down. Added it as a depends and tested - mongrel2 installs ok now. Thanks PS - regarding "We should also have a way of only installing dependencies for one framework, it would make things easier for testing changes and updating frameworks." these commits now support that. The normal -test and -exclude flags are now considered when using the --install server flag, so you can do this
and it will only install nodeJS software + deps, as well as the prerequisites (those always have to be installed) |
|
Okay, I'm going to have our team drop what they're doing and work with you on this one, @hamiltont Just as a note, there was something about Ubuntu12 not supporting Wt (I think; not looking back). We are using Ubuntu14 on all our environments for Round10. |
|
Sounds good - I'll be on for a few more hours today. If anyone needs a chat, ping me on freenode at #techempower-fwbm |
|
@hamiltont Thanks so much for putting this together! It's a huge contribution and I think it will be a great assist to anyone who wants to contribute to the project in the future. |
|
@methane Thanks for your contributions to this as well! |
|
The installer worked fine, for the most part. I'm in the process of verifying all the frameworks. There's no error handling in your scripts - where before, we could more or less figure out how the install went by grepping for Ubuntu symlinks /bin/sh to /bin/dash, which has subtle differences from bash. It doesn't look like your scripts use any bashisms/dashisms, but to avoid confusion for future maintainers, can you please change your shebangs to /bin/dash or /bin/bash, depending on your intention? |
|
Yea, a decent error handler is a great idea - I'll toss one in. BTW, you do realize that every call to subprocess in the current codebase is currently using |
|
In addition to trap, these option may help debugging. Output: |
|
Took a while to get it just right, but here's the new stuff. Changes
Error Handing fw_depends now has a decent ERR trap. Failed output now looks like this: Note the original Installation failed message are printed when the |
|
From a test developer point of view, having to install all the languages, servers and frameworks is lot of wasted time. I ended up solving this issue using somewhat different approach in pull request #911. |
|
@marko-asplund very cool work, I'm sorry to see we duplicated our efforts. However, do you see any benefits of your approach over mine? From where I stand, I would much rather prefer that each test declares the components it needs, and the installer then installs what is needed for that test. You've split the installation into a separate stage, which is good, but you haven't linked it to the specific tests being run, which IMO is bad. For example, if you want run nodejs and the run go, you have to update config.ini in between. |
|
@hamiltont I think the merits of each approach depend on your target. Though there's some overlap, the implementations are pretty different. Your pull request clearly has more ambitious goals. IMO, the benefit of my approach, depending on the target, is that it was designed to be simple, require minimal changes and be easy to understand and merge to the upstream codebase. My primary target was just to speed up development and testing when adding new languages, frameworks and servers. I was planning to extend the same mechanism for making test execution configurable, as well. But, as long as this issue gets addressed, I'm happy, no matter which solutions gets adopted :-) |
|
Oops - I mucked up the ERR trap a bit. This last commit fixes it, but I'll need to apply the fix to all the dependency files - I'll get to it later todayish. @marko-asplund Sounds good to me - whatever solution works for the aims of the project is what I'm for |
|
@aschneider-techempower both those issues are now fixed |
|
I was about to edit my comment to post that the new commit does indeed fix it, but you beat me to the punch. I'll run a verify on a bunch of tests, and if it works, I'll try to have this merged before the end of today. |
|
Good catch, fixed it. |
Compartmentalize install files All the install scripts are working, but some tests may be broken.
|
YIS!!!! |
|
All install steps are working, but some of the benchmarks are having trouble running. I'm not sure how much of it is related to the environment that I'm trying to run it on, so I'll try out another environment, but this way we can get started on some other PRs. |
|
Awesome. Thanks for the hard work in testing! |
|
No no, thank you for your hard work, @hamiltont . |
|
:) |
This seems like a big one, but it's basically switching us from using "bash-through-python" for the installation to using bash directly. This only changes the server installation - I've left the client and database as is. I have tested every single dependency shell script for correctness. I have tested running a benchmark with 2-3 frameworks.
The biggest benefits:
fw_dependsto get the language/tool/etc that is current for FrameworkBenchmarks, or they can just ignorefw_dependsand use the specific version they need. Best of both worlds :-)Basically this just declares a few bash functions in
toolset/setup/linux/bash_functions.shand then uses them everywhere. Each framework now has an install.sh file that declares it's dependencies (e.g.fw_depends siena play1) - if a dependency is unknown it's ignored. Each dependency has it's own bash script in the proper subfolder (e.g.frameworks/play1.sh) that is executed to install it. About 95% of these dependencies check if they have already been met before doing anything, so calling them repeatedly has no performance hit (e.g.fw_depends nginx nginx nginxjust install once and then skip twice).Bugs Fixed
I've stuck to traditional sh code instead of bash code, so if we want to port this to a different OS it should be trivial (at least for this boilerplate part....not for the actual installations...)
FWIW, I'm not claiming this is a generally good solution to dependency installation, but I do think it's a step in the right direction