Difference between revisions of "Dirac Development"

From GridPP Wiki
Jump to: navigation, search
(Get the code)
 
(22 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
[http://diracgrid.org/files/docs/DeveloperGuide/AddingNewComponents/index.html AddingNewComponents] <br>
 
[http://diracgrid.org/files/docs/DeveloperGuide/AddingNewComponents/index.html AddingNewComponents] <br>
  
== Preliminaries ==
+
== Dirac in a box (Basic Setup) ==
Setup yourself up with a hostcert and a EMI UI, eg by following [https://www.gridpp.ac.uk/wiki/Dirac_on_a_vm_at_cern these] instructions. Install git (and emacs ;-).
+
* Setup yourself up with a hostcert and a EMI UI, eg by following [https://www.gridpp.ac.uk/wiki/Dirac_on_a_vm_at_cern these] instructions.  
 +
* Open the relevant ports (add these lines to the /etc/sysconfig/iptables before the REJECT all else) :
 +
<pre>
 +
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT
 +
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9130:9200 -j ACCEPT
 +
</pre>
 +
now run: service iptables restart
 +
* Install git (and emacs ;-).
 +
* Make a dirac user, and copy the hostcert/key into .globus
 +
* su - dirac
 +
* Set git up correctly:
 +
<pre>
 +
    git config --global user.name "Your Name"
 +
    git config --global user.email you@example.com
 +
</pre>
 +
* You also need the ssh key you use on github
 +
* To save you from typos (the script does not deal well with that :-D ) use <pre> eval "$(ssh-agent)"  followed by ssh-add -t 1h</pre>
 +
* <pre> git clone git@github.com:ic-hep/DIRAC-tools.git </pre>
 +
* <pre> DIRAC-tools/dirac_in_a_box.py /opt/dirac/ git@github.com:ic-hep </pre>
 +
* Ignore "Exception _mysql_exceptions.ProgrammingError" errors
 +
* [https://www.gridpp.ac.uk/wiki/Testing_a_Dirac_server Test] your server.
  
== Get the code ==
+
== Fixing a bug/adding a feature :-) ==
* You need a github account and be a member of the ic-hep organization. Please contact Simon F. directly if you need access.
+
* take ownership of the [https://github.com/ic-hep/DIRAC/issues bug/feature] you want to fix
 +
* make a branch: Example: The branch is bug1 and the modified file is ConfigurationSystem/Client/CSCLI.py:
 +
<pre>
 +
cd /opt/dirac/DIRAC
 +
git status (should say "# On branch rel-v6r12")
 +
git pull
 +
git branch bug1
 +
git checkout bug1
 +
git status (should say "# On branch bug1")
 +
</pre>
 +
* now add your code/restart the relevant components and test your code :-)
 +
<pre>
 +
git add ConfigurationSystem/Client/CSCLI.py
 +
git commit -m "CLI to accept ctrl-D"
 +
git status
 +
</pre>
 +
* and push it back to github
 +
<pre>
 +
git push -u origin bug1
 +
</pre>
 +
* Now go to the [https://github.com/ic-hep/DIRAC git repo webpage] and issue a pull request (ensuring to send the request to our (ic-hep) repo, not the main DIRAC repo - check the defaults using the Edit button in the top right corner !!)
 +
*  Finally: Switch back to main branch
 +
<pre>
 +
git checkout rel-v6r12
 +
</pre>
 +
and delete the local copy of the bug1  <pre> git branch -d bug1 </pre>
  
* Then you need to [https://help.github.com/articles/fork-a-repo fork the repo]
+
<br>
 
+
<hr>
* In the example I'm using my own github login 'marianne013'(*) as I like to be able to do cut-and-paste when following my own instructions. 
+
[https://www.gridpp.ac.uk/wiki/Dirac Back] to the Dirac overview page.
 
+
* As the dirac user do: <pre>git clone git@github.com:marianne013/DIRAC.git</pre> (from git page ssh). This will only work if the dirac user has a copy of your ssh key :-D
+
 
+
* <pre> DIRAC/Core/scripts/dirac-deploy-scripts.py </pre>
+
 
+
* <pre> wget http://www.hep.ph.ic.ac.uk/~dbauer/dirac/full_sanitized.cfg </pre>
+
 
+
* edit full_sanitized.cfg <br>
+
 
+
scripts/dirac-install -X -t server -i 26 -r integration
+
 
+
(*) The first hit when putting Marianne013 into google entitled: "Marianne 013: Kühe in Ketten und Strapsen" which translates into "Cows in chains and suspenders." It's all downhill from there.
+

Latest revision as of 14:16, 21 November 2014

Official Documentation

GitSetup
DeveloperInstallation
AddingNewComponents

Dirac in a box (Basic Setup)

  • Setup yourself up with a hostcert and a EMI UI, eg by following these instructions.
  • Open the relevant ports (add these lines to the /etc/sysconfig/iptables before the REJECT all else) :
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9130:9200 -j ACCEPT

now run: service iptables restart

  • Install git (and emacs ;-).
  • Make a dirac user, and copy the hostcert/key into .globus
  • su - dirac
  • Set git up correctly:
    git config --global user.name "Your Name"
    git config --global user.email you@example.com
  • You also need the ssh key you use on github
  • To save you from typos (the script does not deal well with that :-D ) use
     eval "$(ssh-agent)"  followed by ssh-add -t 1h
  •  git clone git@github.com:ic-hep/DIRAC-tools.git 
  •  DIRAC-tools/dirac_in_a_box.py /opt/dirac/ git@github.com:ic-hep 
  • Ignore "Exception _mysql_exceptions.ProgrammingError" errors
  • Test your server.

Fixing a bug/adding a feature :-)

  • take ownership of the bug/feature you want to fix
  • make a branch: Example: The branch is bug1 and the modified file is ConfigurationSystem/Client/CSCLI.py:
 cd /opt/dirac/DIRAC
 git status (should say "# On branch rel-v6r12")
 git pull
 git branch bug1
 git checkout bug1 
 git status (should say "# On branch bug1")
  • now add your code/restart the relevant components and test your code :-)
 git add ConfigurationSystem/Client/CSCLI.py
 git commit -m "CLI to accept ctrl-D"
 git status
 
  • and push it back to github
 git push -u origin bug1
 
  • Now go to the git repo webpage and issue a pull request (ensuring to send the request to our (ic-hep) repo, not the main DIRAC repo - check the defaults using the Edit button in the top right corner !!)
  • Finally: Switch back to main branch
 git checkout rel-v6r12
 
and delete the local copy of the bug1
 git branch -d bug1 



Back to the Dirac overview page.