8.3 软件发布

软件发布是指实验软件管理员发布计算环境中依赖的实验软件,用于支持计算环境中实验用户提交的作业加载软件包。

计算中心采用CVMFS存放各个实验组相关软件。

cvmfspublisher.ihep.ac.cn是软件发布服务器,仅支持系统用户使用私钥登陆。为确保软件管理员编译的实验软件仅依赖于/cvmfs,确保实验软件在只挂载/cvmfs的系统环境下,不依赖于其他网络存储系统能够正常运行,该服务器系统环境和登陆节点一致,但不包含其他网络存储系统,予以保证软件编译过程中环境的独立性。

具体发布流程和架构见下图:

ihepcvmfs

实验软件发布流程:

  1. 提交申请

    实验软件管理员联系计算中心申请定制软件仓库名称$repo,并提供个人计算集群账号:useraccount

    CVMFS管理员创建软件发布账号repopubaccount和软件仓库/cvmfs/$repo,同步至cvmfssoftware.ihep.ac.cn服务器。 并配置useraccount对路径/cvmfs/$repo的编辑权限。

  2. 登陆发布服务器,支持两种方式:

    2.1 方式一:使用票单方式, 实验软件管理员在lxlogin.ihep.ac.cn使用个人账号的krb5票单(klist 命令可查看),登陆cvmfssoftware.ihep.ac.cn服务器

    [user@localhost ~]-bash-4.2$ klist Ticket cache: FILE:/tmp/krb5cc_10517 Default principal: huqb@IHEPKRB5 Valid starting Expires Service principal28/08/2419:04:3830/08/2419:04:35 krbtgt/IHEPKRB5@IHEPKRB5 renewuntil04/09/2419:04:35[user@localhost ~]sshrepopubaccount@cvmfspublisher.ihep.ac.cn

    2.2 方式二:使用私钥方式,(未来将弃用) 实验软件管理员在lxlogin.ihep.ac.cn使用私钥,登陆cvmfssoftware.ihep.ac.cn服务器

    [user@localhost ~]sshrepopubaccount@cvmfspublisher.ihep.ac.cn -i yourprivatekey
  1. 切换发布状态 3.1 查看cvmfssoftware.ihep.ac.cn服务器软件仓库当前状态

    [user@cvmfspublisher ~]$ cvmfs_server list|greprepositoryname|greptransaction

    如果软件仓库处于transaction状态,说明该repo正在被其他管理员编辑,需要协商处理,或等待其他人员发布完成后,再编辑和发布。避免将其他人员的测试版本发布到生产环境。

    3.2 如果没有处于transaction状态,执行transaction操作,使/cvmfs/yourrepository 进入可编辑状态,软件最长编辑时间为24小时,超过该时间后再执行publish命令会报tokens expire错误

    [user@cvmfspublisher ~]$ cvmfs_server transaction repositoryname
  2. 编译软件

    软件编译相关方式,CVMFS实验软件仓库的编译一般有两种方式:

    a.在cvmfssoftware.ihep.ac.cn服务器进行编译,使用rsync同步方式,将编译后生成的发布数据通过远程拷贝的方式写入cvmfspublisher.ihep.ac.cn的/cvmfs/$repo.ihep.ac.cn/...相关路径下。(推荐该方式) 实验软件管理员使用计算集群账号密码登陆cvmfssoftware.ihep.ac.cn服务器,编译软件或编辑/cvmfs/$repo路径下的内容,完成软件编译过程。

    [user@cvmfspublisher ~]$rsync-avz --force useraccount@cvmfssoftware:/cvmfs/$repo.ihep.ac.cn/ /cvmfs/$repo.ihep.ac.cn/

    特别注意:该发布模式下,cvmfs管理员只负责首次将当前计算集群环境中的/cvmfs/hunt.ihep.ac.cn/目录同步至cvmfssoftware这台用于编译的服务器,后续编译过程中cvmfssoftware服务器的/cvmfs/hunt.ihep.ac.cn是否和集群一致,需要实验软件管理员自行维护

    因此,每次实验软件管理员编译该环境时,需要提前确认cvmfssoftware.ihep.ac.cn服务器上的/cvmfs/$repo.ihep.ac.cn/路径是否和集群环境一致,防止把未预料的数据发布至集群环境。

    b.依赖操作系统的编译安装方式,软件管理员在cvmfspublisher.ihep.ac.cn服务器使用/cvmfs/container.ihep.ac.cn/bin/hep_container shell SL5/SL6/SL7 选择对应的操作系统,将/cvmfs挂载并启动镜像,进入镜像后进行软件编译,编译生成的软件直接写入/cvmfs/repositoryname/...相关路径下,退出容器镜像。编译过程中所需的通用软件可以使用系统默认的软件,或使用/cvmfs/common.ihep.ac.cn/路径下特定版本的软件。

    [user@cvmfspublisher ~]$ /cvmfs/container.ihep.ac.cn/bin/hep_container shell SL5/SL6/SL7 Singularity yourimage.sif:~>(Make changes to filesinthe R/W mount: /cvmfs/<repo>/dirA&All /cvmfs/*.ihep.ac.cn can be accessed)Singularity yourimage.sif:~>exit

    编译过程中如果出现异常(包括编译超时等情况),需要重新编译发布,可以执行cvmfs_server abort repositoryname 命令,该命令会清除当前transaction后的所有操作。执行结束后,用户重新执行步骤5 cvmfs_server transaction repositoryname

  3. 发布软件

    远程同步或者编译完成后跳出软件仓库目录,然后执行发布命令

    [user@cvmfspublisher ~]$cd/cvmfs[user@cvmfspublisher ~]$ cvmfs_server publish -a"tagname"-m"tag description"yourrepositoryname
  4. 查看最近几次发布版本

    [user@cvmfspublisher ~]$$cvmfs_server tag -l hxmt.ihep.ac.cn Name │ Revision │ Channel │ Timestamp │ Branch │ Description ─────────────────────────────┼──────────┼─────────┼──────────────────────┼────────┼───────────── trunk-previous │1│ trunk │13Jul202014:19:08 │ │ default undo target generic-2020-07-13T06:19:07Z │1│ trunk │13Jul202014:19:08 │ │ trunk │2│ trunk │13Jul202015:40:53 │ │ current HEAD origin │2│ trunk │13Jul202015:40:53 │ │ create ─────────────────────────────┴──────────┴─────────┴──────────────────────┴────────┴───────────── listing contains4tags
  5. 发布成功约10分钟后,计算环境可以访问新发布的软件。

  6. 发布中常见故障和处理

    8.1 仓库下文件或文件夹正在被访问,导致发布失败

    [bes3pub@cvmfspublisher ~]$ cvmfs_server publish -m"boss665p01"bes3.ihep.ac.cn Using auto tag'generic-2020-07-16T09:34:18Z'WARNING!There areopenread-onlyfiledescriptorsin/cvmfs/bes3.ihep.ac.cn -->This is potentially harmful and might cause problems later on. We can anyway perform the requested operation, but this willmostlikelybreakother processes withopenfiledescriptors on /cvmfs/bes3.ihep.ac.cn!The followinglsofreport might show the processes withopenfilehandles##查看访问当前软件仓库的进程有哪些[bes3pub@cvmfspublisher ~]$lsof/cvmfs/bes3.ihep.ac.cn COMMAND PIDUSERFD TYPE DEVICE SIZE/OFF NODE NAMErm95788bes3pub cwd DIR0,68239237356/cvmfs/bes3.ihep.ac.cn/bes3sw/Bossrm95788bes3pub 4r DIR0,68109255952/cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi/Bhlumi-00-00-12/x86_64-slc6-gcc46-opt(deleted)rm95788bes3pub 5r DIR0,68109255873/cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi(deleted)rm95788bes3pub 6r DIR0,68109255874/cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi/Bhlumi-00-00-12(deleted)##查看该进程卡住原因[bes3pub@cvmfspublisher ~]$strace-p95788strace: Process95788attached --- stopped by SIGTSTP --- ^Cstrace: Process95788detached##强行杀死该进程[bes3pub@cvmfspublisher ~]$kill-995788##重新发布[bes3pub@cvmfspublisher ~]$ cvmfs_server publish yourrepository

    8.2 一次发布的增量文件大于2GB,导致cvmfs_server publish $repo命令卡住,联系huqb@ihep.ac.cn

实验软件访问流程

实验软件安装在cvmfs文件系统,用户安装cvmfs client后,通过简单配置即可实现软件访问。

  1. cvmfs client 安装步骤:

    a. install cvmfs and cvmfs-ihep-config

    [user@localhost ~]# yum -y install https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest.noarch.rpm[user@localhost ~]# yum -y install cvmfs cvmfs-config-default[user@localhost ~]# cvmfs_config setup

    b. 配置default.local,设置默认检测的软件仓库,是否直连服务器或通过代理服务器访问,

    [user@localhost ~]# cat /etc/cvmfs/default.local (输入以下内容)CVMFS_REPOSITORIES=bes3.ihep.ac.cn,bes.ihep.ac.cn,cvmfs-config.cern.chCVMFS_CACHE_BASE=/scratch/cvmfsCVMFS_QUOTA_LIMIT=40960CVMFS_HTTP_PROXY=DIRECT ORCVMFS_HTTP_PROXY="http://proxyIP:3128"# OR DIRECT ## IHEP-site proxy ip is 202.122.33.52 SDU-sit proxy is cvmfs.hepg.sdu.edu.cn

    c. 配置系统enfroce=disable

    [user@localhost ~]# setenforce 0

    d. 配置默认访问的stratum服务器地址

    [user@localhost ~]# curl -o /etc/cvmfs/domain.d/cern.ch.local http://cvmfs-stratum-one.ihep.ac.cn/cvmfs/software/client_configure/cern.ch.local[user@localhost ~]# ln -s /etc/cvmfs/domain.d/cern.ch.local /etc/cvmfs/domain.d/egi.eu.local[user@localhost ~]# ln -s /etc/cvmfs/domain.d/cern.ch.local /etc/cvmfs/domain.d/opensciencegrid.org.local

    e. 配置ihep.ac.cn域并导入key

    [user@localhost ~]# mkdir /etc/cvmfs/keys/ihep.ac.cn[user@localhost ~]# curl -o /etc/cvmfs/keys/ihep.ac.cn/ihep.ac.cn.pub http://cvmfs-stratum-one.ihep.ac.cn/cvmfs/software/client_configure/ihep.ac.cn/ihep.ac.cn.pub[user@localhost ~]# curl -o /etc/cvmfs/domain.d/ihep.ac.cn.conf http://cvmfs-stratum-one.ihep.ac.cn/cvmfs/software/client_configure/ihep.ac.cn.conf

    f. 检查cvmfsclient是否正常

    [user@localhost ~]# cvmfs_config probe

    完成安装

results matching ""

    No results matching ""