Project

General

Profile

UsingRepositories » History » Version 37

Brian Nord, 04/08/2013 05:21 PM

1 7 Brian Nord
h1. SVN
2 7 Brian Nord
3 22 Laurenz Gamper
* [[UsingRepositories#svn_access|SVN Access]]
4 29 Laurenz Gamper
* [[UsingRepositories#kerberos_password|Kerberos Password]]
5 23 Laurenz Gamper
* [[UsingRepositories#svn_intro|SVN Introduction]]
6 23 Laurenz Gamper
* [[UsingRepositories#svn_checkout|SVN Checkout]]
7 23 Laurenz Gamper
* [[UsingRepositories#run_pipeline|Running the pipeline]]
8 20 Laurenz Gamper
9 20 Laurenz Gamper
10 33 Brian Nord
h1(#svn_access). Accessing the Repository
11 20 Laurenz Gamper
12 7 Brian Nord
To Access the DESpec SVN, you need:
13 32 Brian Nord
* a services account (see this page: [[DESpecwikiAccess]])
14 32 Brian Nord
* to be a member of the subprojects of DESpec (email nord@fnal.gov or email Laurenz); If you don't need write access, look at the section Anonymous SVN.
15 32 Brian Nord
* a svn client software  (download from http://subversion.apache.org/)
16 32 Brian Nord
** SVN introduction:
17 32 Brian Nord
*** http://svnbook.red-bean.com/en/1.7/svn.tour.cycle.html
18 32 Brian Nord
** Recommended SVN Clients
19 32 Brian Nord
*** Windows: TortoiseSVN http://tortoisesvn.tigris.org/
20 32 Brian Nord
*** Mac: Versions http://versionsapp.com/
21 32 Brian Nord
*** command line
22 1 Brian Nord
* a kerberos access OR public key access
23 29 Laurenz Gamper
24 32 Brian Nord
25 7 Brian Nord
26 32 Brian Nord
If you would like to have write access, email Brian or Laurenz, so we can add you to the DESpec project. 
27 7 Brian Nord
28 7 Brian Nord
h2. Kerberos
29 7 Brian Nord
30 14 Laurenz Gamper
h3. How to set up kerberos
31 14 Laurenz Gamper
32 14 Laurenz Gamper
<pre>
33 14 Laurenz Gamper
$ mv /etc/krb5.conf /etc/krb5.conf.bak
34 14 Laurenz Gamper
$ cd /etc
35 14 Laurenz Gamper
$ wget http://security.fnal.gov/krb5.conf
36 14 Laurenz Gamper
$ echo "host cdcvs.fnal.gov
37 14 Laurenz Gamper
   ForwardX11 = no
38 14 Laurenz Gamper
   GSSAPIAuthentication yes
39 1 Brian Nord
   GSSAPIDelegateCredentials yes" >> ~/.ssh/config
40 1 Brian Nord
$ kinit -f your-fnal-username
41 1 Brian Nord
$ klist
42 1 Brian Nord
</pre>
43 1 Brian Nord
44 1 Brian Nord
The final klist should show your kerberos ticket and the svn can be checked out now using the svn checkout command below.
45 1 Brian Nord
46 1 Brian Nord
47 1 Brian Nord
h3. Links with further documentation
48 1 Brian Nord
49 1 Brian Nord
http://www.fnal.gov/docs/strongauth/macadmin.html#55292
50 1 Brian Nord
http://kb.mit.edu/confluence/display/istcontrib/Acquiring+Kerberos+Tickets+in+Mac+OS+X+10.7+(Lion)+or+OS+X+10.8+(Mountain+Lion)
51 1 Brian Nord
http://fermilinux.fnal.gov/documentation/security/kerberos-newer-linux/
52 1 Brian Nord
53 33 Brian Nord
54 33 Brian Nord
h3(#kerberos_password). Obtaining Secure Access: Kerberos
55 33 Brian Nord
56 33 Brian Nord
There are two different passwords for redmine and kerberos. At the beginning (when you register your account), they are the same. But when the redmine password gets changed, the kerberos password stays the same and vice versa.
57 33 Brian Nord
If you haven't got the initial password any more and need to reset the kerberos password, you have to call the fermilab service desk so they reset the kerberos password. Link: https://fermi.service-now.com/fsc/
58 33 Brian Nord
59 33 Brian Nord
<pre>
60 33 Brian Nord
$ kpasswd your-fnal-username
61 33 Brian Nord
</pre>
62 33 Brian Nord
63 34 Brian Nord
h2. Set up with Public Keys
64 35 Brian Nord
65 35 Brian Nord
We do support ssh key-based access for off-site users for whom Kerberos is too troublesome
66 1 Brian Nord
and/or difficult. Someone who is a manager of the appropriate Redmine project can ssh into
67 1 Brian Nord
the repository account (i.e. ssh p-simulation_pipeline@cdcvs.fnal.gov) and make an
68 35 Brian Nord
.ssh/authorized_keys" file with lines of the format:
69 34 Brian Nord
 
70 35 Brian Nord
@environment="REMOTE_USER=redmine-user-name" ssh-dss [big-long-base64-key] email-address@
71 34 Brian Nord
 
72 34 Brian Nord
The user can generate an ssh-dss key with ssh-keygen to send to you, if they don't already have one.
73 34 Brian Nord
Generally what they send you is a copy of their .ssh/identity.pub file, which has the big long
74 35 Brian Nord
base-64 key mentioned above.
75 34 Brian Nord
76 37 Brian Nord
* Make sure ssh is installed on your system. These instructions have been tested with openssh version 3.5, you can check what version you have by running
77 37 Brian Nord
78 37 Brian Nord
<pre>
79 37 Brian Nord
      ssh -V
80 37 Brian Nord
</pre>
81 37 Brian Nord
82 37 Brian Nord
* If you don't have one, create an ssh key pair, by running:
83 37 Brian Nord
84 37 Brian Nord
  <pre>
85 37 Brian Nord
      ssh-keygen 
86 37 Brian Nord
  </pre>
87 37 Brian Nord
88 37 Brian Nord
  It will ask you for a passphrase to keep your private key encrypted. Do not use your system password, etc. for this    passphrase, rather pick a nice long phrase, but one you can remember. You can change it later with
89 37 Brian Nord
90 37 Brian Nord
  <pre>
91 37 Brian Nord
      ssh-keygen -p
92 37 Brian Nord
  </pre>
93 37 Brian Nord
94 37 Brian Nord
  This will create $HOME/.ssh/id_dsa and $HOME/.ssh/id_dsa.pub, which are your private and public keys, respectively. You should copy these key files (or even your whole .ssh directory) to whatever computer accounts you have, so that you can establish your key authentication from that account.  And of course you should keep the id_dsa file readable only by you.
95 37 Brian Nord
96 37 Brian Nord
97 34 Brian Nord
* send your public key to nord or Laurenz
98 34 Brian Nord
99 34 Brian Nord
100 33 Brian Nord
&nbsp;
101 33 Brian Nord
&nbsp;
102 1 Brian Nord
&nbsp;
103 1 Brian Nord
104 1 Brian Nord
h1. Using the Repository
105 1 Brian Nord
106 35 Brian Nord
h2(#svn_checkout). SVN Checkout
107 35 Brian Nord
108 35 Brian Nord
h3. Source Code
109 35 Brian Nord
110 35 Brian Nord
<pre>
111 35 Brian Nord
svn checkout svn+ssh://p-simulation_pipeline@cdcvs.fnal.gov/cvs/projects/simulation_pipeline-main/trunk despec
112 35 Brian Nord
</pre>
113 35 Brian Nord
114 35 Brian Nord
h3. Data
115 35 Brian Nord
116 35 Brian Nord
<pre>
117 35 Brian Nord
svn checkout svn+ssh://p-simulation_pipeline@cdcvs.fnal.gov/cvs/projects/simulation_pipeline-main/data data
118 35 Brian Nord
</pre>
119 35 Brian Nord
120 35 Brian Nord
h3. Paper
121 35 Brian Nord
122 35 Brian Nord
<pre>
123 35 Brian Nord
svn checkout svn+ssh://p-simulation_pipeline@cdcvs.fnal.gov/cvs/projects/simulation_pipeline-main/paper paper
124 35 Brian Nord
</pre>
125 35 Brian Nord
126 35 Brian Nord
127 35 Brian Nord
This will create a directory called despec containing a checkout the complete pipeline.
128 35 Brian Nord
129 35 Brian Nord
130 25 Laurenz Gamper
h2. Adding a File
131 1 Brian Nord
132 25 Laurenz Gamper
Adding a file does not commit the file, use commit to upload the file.
133 25 Laurenz Gamper
<pre>
134 25 Laurenz Gamper
svn add your-file
135 25 Laurenz Gamper
</pre>
136 25 Laurenz Gamper
137 25 Laurenz Gamper
h2. Commit
138 25 Laurenz Gamper
139 20 Laurenz Gamper
One need not supply a URL for commit.  SVN automatically contacts external server
140 1 Brian Nord
<pre>
141 1 Brian Nord
svn commit -m "your message"  
142 1 Brian Nord
</pre>
143 25 Laurenz Gamper
144 25 Laurenz Gamper
h2. SVN Checking your changes
145 25 Laurenz Gamper
146 25 Laurenz Gamper
This presents a summary of the changes.
147 25 Laurenz Gamper
<pre>
148 25 Laurenz Gamper
svn status
149 25 Laurenz Gamper
</pre>
150 25 Laurenz Gamper
151 25 Laurenz Gamper
Which outputs something like
152 25 Laurenz Gamper
<pre>
153 25 Laurenz Gamper
$:~/src/despec/trunk/Wrapper$ svn status
154 20 Laurenz Gamper
M       run_pipeline.py
155 20 Laurenz Gamper
A       lsprofcalltree.py
156 23 Laurenz Gamper
C       glue.ini
157 20 Laurenz Gamper
?       glue.mine.ini
158 17 Laurenz Gamper
</pre>
159 18 Laurenz Gamper
160 17 Laurenz Gamper
You see the filenames and the flags at the beginning of the line. The flags mean:
161 17 Laurenz Gamper
<pre>
162 17 Laurenz Gamper
? item
163 17 Laurenz Gamper
The file, directory, or symbolic link item is not under version control.
164 19 Laurenz Gamper
165 17 Laurenz Gamper
A item
166 17 Laurenz Gamper
The file, directory, or symbolic link item has been scheduled for addition into the repository.
167 17 Laurenz Gamper
168 17 Laurenz Gamper
C item
169 1 Brian Nord
The file item is in a state of conflict. That is, changes received from the server during an update overlap with local changes that you have in your working copy (and weren't resolved during the update). You must resolve this conflict before committing your changes to the repository.
170 10 Laurenz Gamper
171 1 Brian Nord
D item
172 1 Brian Nord
The file, directory, or symbolic link item has been scheduled for deletion from the repository.
173 1 Brian Nord
174 9 Brian Nord
M item
175 1 Brian Nord
The contents of the file item have been modified.
176 1 Brian Nord
</pre>
177 1 Brian Nord
178 1 Brian Nord
179 1 Brian Nord
180 23 Laurenz Gamper
h1{#run_code}. Run the Code
181 1 Brian Nord
182 24 Laurenz Gamper
[[Glue|Description of the glue code]]
183 24 Laurenz Gamper
184 1 Brian Nord
Instructions on how to run the pipeline: [[Run_Pipeline]]