Workflow quick reference

From Charm-Tau Detector
Revision as of 08:41, 10 October 2019 by Razuvaev (Talk | contribs)

Jump to: navigation, search

Contents

Register and prepare account

  • Log in to stark.inp.nsk.su (BINP local access only) or proxima.inp.nsk.su (accessible from the Internet, pubkey authentication only)

The login servers have similar configuration and share common /home.

The git is accessible using ssh protocol with key authorization.

  • If necessary, create ssh key using
ssh-keygen

Agree to everything, passwordless keys are allowed.

Then you'll have in your ~/.ssh/ two files id_rsa and id_rsa.pub - these are your private and public keys. Full paths to the files are displayed in the terminal.

  • Log in to gitlab server https://git.inp.nsk.su/ using the same name/password as for stark
  • Register your public key for your account: i. e add ~/.ssh/id_rsa.pub contents to a from at the following link
https://git.inp.nsk.su/profile/keys


Create working repository (fork)

Open central repository

https://git.inp.nsk.su/sctau/aurora

and make fork.


Tune working environment

Each time you log in to a server stark/proxima, you need to

setupSCTAU
asetup SCTauSim,master,latest

The latter one selects the build to use.

Ask software coordinators if you're unsure which build to use

To tune git do once:

First, do:

git sctau init-config

Check if the settings are correct. But the defaults should be fine.

Then apply the settings:

git sctau init-config --apply


tune working directory

To develop new code or to modify existing one, do:

create workare in your home directory (at stark/proxima)

mkdir workarea
cd workarea

create directories for build and run:

mkdir build  run

workarea preparation (just once):

git sctau init-workdir ssh://git@git.inp.nsk.su/sctau/aurora.git

Go to working directory

cd aurora

Fetch updates from head repository (must be done before creating a branch when the workarea exists for a long time)

git fetch upstream

Create a working branch. Give it a sensible name:

git checkout -b <TopicDevelopmentBranch> upstream/<target_branch> --no-track


The line above will not work if you simply copy-paste it. It is intentional. It is important to choose correct target branch. If unsure ask software coordinators.


To modify an existing package check it out:

git sctau addpkg GenExamples

To create new package, one should create its whole directory structure, provide CMakeLists.txt and everything.

Before creating new package ask software coordinators how to name and where to place it

Useful commands to manage packages in you working area:

List local packages

git sctau listpkg

List packages in the whole repository

git sctau listpkg --all

or with regexp filter

git sctau listpkg --all 'Det'
git sctau listpkg --all '/G4.*U'


Remove local package (the repository left intact)

git sctau rmpkg <PackageName>

It is recommended to keep locally only the packages under active development.

Build and run

To build:

cd ../build/
cmake ../aurora/Projects/WorkDir
make

To setup local environment (to use locally built packages instead of default versions):

source x86_64-slc7-gcc8-opt/setup.sh

To run

cd ../run

Run primary generators:

ctaurun GenExamples/evtgen.py 

Run ull simulation:

ctaurun G4SimExamples/fullsim_example.py

Commit changes

In the 'aurora' directory:

Add changed files

git add <list of files>

remove unnecessary files

git rm <list of files>


Commit changes in the local repository:

git commit -m 'Meaningful message concerning the introduced changes'

Each commit should contain a minimal set of logically interconnected changes. You may (and will) have many commits when developing a package.

Put the changes to the server:

git push

Wheh doing push for the first time, it is necessary to do it like

git push --set-upstream origin <TopicDevelopmentBranch>


After the push, git displays a link to be followed for a Merge Request (adding your contributions to common repository).

When doing a merge request, make sure:

  • the branch is correct
  • changes are well described
    • reasons for the changes are demonstrated
    • the changes are described
    • influence on the other software and possible side effects are indicated
    • there are links to related issues, if any
Personal tools