Project

General

Profile

How to get source code and compile

  1. Use a host where HPSS is available:
    At least include + lib (typically in /opt/hpss/) to compile. With right access to HPSS server to run tests
    If that's ok, set HPSS_ROOT env. variable to required value (e.g. setenv HPSS_ROOT /opt/hpss/ or export HPSS_ROOT=/opt/hpss/)
  2. clone master branch for gitlab repository
    git clone -b stability-fix git@gitlab.in2p3.fr:treqs/treqs.git
    Cloning into 'treqs'...
    Enter passphrase for key '...': 
    remote: Counting objects: 22423, done.
    remote: Compressing objects: 100% (8061/8061), done.
    remote: Total 22423 (delta 9566), reused 21432 (delta 9057)
    Receiving objects: 100% (22423/22423), 48.31 MiB | 15.01 MiB/s, done.
    Resolving deltas: 100% (9566/9566), done.
    Checking connectivity... done
    
  3. Go to treqs directory and compile code with maven (mvn command)
    1. mvn clean (to check maven consistency)
      > cd treqs
      > mvn clean
      ...
      [INFO] treqs .............................................. SUCCESS [  0.107 s]
      [INFO] treqs-java ......................................... SUCCESS [  0.003 s]
      [INFO] treqs-cpp .......................................... SUCCESS [  0.024 s]
      [INFO] linux dynamic lib (.so) ............................ SUCCESS [  0.060 s]
      [INFO] treqs-it ........................................... SUCCESS [  0.039 s]
      [INFO] treqs-delivery ..................................... SUCCESS [  0.027 s]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      
      
    2. mvn compile (to compile source code) or mvn test-compile (to compile source and test codes)
      export HPSS_ROOT=/opt/hpss
      mvn test-compile 
      ...
      
      [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ treqs-java ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 130 source files to /afs/in2p3.fr/home/b/bchambon/TMP/treqs/treqs-java/build/classes
      ...
      
      [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ treqs-it ---
      [INFO] Changes detected - recompiling the module!
      [INFO] Compiling 63 source files to /afs/in2p3.fr/home/b/bchambon/TMP/treqs/treqs-it/build/test-classes
      ...
      
      [INFO] Reactor Summary:
      [INFO] 
      [INFO] treqs .............................................. SUCCESS [  0.002 s]
      [INFO] treqs-java ......................................... SUCCESS [  3.381 s]
      [INFO] treqs-cpp .......................................... SUCCESS [  1.579 s]
      [INFO] linux dynamic lib (.so) ............................ SUCCESS [  1.010 s]
      [INFO] treqs-it ........................................... SUCCESS [  1.145 s]
      [INFO] treqs-delivery ..................................... SUCCESS [  0.318 s]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      
      
    3. mvn test to run unitary tests (this will require granted access to HPSS server)
      Due to huge number of tests, this should take time (2 mn !).
      The shorter test you can run is with mvn -Dmaven.test.skip=true test. This request will skip majority of tests. The remaining one will query meta data to HPSS for one predefined file.
      If PASS, native code + related java part of code are OK, HPSS access is granted.
      >mvn -Dmaven.test.skip=true test
      ...
      > Starting Broker tester
      before hpss_SetLoginCred with user root, authMech 2,  hpss_rpc_cred_client 2, hpss_rpc_auth_type_keytab 2, keytab /var/hpss/etc/keytab.root
      after hpss_SetLoginCred rc = 0
      Code from initContext: 0
      Code from getFileProps: 0
      File properties /hpss/in2p3.fr/group/ccin2p3/treqs/ccdvli10.4616_10Mb.dat, 0, 0, JS088200, 10485760
      File already in disk (higher storage level)
      < Ending Broker tester
      ...
      [INFO] BUILD SUCCESS
      
      
    4. to skip previous test and run all others use mvn -Dcpp-unit-test.skip=true test
      > mvn -Dcpp-unit-test.skip=true  test
      ...
      Results :
      
      Tests run: 399, Failures: 0, Errors: 0, Skipped: 2
      
      [INFO] BUILD SUCCESS
      
      
  4. Provide a release (will be a RPM)
    1. Either in local area, by selecting the local profile (-P). (Tests should be skipped)
      >mvn -Dmaven.test.skip=true -Dcpp-unit-test.skip=true deploy -Plocal
      ...
      Uploaded: file:///tmp//repo/fr/in2p3/cc/storage/treqs/...
      ...
      [INFO] BUILD SUCCESS
      

      This will provide a rpm into /tmp/repo/fr/in2p3/cc/storage/treqs/...
      >ls -l /tmp/repo/fr/in2p3/cc/storage/treqs/treqs-delivery/1.0-SNAPSHOT/treqs-delivery-1.0-20150505.111317-23.rpm
      -rw-r--r-- 1 bchambon ccin2p3 3094364 May  5 13:13 /tmp/repo/fr/in2p3/cc/storage/treqs/treqs-delivery/1.0-SNAPSHOT/treqs-delivery-1.0-20150505.111317-23.rpm
      
    2. Either in maven.in2p3.fr
      Write access to maven.in2p3.fr is granted only from jenkins.