Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. You need /lib, /include, and /bin.
    1. 1) Keep everything in the epics/ folder, but copy the folder over, then update $LD_LIBRARY_PATH(lib), $PATH(bin),  $CPATH(include)?
      1. How build epics: 
        1. git clone --recursive https://github.com/epics-base/epics-base.git

        2. make
      2. cp -r /mnt/eed/ad-build/registry/epics-base/R7.0.8/epics-base/ /build/
      3. # If this works add to .bashrc because this'll be dev image
        export EPICS_BASE=/build/epics-base export EPICS_HOST_ARCH=$(${EPICS_BASE}/startup/EpicsHostArch) export PATH=${EPICS_BASE}/bin/${EPICS_HOST_ARCH}:${PATH}
      4. Works for binaries, need to try building simple ioc with it.

        Code Block
        languagebash
        mkdir -p /build/testIoc
        cd /build/testIoc
        makeBaseApp.pl -t example testIoc
        makeBaseApp.pl -i -t example testIoc
        make
        cd iocBoot/ioctestIoc
        chmod u+x st.cmd
        ./st.cmd

        Building works, and can run the ioc. 

        Code Block
        languagebash
        linenumberstrue
        collapsetrue
        [root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# pwd
        /build/testIoc/iocBoot/ioctestIoc
        [root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# ls
        Makefile  README  envPaths  st.cmd
        [root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# ./st.cmd
        #!../../bin/linux-x86_64/testIoc
        < envPaths
        epicsEnvSet("IOC","ioctestIoc")
        epicsEnvSet("TOP","/build/testIoc")
        epicsEnvSet("EPICS_BASE","/build/epics-base")
        cd "/build/testIoc"
        ## Register all support components
        dbLoadDatabase "dbd/testIoc.dbd"
        testIoc_registerRecordDeviceDriver pdbbase
        ## Load record instances
        dbLoadTemplate "db/user.substitutions"
        dbLoadRecords "db/testIocVersion.db", "user=root"
        dbLoadRecords "db/dbSubExample.db", "user=root"
        cd "/build/testIoc/iocBoot/ioctestIoc"
        iocInit
        Starting iocInit
        ############################################################################
        ## EPICS R7.0.8
        ## Rev. R7.0.8
        ## Rev. Date Git: 2023-12-14 16:42:10 -0600
        ############################################################################
        cas WARNING: Configured TCP port was unavailable.
        cas WARNING: Using dynamically assigned TCP port 37587,
        cas WARNING: but now two or more servers share the same UDP port.
        cas WARNING: Depending on your IP kernel this server may not be
        cas WARNING: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)
        iocRun: All initialization complete
        ## Start any sequence programs
        #seq sncExample, "user=root"
        epics> ^C
        [root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]#
      5. Now need to try asyn as that would need 'include' statements of epics. After this then we can conclude epics can be built/ran in a container, although still unclear if can access s3df pvs?
          1. For registry git clone --depth 1 --branch R4-39 https://github.com/epics-modules/asyn.git
          2. Steps to build asyn

            Code Block
            languagebash
            mkdir /build/support/
            cp -r /mnt/eed/ad-build/registry/asyn/R4.39-1.0.1/asyn/ /build/support/
            export LD_LIBRARY_PATH=/build/epics-base/lib/linux-x86_64:${LD_LIBRARY_PATH}
            
            # Update asyn/configure/RELEASE
            # Change EPICS_BASE to point to your epics base =/build/epics-base
            # Change SUPPORT to point to your support folder = /build/support
            # Comment out IPAC and SNCSEQ
            # if get xdr.* missing error, then uncomment TIRPC in configure/CONFIG_SITE
            
            dnf --enablerepo=crb install -y libtirpc-devel
            # -devel is important, its (developer) and gives header files in /usr/include/rpc
            
            yum install -y rpcgen
            cd asyn/
            make

        1. Now you have the libraries and binaries needed, in /asyn/lib.
        2. try test-ioc with asyn with your guardian 'example' branch
          1. Steps to build Guardian ioc

            Code Block
            languagebash
            cd /build 
            git clone -b example https://github.com/pnispero/Guardian.git
            in configure/RELEASE
            Update EPICS_BASE   to point to /build/epics-base
            Update ASYN to point to /build/support/asyn
            make
            cd iocBoot/iocGuardianTest/
            in st.cmd
            Update the shebang to point to #!../../bin/linux-x86_64/Guardian
            chmod +x st.cmd
            ./st.cmd
          2. Optional:

            Code Block
            languagebash
            # Then in the shell you can 'dbl' to get pvs
            # And in another terminal write to 'device' pv.
            $ caput FBCK:FB02:GN01:S2DES_TEST 5
            # Trigger the 'trigger' pv.
            $ caput SIOC:B34:GD_PATRICK:SNAPSHOT_TRG_EN 1
            # The code will then takeSnapshot(). And your output should be 5
          1. Proof it works:

            Code Block
            languagebash
            linenumberstrue
            collapsetrue
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocBoot]# cd iocGuardianTest/
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# ls
            Makefile  envPaths  st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# vim st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# vim st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# ls
            Makefile  envPaths  st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# vim st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# chmod +x st.cmd
            [root@ad-build-container-rocky9-544f5787dc-gl4sq iocGuardianTest]# ./st.cmd
            #!../../bin/linux-x86_64/Guardian
            < envPaths
            epicsEnvSet("IOC","iocGuardianTest")
            epicsEnvSet("TOP","/build/Guardian")
            epicsEnvSet("ASYN","/build/support/asyn")
            epicsEnvSet("EPICS_BASE","/build/epics-base")
            cd "/build/Guardian"
            ## Register all support components
            dbLoadDatabase "dbd/Guardian.dbd"
            Guardian_registerRecordDeviceDriver pdbbase
            ## Load record instances
            #dbLoadRecords("db/xxx.db","user=GUARDIAN")
            dbLoadRecords("db/test.db") # PATRICK TODO: Temp here for testing
            dbLoadRecords("db/guardian_snapshot.db", "BASE=SIOC:B34:GD_PATRICK") # PATRICK TODO: Temp add patrick so its unique
            dbLoadRecords("db/guardian_device_data.db", "BASE=SIOC:B34:GD_PATRICK") # PATRICK TODO: Temp add patrick so its unique
            ## Configure Guardian driver
            # GuardianDriverConfigure(
            #    Port Name,                 # Name given to this port driver
            GuardianDriverConfigure("GUARDIAN")
            cd "/build/Guardian/iocBoot/iocGuardianTest"
            iocInit
            Starting iocInit
            ############################################################################
            ## EPICS R7.0.8
            ## Rev. R7.0.8
            ## Rev. Date Git: 2023-12-14 16:42:10 -0600
            ############################################################################
            iocRun: All initialization complete
            ## Start any sequence programs
            #seq sncxxx,"user=GUARDIAN"
            epics> status: 0
            curVal after get : 1
            status: 0
            curVal after get : 1
            status: 0
            curVal after set : 1
            status: 0
            curVal after get : 1
            
            epics> dbl
            SIOC:B34:GD_PATRICK:FEL_PULSE_E
            FBCK:FB02:GN01:S2DES_STORED_RBV
            FBCK:FB02:GN01:S2DES_TEST
            FBCK:FB02:GN01:S2DES_STORED
            SIOC:B34:GD_PATRICK:SNAPSHOT_TRG_RBV
            SIOC:B34:GD_PATRICK:SNAPSHOT_TRG_EN
            epics> sstriggerval: 0
            sstriggerval: 0
            sstriggerval: 0
            sstriggerval: 1
            1: 0
            curVal after get : 5
            2: 0
            Successfully triggered and resetted
        1. Patrick left off here, now see if we can make our config.yaml (of the steps above) for epics/asyn on the registry, so we can get start_build.py to build ioc automatically. This way we can show this to ernest and see if we can get everything including epics in a container.
          1. Get the prebuilt one from afs, and upload to ad-build-test github, and download in registry and use that
          2. Get test-ioc to have the basic ioc in there.
          3. Try to see if we can keep epics the same as much as we can, maybe just change env variables to point to epics on /build or the std directory. like the $EPICS
          4. steps to get a test-ioc with modules going:
          5. TODO: Convert the steps below to a config.yaml for test-ioc, then see if we can get it to build with start_build.py

            Code Block
            languagebash
            cp -r /mnt/eed/ad-build/registry/epics-base/R7.0.8/epics-base/ /build/
            # If this works add to .bashrc because this'll be dev image
            export EPICS_BASE=/build/epics-base
            export EPICS_HOST_ARCH=$(${EPICS_BASE}/startup/EpicsHostArch)
            export PATH=${EPICS_BASE}/bin/${EPICS_HOST_ARCH}:${PATH}
            mkdir /build/support/ 
            cp -r /mnt/eed/ad-build/registry/asyn/R4.39-1.0.1/asyn/ /build/support/
            # Testing ioc
            cd /build 
            git clone -b example https://github.com/pnispero/Guardian.git
            cd Guardian/
            # in configure/RELEASE
            # Update EPICS_BASE to point to /build/epics-base
            # Update ASYN to point to /build/support/asyn
            # Update configure/CONFIG_SITE CHECK_RELEASE to WARN (temporary fix - since asyn on registry points to epics on registry)
            make
            cd iocBoot/iocGuardianTest/
            # in st.cmd
            # Update the shebang to point to #!../../bin/linux-x86_64/Guardian
            chmod +x st.cmd
            ./st.cmd

            TRY BUILDING GUARDIAN with asyn in /build/, so we can have all dependencies in same dir. Then continue modifying test-ioc.

      1. How would channel access work if epics is in container? Can it be accessed from main server?
    1. 2) Or try moving everything (/include (.h), /lib (.so/.a), and /bin (binaries)) to according directories (This will save more space)

...