Lexical Tools

WebTools: Ci-Cd Development and Test Procedures

The main procedures of Ci-Cd WebLvg are:

  • use mvn to build WebLvg with LVg artifacts in the LHC release dependency
    => lhc-lexicon-maven-releases/gov/nih/nlm/lvg/${YEAR}.0/lvg-${YEAR}.0.jar
  • download lvg${YEAR}lite.tgz from LHC-nexus and unzipped on /lvg${YEAR}lite in the docker image
    => lhc-lexicon-raw/www/lvg/${YEAR}/*.tgz
  • read in lvgHomeDir from web.xml and use it to update ${LVG_DIR} in lvg.property for a new lvgApi configuration.
  • To debug shll>docker exec -ti weblvg-toimcat --bash
    • /lvg${year}lite
    • /usr/local/tomcat/logs
  1. Dir: ${LHC_GIT}/WebLvg-p
  2. shell> git checkout master
  3. Local Development and Test
    • use “lhc-lx-lexdev01.nlm.nih.gov” as local develop/test machine
    • git repo is at: lhc-lx-lexdev01.nlm.nih.gov:/nfsvol/lex/Lu/LHC_Git/WebLvg-p
    • shell>git checkout dev
    • update ./pom.xml
      => To build the WebLvg.war file
      <version>${YEAR}</version>
      <version>${YEAR}.0</version>
      => Must complete lvg.${YEAR}.0 in the ${LHC_GIT}/lvg, which upload lvg.${YEAR}.0.jar to LHC Nexus/lhc-lexicon-maven-releases/.../lvg/${YEAR}.0/.
    • Update ./src/main/webapp/WEB-INF/web.xml (copy from web.xml.Ci-Cd)
      => To configure WebLvg
      lvgVersion: ${YEAR}
      lvgHomeUrl: https://lhncbc.nlm.nih.gov/LSG/Projects/lvg/current/web/index.html
      lvgHomeDir: /lvg${YEAR}lite
    • ./docker-compose.yaml
      => To build tomcat server from docker images
      image: lhc-nexus.nlm.nih.gov:8443/weblvg-tomcat:${YEAR}.${RN}
      where ${RN} needs to be updated for every new offical Release Number
    • ./Makefile
      => Define Ci-Cd pipeline
      => Use make all_local for developing/testing in lhc-lx-lexdev01
      VERSION=${YEAR}
      RELEASE=${YEAR}.${RN}
    • Only the latest WebLvg (WebLvg.war) is deployed to public (no WebLvg.${YEAR} after 2021)
    • Make sure docker is running

      shell> systemctl status docker
      shell> sudo systemctl start docker

    • Make sure ipv4.ip_forward=1

      shell> cat /proc/sys/net/ipv4/ip_forward

    • Local maven build & Test: https://lhc-lx-lexdev01.nlm.nih.gov:8443/WebLvg/jsp/global/cMenu.jsp

      • Makefile, ${TARGET_SERVER}: lhc-lx-lexdev01.nlm.nih.gov
      • docker-compose.yaml: port: - "8443:443"
        => https://lhc-lx-lexdev01.nlm.nih.gov:8443/WebLvg/jsp/global/cMenu.jsp

      • Develop (modify) in lexdev in previous step
      • compile and test on (Ci-Cd) on lexdev01
      • shell> make all_local in the Makefile, test step by step
        shell> make clean this delete all iamges include weblexaccess and weblvg
        shell> make login
        shell> make build_app build weblvg-tomcat image
        shell> make build_nginx build weblvg-nginx image
        shell> make run compose docker container
        • Creates 2 docker containers:
          • docker ps -al
          • docker rm -f CONTAINER_ID => remove containers if they are already exist and used
          • lhc-nexus.nlm.nih.gov:8443/weblvg-nginx:1.0.9
          • lhc-nexus.nlm.nih.gov:8443/weblvg-tomcat:${YEAR}.${RN}
        • run on lhc-lx-lexdev01 (dev/test)
        • https://lhc-lx-lexdev01.nlm.nih.gov:8443/WebLvg/jsp/global/cMenu.jsp

  4. After pass the test, use Ci-Cd to build, push to stage and deploy to Production