Git usage in CMS open data environments

Due to protocol changes w.r.t to the legacy environment, the git clone commands produce an error:

git clone https://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon  Validation/Mu_Mumonitor_dimuon_2010
Cloning into 'Validation/Mu_Mumonitor_dimuon_2010'...
error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version while accessing https://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon/info/refs?service=git-upload-pack
fatal: HTTP request failed

The CMS open data environments will soon be updated to fix this error. Meanwhile, there are two solutions:

You can use git clone git format, i.e.

git clone git://github.com/cms-opendata-validation/2010-mu-mumonitor-dimuon Validation/Mu_Mumonitor_dimuon_2010

in the CMS open data containers or in the CMS Shell in the VM image.

Alternatively, clone the repository normally with git clone https... in a more recent environment:

  • if using containers, in your local area, which you mount as a volume to the container
  • if using VM, in the terminal with a more recent OS, which opens from a terminal icon on the bottom of the desktop screen (remember that in the VM, building the CMSSW area and compiling must be done in the CMS shell)

In addition to the above, if you are using containers and you want to be able to access the ssh keys needed to clone repos, for example from Github, you’ll want to launch the container such that the keys are accessible from inside the container.

docker run --it -v ${HOME}/.ssh:/home/cmsusr/.ssh ...

As a more complete example, I run the following to start a CMSSW 5.3.32 container instance making sure that I a) can access my ssh keys and b) will have X11 forwarding enabled.

 docker run -it -v ${HOME}/.ssh:/home/cmsusr/.ssh --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" cmsopendata/cmssw_5_3_32 /bin/bash