Because of a lapse in government funding, the information on this website may not be up to date, transactions submitted via the website may not be processed, and the agency may not be able to respond to inquiries until appropriations are enacted. The NIH Clinical Center (the research hospital of NIH) is open. For more details about its operating status, please visit cc.nih.gov. Updates regarding government operating status and resumption of normal operations can be found at OPM.gov.

LexAccess

LexAccess Web Tools Ci-Cd Procedures

This page describes steps for develop, stage and deploy LexAccess Tools.

I. Annual Updates on Data only

  • Local Development, build & Test (lhc-lx-lexdev)
    • put HSqlDb files (both UTF-8 and ASCII) to ${PROJECTS}/LA/laData/HSqlDb
    • add ${YEAR} and ${YEAR}ASCII in ${PROJECTS}/LA/laData/WEB-INF/lexiconFile
    • shutdown and restart tomcat (sudo systemctl restart tomcat)
    • clean browser cash (if needed)
    • test LexAccess Web Tool on lexdev from broswer

  • Ci-Cd Build & Test (lhx-lx-lexdev01) - skip
    • put HsqlDb files (both UTF-8 and ASCII) to /data/HSqlDb/
    • put updated lexiconFile to /data/WEB-INF/
    • restart tomcat server (clear up cached files)

  • Ci-Cd LHC Stage & Production
    Open a ticket for (Ci-Cd, NLM LHC_AwsDev) to add files in EFS shared (NFS):
    • put 6 HsqlDb files (both UTF-8 and ASCII) to /data/HSqlDb/ (EFS share/NFS)
    • put updated lexiconFile to /data/WEB-INF/ (EFS share/NFS)
    • restart tomcat server (clear up cached files)

II. Annual Updates on Software and Data

  • Build & test without Ci-Cd, local development
    • host: lhc-lx-lexdev
    • dependencies: ./src/main/webapp/WEB-INF/lib/lexAccess${YEAR}dist.jar
    • dir: WebLexAccess-p
    • Update ./build.xml
      • Update "catalina.home"
      • Change app.year from ${YEAR}-1 to ${YEAR}: if new development
    • modify files
      • ./src/main/webapp/WEB-INF/web.xml (from web.xml.lexdev)
        • update lexAccessVersion
        • update lexAccessHomeDir
      • ${PROJECTS}/LA/laData/WEB-INF/lexiconFile
        • add ${YEAR}
        • add ${YEAR}ASCII
    • compiler tool: ant (build.xml)
      • ant clean: delete ./build
      • ant: generate ./build/
      • ant deploy: copy ./build to ${TOMCAT}/webapps/lexAccess.${YEAR}
    • update ${TOMCAT}/webapps/lexAccess.${YEAR}/WEB_INF/web.xml with web.xml.lexdev
    • test LexAccess Web Tool on lexdev from broswer

  • Build & Test with GitLab Ci-Cd pipeline
    • Ci-Cd Concepts
      • use maven to build and get artifacts dependencies from ${LHC-nexus}/lhc-maven-releases/.../lexAccess/...
      • Dockerfile: get ${LHC-nexus}/lhc-lexicon-raw/www/lexAccess/${YEAR}/lexAccess${YEAR}lite.tgz
      • persistent data for LexAccess database over the years installed on /data
        open a ticket to ask Ci-Cd team to put the following files to /data
        • HSqlDb/* (DB data files)
        • WEB-INF/lexiconFile
      • Dir: ${LHC_GIT}/WebLexAccess-p
      • git repo is at: lhc-lx-lexdev.nlm.nih.gov:/nfsvol/lex/Lu/LHC_Git/WebLvg-p
      • shell> checkout master

      • update ./pom.xml
        => To build the WebLvg.war file ${YEAR}
        => WebLexAccess ${YEAR}.2
        => lexAccess dependency: must complete lexAcccess.${YEAR}.2 in the ${LHC_GIT}/lexAccess, which uploaded lexAccess.${YEAR}.2.jar to LHC Nexus/lhc-lexicon-maven-releases/gov/nih/nlm/lexAccess/${YEAR}.2/lexAccess-${YEAR}.2.jar
      • Update ./src/main/webapp/WEB-INF/web.xml (copy from web.xml.Ci-Cd) => To configure WebLexAccess
        • update lexAccessVersion
        • update lexAccessHomeDir
      • ./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
        RELEASE=${YEAR}
        VERSION=${YEAR}.${RN}
      • Only the latest WebLexAccess (WebLexAccess.war) is deployed to public (no WebLexAccess.${YEAR} after 2021)

      • Ci-Cd Build Procedures
        • shell>git add -A
        • shell>git commit -m "LEX, ..."
        • shell>git push

      • Ci-Cd Push to Stage
        • shell>git tag (show all tags)
        • shell>git tag -a v.${YEAR}.0 -m "msg"
        • shell>git push origin tagName (push a tag to remote origin)

      • Ci-Cd deploy to Production
        => Login to LHC-Git, press the arrow botton at the end of Ci-Cd pipeline to deploy WebLexAccess to public.

    • Development in Ci-Cd

      This is not practiced after 2023+.

      • host: lhc-lx-lexdev01
      • dependencies on LHC-Nexus:
        • lexAccess.2023.2
      • dir: WebLexAccess-p
      • modify contents if needed
        • updates ./src/main/webapp/WEB-INF/web.xml (from web.xml-CiCd)

        • manual updates /data/WEB-INF/lexiconFile
        • manual updates /data/HSqlDb/*
        • ...
      • compiler tool: maven (pom.xml)
        • mvn clean
        • mvn package
        • mvn deploy
      • Docker Ci-Cd: - make all_local:
        • make clean
        • make login
        • make build_app
        • make build_nginx
        • make run_local
      • test LexAccess Web Tool on lhc-lx-lexdev01 from broswer
      • docker image:
        shell>docker exec -ti weblexaccess-tomcat bash (tunnel in to docker image)
        /lexAccess2023lite
        /data/HsqlDb/*
        /data/WEB-INF/lexiconFile
        /usr/local/tomcat/webapps/WebLexAccess.war
        /usr/local/tomcat/webapps/WebLexAccess
        /usr/local/tomcat/webapps/logs/localhost.yyyy-mm-dd.log
        ...