Comments (3)
It has been reported that referring to the /etc/profile file does not work on at least one machine. This highlights the difference in how these environments are setup. There appears to be some range in how sys admins are linking various files and under what conditions.
This means that on the original comment under this thread only points 1 and 3 remain valid. These are copied below along with a new idea to investigate.
- Pass information to the user through documentation, informing them to how to add the relevant line to their .bashrc. Have to be careful here, not all Linux distros, and not all sys admins do things the same. There is a bit of variance in how things are done so any solution put on the user needs proper instructions so they can deal with it.
- Find out if there is a proper way to get a valid login shell when using python subprocess.
- A better way could be as part of the tests on the machine, to include handling for when Linux modules can't be found. Then in this case, tests on the various files could reveal how the environment is loaded and then amend the ./bashrc
from longbow.
Newer generation of Hartree machines have a slightly different environment to machines that Longbow is currently used to operate with. It appears from initial discussions that there is a module hierarchy that has to be loaded to get access to other more system specific modules.
We should look at supporting this, it could be that supporting this properly will actually resolve the initial situation in this ticket.
from longbow.
Changing the connection tests to incorporate testing of the environment could be the best way. Here is a script that can identify this problem and "fix" it. In Longbow the fix could be done by appending a flag to toggle the sourcing command to on or off. When on this command is pre-pended to commands delivered over SSH.
#!/usr/bin/env python
import subprocess
machines = {
"scarf": ["ssh", "-t", "scarf"],
"archer": ["ssh", "-t", "archer-c01"],
"iden": ["ssh", "-t", "hartree-iden"]
}
for machine in machines:
print "Testing for environment on " + machine + "..."
cmd = list(machines[machine])
cmd.append("module avail")
handle = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = handle.communicate()
if handle.returncode != 0:
if "bash: module: command not found" in stdout or "bash: module: command not found" in stderr:
print "Environment is borked."
print "attempt fix"
cmd = list(machines[machine])
cmd.append("source /etc/profile; module avail")
handle = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = handle.communicate()
if handle.returncode == 0:
print "env is now ok"
else:
print "still busted."
else:
print "Env is ok"
from longbow.
Related Issues (20)
- Update mode HOT 1
- documentation for recovery file is wrong HOT 1
- PBS and NAMD SMP
- redirects for stdout and stderr from schedulers
- Drop support for python 2.6, 3.2 and 3.3
- OMP environment variable added to all schedulers
- Document chemshell integration HOT 1
- Add the new API docs
- Chemshell integration proper
- Loggers need updating
- rename default log file name
- upload-include and upload-exclude disappeared from docs
- spelling in docs
- bash completion sourced twice in containers
- investigate python 3.7 bug HOT 3
- Sandbox error when installing Longbow from setup.py. HOT 6
- Longbow should exit with non zero when error occurs
- dl_poly integration
- memory parameter only used in PBS
- Add slurm parameters for JADE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from longbow.