Closed lmoureaux closed 6 years ago
Test at P5, plus documentation (Can someone help me to create a proxy? http://cms-sw.github.io/tutorial-proxy.html doesn't seem to work with wget or curl)
You'll need to enable port forwarding for https
. An example for ssh
is:
# https://twiki.cern.ch/twiki/bin/view/CMS/DQMOnline#How_to_setup_GIT_to_work_from_in
Host github*
User <your username>
Protocol 2
# ProxyJump ssh cmsusr.cms ## requires OpenSSH 7.3 or higher
ProxyCommand ssh cmsusr.cms -W %h:%p
# ProxyCommand ssh cmsusr.cms nc %h %p
I don't know the ports that would be relevant here. Maybe @jsturdy or @mexanick can offer some advice. Otherwise manual checkout of required files needs to be added.
I briefly tested the setup script with zsh, and it's broken (doesn't call pip and virtualenv). I'm quite sure other shells are affected. I'd like to get:
Which script are you referring to, and what is the calling syntax and terminal output? The script shown at my gist
above works without issue in zsh
as that's my default $SHELL
.
I briefly tested the setup script with zsh, and it's broken (doesn't call pip and virtualenv). I'm quite sure other shells are affected. I'd like to get:
Which script are you referring to, and what is the calling syntax and terminal output? The script shown at my gist above works without issue in zsh as that's my default $SHELL.
My modified script, setup.sh
. The following lines may need to be updated:
$BASH_SOURCE
, though they're not criticalpip
and virtualenv
using $VIRTUALENV
and $PIP
-- these are criticalHere are preliminary instructions. anaUltraScurve.py -h
runs fine, but I haven't tested my updated script at lxplus
and 904 (yet).
I keep the comments above in mind, just processing one issue at a time :snail:
@jsturdy Is installing PySocks
system-wide an option?
Due to the limited Internet access, the setup at Point 5 is more involved.
Download a package to enable the use of SOCKS proxies in Python:
ssh cmsusr wget https://files.pythonhosted.org/packages/53/12/6bf1d764f128636cef7408e8156b7235b150ea31650d0260969215bb8e7d/PySocks-1.6.8.tar.gz
Install it:
pip install --user PySocks-1.6.8.tar.gz
Download the cmsgemos
package manually:
scp lxplus.cern.ch:/afs/cern.ch/user/s/sturdy/public/cmsgemos_gempython-0.3.1.tar.gz .
Create a SOCKS proxy that will allow pip
to reach the outer world:
PORT=5000
ssh -D *:$PORT lxplus.cern.ch -N -f
If you get an error saying bind: Address already in use
, try with PORT=5001
, 5002
, ...
Note The proxy expires after some time. Just create it again if
pip
complains about the network being unreachable.
Define $ELOG_PATH
:
export ELOG_PATH=/your/favorite/elog/path
Then execute:
source gem-plotting-tools/setup.sh -c 0.3.1 -g 1.0.0 -G 5 -v 2.0.0 -V 3 -P $PORT
Congratulations, you are done! You can use the usual commands to deactivate
your virtualenv
and activate it again.
This part:
To be done once Download a package to enable the use of SOCKS proxies in Python: ssh cmsusr wget https://files.pythonhosted.org/packages/53/12/6bf1d764f128636cef7408e8156b7235b150ea31650d0260969215bb8e7d/PySocks-1.6.8.tar.gz Install it: pip install --user PySocks-1.6.8.tar.gz To be done every time you create a new environment
Could be scripted via something like:
PYSOCKS=$(pip list --user | grep "PySocks")
if [ ! -n "$PYSOCKS" ]
then
# run the commands to make a user install of PySocks
fi
Of course a system wide installation could be done but this again depends on the sysadmin and if the package could be added at time of machine setup (e.g. through puppet)
This part:
Create a SOCKS proxy that will allow pip to reach the outer world: PORT=5000 ssh -D *:$PORT lxplus.cern.ch -N -f If you get an error saying bind: Address already in use, try with PORT=5001, 5002, ... Note The proxy expires after some time. Just create it again if pip complains about the network being unreachable.
Could also be scripted. The creation of the proxy should return some exit code which can be checked in a loop. For example perform this in a do...while(exit code not zero)
and each iteration of the loop increment the port number until a successful port is found. Although maybe someone has a good argument on why automatic port assignment here is a bad idea (I could think of a few but perhaps in the 5000 range it's okay...).
Force-pushed updates:
Caveats:
zsh
have got worse.ssh/config
at P5 (it has some config to be able to reach lxplus
, dunno how standard it is)cmsusr
and lxplus
passwords when askedNext:
A workaround for differences between pure bash
($BASH_SOURCE
) and zsh
can be seen here
A workaround for differences between pure bash ($BASH_SOURCE) and zsh can be seen here
Thanks @jsturdy! The other problem I have with zsh
is:
CMD="echo A"
$CMD
Output:
bash
: A
zsh: command not found: echo A
The problems with zsh have got worse
Could you describe?
Thanks @jsturdy! The other problem I have with zsh is: CMD="echo A" $CMD Output: bash: A zsh: command not found: echo A
In zsh
the correct way to do this is via the use of arrays, see for example:
% CMD=(echo A)
% $CMD
A
For more details see the FAQ, specifically section 3.1.
Additionally can you push the changes you made to setup_gemdaq.sh
here:
https://github.com/cms-gem-daq-project/sw_utils
Add a folder scripts
and then have setup_gemdaq.sh
located there.
I don't want USER
to checkout a github repo but I think setup_gemdaq.sh
is now sufficiently advanced where I would like to have some subversioning and history. I'll fork it and add my own changes on top of that.
Additionally can you push the changes you made to setup_gemdaq.sh here:
I'll wget
the script directly from the repo. Should I use master
or another branch?
I'll wget the script directly from the repo. Should I use master or another branch?
Push it to develop
and we will go from there.
I'll wget the script directly from the repo. Should I use master or another branch?
Push it to develop and we will go from there.
I meant in the README instructions.
Additionally I'm not allowed to push to the new repo.
I'll wget the script directly from the repo
The script is already there, my interest is to incorporate the changes you made, and also some changes I've made based on some feedback from @jsturdy
zsh
support (tested on lxplus
).sw_utils
repo (not valid until https://github.com/cms-gem-daq-project/sw_utils/pull/1 reaches master
)Removing the WIP tag as testing is now complete. Dev docs update will be in another PR.
Also upon further reflection we should probably remove all references to vfatqc
here since there is no dependence of gem-plotting
on vfatqc
. e.g. if a USER
wants to do only analysis they don't need vfatqc
at all.
@bdorney, I'm quite sure you'll have an opinion about how the -pre
releases should be handled. Currently we only give instructions for stable and -dev
releases.
@bdorney, I'm quite sure you'll have an opinion about how the -pre releases should be handled. Currently we only give instructions for stable and -dev releases.
What's the use case? Naively I guess a USER
is using a stable release and a developer
is using either a stable or a dev
release. Try to ask @jsturdy what a pre
release would be doing and who should be using it. I assume only a sysadmin
would be using a pre
release and xcheck'ing it installs correctly but I could be mistaken.
travis-ci
build did not complete
Travis checks aren't reliable, they fail every now and then because they fail to fetch the Docker images. IIRC there's a "Retry" button somewhere (or is it on Gitlab?), pushing it might "fix" the issue.
Description
User setup instructions are currently broken. This PR is about rewriting them.
I used Brian's script as a base, and modified it to run on every tested machine. I also added a few checks. The new script is here.
Types of changes
Motivation and Context
From most to least relevant:
How Has This Been Tested?
The instructions have been tested in the following environments:
lxplus
(slc6
)gem904daq01
(cc7
)gem904daq03
(slc6
)gem-dqm01
(slc6
)Before starting, I removed all
pip
packages installed in.local
. I used my favorite shell,bash
.The testing itself consisted of:
anaUltraScurve.py -h
ran correctly. This test isn't as dumb as it may seem at first:anaUltraScurve.py
imports fromROOT
,numpy
,gempython.utils
andgempython.gemplotting
before even parsing its argumentsanaUltraScurve.py -h
againPlanned work
Help needed [obsolete]
I briefly tested the setup script with
zsh
, and it's broken (doesn't callpip
andvirtualenv
). I'm quite sure other shells are affected. I'd like to get:bash
Checklist: