简体   繁体   English

使用奇点 linux 代替 docker-compose

[英]Substitute for docker-compose using singularity linux

Thanks for viewing my question!感谢您查看我的问题!

Problem: I'm fairly new to docker and linux.问题:我对 docker 和 linux 还很陌生。 I am wanting to run a docker image in my linux dist (CentOS version 7), where I don't have the ability to change the root.我想在我的 linux dist(CentOS 版本 7)中运行 docker 映像,我无法更改根目录。 Singularity v.3.6.4 is installed, and I pull the docker image using: Singularity v.3.6.4 已安装,我使用以下命令提取 docker 映像:

module load singularity/3.6.4
singularity pull docker://usdaarsnwrc/awsm:0.10

Note that, because I can't change the root, I have set the SINGULARITY_TMPDIR and SINGULARITY_CACHEDIR to my home directory.请注意,因为我无法更改根目录,所以我已将 SINGULARITY_TMPDIR 和 SINGULARITY_CACHEDIR 设置为我的主目录。

This works without error.这工作没有错误。

I then download a test case:然后我下载一个测试用例:

git clone https://github.com/USDA-ARS-NWRC/awsm_test_cases.git

And try to run it using their suggested command:并尝试使用他们建议的命令运行它:

python ./awsm_docker --case tuol

I get the following error:我收到以下错误:

/bin/sh: docker-compose: command not found
Traceback (most recent call last):
File "./awsm_docker", line 73, in <module>
     run()
File "./awsm_docker", line 55, in run
os.remove('./{}/topo/maxus.nc'.format(fpc))
FileNotFoundError: [Errno 2] No such file or directory: './tuolumne/topo/maxus.nc'

Question问题
It seems like this error results from the script, awsm_docker contained in the test data folder, which calls docker-compose in two instances.似乎此错误是由测试数据文件夹中包含的脚本 awsm_docker 导致的,该脚本在两个实例中调用 docker-compose。 Ex:前任:

    run_call = ('docker-compose'
                ' -f ./{}/docker-compose.yml'
                ' run awsm /data/input/{}').format(fpc, cfg)
    call(run_call, shell=True, universal_newlines=True)

So it seems like my issue is translating docker-compose to language that's compatible with singularity?所以看起来我的问题是将 docker-compose 翻译成与奇异性兼容的语言? Any ideas on how this would work?关于这将如何工作的任何想法?

Thank you for your help!谢谢您的帮助!

Though both are containers, Singularity can't always be used as a drop in replacement for Docker.尽管两者都是容器,但 Singularity 不能总是用作 Docker 的替代品。 When docker-compose is involved, you're always going to have to do some extra work.当涉及到 docker-compose 时,您总是需要做一些额外的工作。

In this case, since docker-compose is being called directly in their python script, you're going to have to write an equivalent script with the equivalent singularity commands.在这种情况下,由于 docker-compose 是在其 python 脚本中直接调用的,因此您将不得不编写一个具有等效奇点命令的等效脚本。 They are nice enough to print out the full docker command you need to modify.它们非常好,可以打印出您需要修改的完整 docker 命令。 Between that, the Docker documentation and the docs on singularity and docker , you should have what you need.在这之间,Docker 文档和关于奇异性和 docker的文档,你应该有你需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM