8.3 软件发布

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

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

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

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

ihepcvmfs

实验软件发布流程:

实验软件管理员联系计算中心申请软件发布账号,定制软件仓库名称 $repo,同时发送公钥。

CVMFS管理员创建软件发布账号 username 后,实验软件管理员执行登陆发布

如何创建私钥公钥 执行下面命令, 可以设置私钥的密码,也可以不设置密码,默认生成位置是~/.ssh/下面的id_rsa和id_rsa.pub

$ ssh-keygen
  1. 软件管理员登陆 cvmfspublisher.ihep.ac.cn

    [user@localhost ~] ssh username@cvmfspublisher.ihep.ac.cn -i  yourprivatekey
    
  2. 查看软件仓库当前状态

    [user@cvmfspublisher ~]$ cvmfs_server list | grep  repositoryname | grep transaction
    

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

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

    [user@cvmfspublisher ~]$ cvmfs_server transaction repositoryname
    
  4. 软件编译相关方式,CVMFS实验软件仓库的编译一般有三种方式:

    a.简单copy方式,软件管理员拥有独立的实验软件编译环境进行新发布软件的编译,将编译后生成的发布数据通过远程拷贝的方式写入cvmfspublisher.ihep.ac.cn的/cvmfs/repositoryname/...相关路径下。

    b.通用编译安装方式,软件管理员在cvmfspublisher.ihep.ac.cn服务器上直接调用编译软件和相关依赖包对新发布的软件进行编译,编译生成的软件直接写入/cvmfs/repositoryname/...相关路径下。编译过程中所需的通用软件可以使用系统默认的软件,或使用/cvmfs/common.ihep.ac.cn/路径下特定版本的软件,如python35 python27 等。 /cvmfs/common.ihep.ac.cn/下支持的软件及其版本信息,详见[待整理].

    c.依赖操作系统的编译安装方式,软件管理员在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 files in the R/W mount: /cvmfs/<repo>/dirA & All /cvmfs/*.ihep.ac.cn can be accessed ) 
    Singularity yourimage.sif:~>  exit
    

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

  5. 编译完成后跳出软件仓库目录,然后执行发布命令

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

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

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

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

    [bes3pub@cvmfspublisher ~]$  cvmfs_server publish -m "boss665p01" bes3.ihep.ac.cn
    Using auto tag 'generic-2020-07-16T09:34:18Z'
    
    WARNING! There are open read-only file descriptors in /cvmfs/bes3.ihep.ac.cn
    --> This is potentially harmful and might cause problems later on.
        We can anyway perform the requested operation, but this will most likely
        break other processes with open file descriptors on /cvmfs/bes3.ihep.ac.cn!
    
        The following lsof report might show the processes with open file handles
    
    ##查看访问当前软件仓库的进程有哪些
    [bes3pub@cvmfspublisher ~]$ lsof /cvmfs/bes3.ihep.ac.cn
    COMMAND   PID    USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
    rm      95788 bes3pub  cwd    DIR   0,68       23 9237356 /cvmfs/bes3.ihep.ac.cn/bes3sw/Boss
    rm      95788 bes3pub    4r   DIR   0,68       10 9255952 /cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi/Bhlumi-00-00-12/x86_64-slc6-gcc46-opt (deleted)
    rm      95788 bes3pub    5r   DIR   0,68       10 9255873 /cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi (deleted)
    rm      95788 bes3pub    6r   DIR   0,68       10 9255874 /cvmfs/bes3.ihep.ac.cn/bes3sw/Boss/6.6.5.p01/Generator/Bhlumi/Bhlumi-00-00-12 (deleted)
    ##查看该进程卡住原因
    [bes3pub@cvmfspublisher ~]$ strace -p 95788
    strace: Process 95788 attached
    --- stopped by SIGTSTP ---
    ^Cstrace: Process 95788 detached
    ##强行杀死该进程
    [bes3pub@cvmfspublisher ~]$ kill -9 95788
    ##重新发布
    [bes3pub@cvmfspublisher ~]$  cvmfs_server publish yourrepository
    

实验软件访问流程

实验软件安装在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.ch
    CVMFS_CACHE_BASE=/scratch/cvmfs
    CVMFS_QUOTA_LIMIT=40960
    CVMFS_HTTP_PROXY=DIRECT   OR
    CVMFS_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 ""