【问题标题】:Building singularity image: "Failure while installing base packages"构建奇点图像:“安装基础包失败”
【发布时间】:2019-07-11 20:28:52
【问题描述】:

尝试为此包构建 Singularity 映像时: https://bitbucket.org/MAVERICLab/vcontact2.git

我明白了:

{cut}
I: Configuring login...
I: Configuring adduser...
I: Configuring apt...
I: Configuring util-linux...
I: Configuring mount...
I: Configuring sysvinit-utils...
I: Configuring libc-bin...
I: Unpacking the base system...
W: Failure while installing base packages.  This will be re-attempted up to five times.
W: See /usr/local/var/singularity/mnt/container/debootstrap/debootstrap.log for details

我有:

  • 奇点 2.5.2-dist
  • Ubuntu 16.04.6 LTS(我通过 apt-get 安装:dh-autoreconf、build-essential、libarchive-dev、debootstrap)

这个错误对我来说看起来很模糊,看起来有些软件包无法下载。我应该怎么解决这个问题? (我不想使用更新版本的 Singularity)

【问题讨论】:

  • 请考虑升级(或要求您的集群管理员升级)Singularity 到 v2.6.1。 v2.0 的所有其他版本都存在严重的安全漏洞。在 2.5.2 中,它是 CVE-2018-19295,更多详细信息请参见:github.com/sylabs/singularity/releases/tag/2.6.1
  • 您能否访问debootstrap.log 以查看失败的原因?我可以使用 ubuntu:xenial docker 映像复制错误,尽管 debootstrap 在我的主机操作系统上使用 18.04 LTS 成功。涉及 conda 的步骤将照原样失败。
  • @tsnowlan 我想尝试使用 Docker 容器的 Ubuntu 18.04,但这带来了新问题:/usr/sbin/debootstrap: 1455: /usr/sbin/debootstrap: cannot create /usr/local/var/singularity/mnt/container/test-dev-null: Permission denied E: Cannot install into target '/usr/local/var/singularity/mnt/container' mounted with noexec or nodev
  • 在 docker 中构建奇点图像时,您还必须将 --privileged 标志添加到 docker run ... 否则它将失败,尽管该错误消息看起来不太熟悉。不过,构建过程对我来说仍然失败,因为他们的定义文件有一些问题。

标签: singularity-container


【解决方案1】:

如果您愿意修改定义文件并使用不同的引导源,则以下内容可以在 18.04 LTS 上成功构建,应该也可以在 16.04 上。

# Use docker instead of debootstrap, could also probably use a newer version if desired
BootStrap: docker
From: ubuntu:xenial

%environment
    # note: this only active in `singularity exec` and `singularity run` steps
    export PATH=/miniconda3/bin:$PATH

%runscript
    exec vcontact "$@"

%post
    apt-get update && apt-get install -y automake build-essential bzip2 wget git default-jre unzip

    export BINPATH=/usr/local/bin

    # Install miniconda to save dependency nightmares
    wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh -b -f -p /miniconda3/
    rm Miniconda3-latest-Linux-x86_64.sh

    # pull the conda functions in
    . /miniconda3/etc/profile.d/conda.sh
    # make pip, etc. available while in %post
    export PATH="/miniconda3/bin:$PATH"

    conda install -y -c conda-forge hdf5 pytables pypandoc biopython networkx numpy pandas scipy scikit-learn psutil pip
    conda install -y -c bioconda mcl blast diamond

    pip install setuptools-markdown

    # Install vContact
    git clone https://bitbucket.org/MAVERICLab/vcontact2.git
    cd vcontact2 && pip install .

    # Bug with setuptools?
    cp /vcontact2/vcontact/data/ViralRefSeq-prokaryotes-v??.* /miniconda3/lib/python3.7/site-packages/vcontact/data/

    # 'Install' ClusterONE
    cd / && wget http://www.paccanarolab.org/static_content/clusterone/cluster_one-1.0.jar
    mv /cluster_one-1.0.jar $BINPATH && chmod +x $BINPATH/cluster_one-1.0.jar

    # Clean stuff up
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    conda clean --yes --tarballs --packages --source-cache

    # TACC's Stampede compliant, for iVirus/CyVerse
    mkdir /home1 && mkdir /scratch && mkdir /work

我将 cmets 放在我更改的行上,但如果这不是在您的系统上构建或对更改有疑问,请告诉我。

【讨论】:

    猜你喜欢
    • 2018-06-18
    • 1970-01-01
    • 2018-10-14
    • 2021-01-14
    • 2019-10-16
    • 1970-01-01
    • 1970-01-01
    • 2023-02-22
    • 1970-01-01
    相关资源
    最近更新 更多