-
Notifications
You must be signed in to change notification settings - Fork 2k
Separate test installation directories and environments #915
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
Conversation
Question/thought: could we set up a trivial proxy on localhost and route requests through it? This would improve our test purposes for new-users who are going to go through every test on the first go where there is overlapped downloading. It could be part of the environment setup. |
The latter, this already includes all the commits from 900. The proxy idea |
This commit is my proof-of concept, only the 'go' test works right now. You can look at go/ to see the changes required on a per-framework basis - essentially I've modified go/setup.py to move the declaration of the environment into go/bash_profile.sh Each framework now gets a personal <framework>/installs directory, and can declare any needed environment variables in <framework>/bash_profile.sh, such as modifications to the PATH. The FwBm code now provides an FWROOT environment variable to *all* shell scripts (instead of ~/Frameworks being assumed). Also, an IROOT environment variable is provided to any framework-specific files (e.g. install.sh and bash_profile.sh) for the location of the install directory for that framework. See go/bash_profile.sh to see me using both IROOT and FWROOT. By using IROOT, the strategy for installation is still controlled by python code and the frameworks just reference IROOT and FWROOT in their scripts. These variables are a nice step towards solving TechEmpower#448 The new function replace_environ in setup_util.py goes a long way towards addressing TechEmpower#899 - as you can see I've removed all the changes to the ~/.bash_profile from prerequisites.sh (and this commit serves as proof that everything still works) and most of the changes from config/benchmark_profile
- adds an '--install-strategy' option - framework_test properly sets the install location before calling setup.py - removes '--install-software' option (checks for '--install' instead) Still proof-of-concept, only 'go' works!
I have tested this now with a few frameworks, success. I have not done a 100% test of everything. I've moved the pertest installation root to Just to be clear, this PR adds
This PR does not provide a |
This wasn't fully rebased onto master yet, now it is |
I'm +1 on separating environment variables. But -1 on install all softwares per tests. Can I use pertest environment variable without pertest installation? |
I'm sorry. I misunderstood. |
def replace_environ(config=None, root=None, print_result=False, command='true'): | ||
# Clean up our current environment, preserving some important items | ||
mini_environ = os.environ.copy() | ||
mini_environ.clear() |
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.
This 2 lines means mini_environ = {}
?
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.
Ha ha, yea....
I'll clean it up when I get a chance. I guess I didn't know at the time that env was just a dict, thought it might be some fancy data structure that I needed to copy and clear :-P
Just to make it explicit for anyone listening in, yes you can |
Based on advice from https://github.com/methane
@methane just applied those fixes, thanks! |
Could someone confirm that the following is expected: When I run a test, I get two folders under |
@hamiltont Could you try #893 ? |
@hamiltont I am confirming that what you see is expected (though, probably not optimal).
In order to get that |
Looking at the per-test install directory (https://travis-ci.org/hamiltont/FrameworkBenchmarks/jobs/30719688), something feels not right:
It seems that the scripts don't go back to
which probably means that nawak installs first, then nimrod, then mongrel2.
(there is no need for a subdirectory now, so I should change nawak/nawak to nawak anyway)
which results in nimrod installed under the nawak git directory, and mongrel2 + zeromq installed under the nimrod directory. We might need to
into:
|
@idlewan Good catch. The fix is simple, I'll put in a pr in a bit. If you have the experience, perhaps you could modify the mongrel2.sh and zeromq.sh files so they are installed into prefix directories instead of onto the host system? |
Thanks for the fix. I'm not sure it's strictly necessary to enforce local installation for mongrel2 and zeromq, at least not until some other framework use them too. We already install globally lots of things with apt-get, is there a need not to install anything globally? |
Local install is 1) to be polite for users running TFB on their main |
I see. |
The global stuff is probably never going to be changed from normal apt-get, |
This PR introduces the potential to install items into per-test directories using the new flag
--install-strategy (unified | pertest)
. Adding this necessitated a consistent way to reference the environment, so this PR also creates an environment variableFWROOT
that is propagated to all subprocesses/subshells (a number of setup.py files already create a similar variable, this just formalizes it into the framework). A similar variableIROOT
tells each subshell or subprocess where itsinstalls
directory is.Propagating these core variables fwroot/iroot allows each test to declare it's own environment relative to these variables. For now, I've placed environment declaring code in
<test-dir>/bash_profile.sh
, but there's likely a better name. See go/bash_profile.sh for an example of thego
test declaring it's own environment using these variables.This is entirely backwards compatible - unless a test overrides the default environment with it's own
bash_profile.sh
, the default environment is what is used. This also removes the need to copy over top of~/.profile, ~/.bash_profile, ~/.bashrc
, as this loads the default environment itself and don't rely on bash to load it automatically.This is all based on #900, which can be a bit confusing. To see a clean comparison of what this adds, please visit this comparison. I based it on #900 because it was a lot easier
This PR resulted from discussion on #899. It should also help to close #448 if merged
This is not fully tested, just putting it out for comment before I spend time testing. I've run enough tests to know it works generally, but it likely needs some cleanup. Also, I've dropped the
--install-software
flag because it was redundant with--install