{"id":971,"date":"2024-03-15T20:02:22","date_gmt":"2024-03-15T12:02:22","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=971"},"modified":"2024-03-15T20:02:22","modified_gmt":"2024-03-15T12:02:22","slug":"cdlinux%e9%95%9c%e5%83%8f%e6%96%87%e4%bb%b6%e5%9c%a8%e5%93%aa%e9%87%8csingularity%e5%ae%89%e8%a3%85%e4%b8%8e%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/15\/cdlinux%e9%95%9c%e5%83%8f%e6%96%87%e4%bb%b6%e5%9c%a8%e5%93%aa%e9%87%8csingularity%e5%ae%89%e8%a3%85%e4%b8%8e%e4%bd%bf%e7%94%a8\/","title":{"rendered":"cdlinux\u955c\u50cf\u6587\u4ef6\u5728\u54ea\u91cc Singularity \u5b89\u88c5\u4e0e\u4f7f\u7528"},"content":{"rendered":"<div>\n<p>\u5728\u7ebfwifi\u8dd1\u5305 \u91d1\u521a\u5305\u8dd1\u5305 cap\u8dd1\u5305 hccapx ewsa\u5728\u7ebf \u5c31\u6765 <strong><a href=\"https:\/\/ccwifi.cc\" target=\"_blank\" rel=\"noopener\">\u63e1\u624b\u5305\u8dd1\u5305<\/a><\/strong><\/p>\n<p>\u5404\u4f4d\u597d \u53c8\u89c1\u9762\u4e86 \u6211\u662f\u66f9\u64cd \u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u65b0\u7684\u6559\u7a0b<\/p>\n<p>\u5e0c\u671b\u5404\u4f4d\u7ec6\u5fc3\u5b66\u4e60 \u4f4e\u8c03\u7528\u7f51<\/p>\n<\/div>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710504135381_1.jpg\" alt=\"cdlinux\u955c\u50cf\u6587\u4ef6\u5728\u54ea\u91cc\"><\/p>\n<p>\u5bb9\u5668\u6280\u672f\u662f\u4e00\u79cd\u4ee5\u5e94\u7528\u8f6f\u4ef6\u4e3a\u4e2d\u5fc3\u7684\u865a\u62df\u5316\u6280\u672f\u3002\u5b83\u5c06\u5e94\u7528\u8f6f\u4ef6\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u9879\u6253\u5305\u6210\u5bb9\u5668\u955c\u50cf\uff0c\u4f7f\u5f97\u8fd9\u4e9b\u955c\u50cf\u53ef\u4ee5\u76f4\u63a5\u5728\u4e0d\u540c\u7684Linux\u4e3b\u673a\u4e0a\u8fd0\u884c\u3002\u901a\u8fc7\u5bb9\u5668\u6280\u672f\uff0c\u53ef\u4ee5\u89e3\u51b3\u5b89\u88c5\u8f6f\u4ef6\u65f6\u7684\u4f9d\u8d56\u5e93\u95ee\u9898\u3001\u8f6f\u4ef6\u73af\u5883\u9694\u79bb\u95ee\u9898\u4ee5\u53ca\u8f6f\u4ef6\u73af\u5883\u79fb\u690d\u95ee\u9898\u3002Singularity\u662f\u4e00\u79cd\u4e13\u95e8\u7528\u4e8e\u9ad8\u6027\u80fd\u8ba1\u7b97\u573a\u666f\u7684\u5bb9\u5668\u6280\u672f\uff0c\u7531\u52b3\u4f26\u65af\u4f2f\u514b\u5229\u56fd\u5bb6\u5b9e\u9a8c\u5ba4\u5f00\u53d1\u3002\u76f8\u6bd4\u5176\u4ed6\u5bb9\u5668\u6280\u672f\uff0cSingularity\u66f4\u52a0\u8f7b\u91cf\u7ea7\u4e14\u90e8\u7f72\u66f4\u5feb\uff0c\u56e0\u6b64\u5728\u9ad8\u6027\u80fd\u8ba1\u7b97\u4e2d\u5fc3\u5f97\u5230\u5e7f\u6cdb\u5e94\u7528\u3002<\/p>\n<p>\u4f7f\u7528Singularity\u6ee1\u8db3\u4f5c\u4e1a\u8fd0\u884c\u7684\u8f6f\u4ef6\u73af\u5883\u9700\u8981\u5148\u521b\u5efa\u6216\u83b7\u53d6\u8f6f\u4ef6\u955c\u50cf\uff0c\u7136\u540e\u5c06\u955c\u50cf\u4e0a\u4f20\u5230\u96c6\u7fa4\u4e0a\u8fd0\u884c\u3002\u5728\u6709root\u6743\u9650\u7684Linux\u4e3b\u673a\u4e0a\u6216\u914d\u7f6e\u4e86fakeroot\u7684Linux\u4e3b\u673a\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528Singularity\u521b\u5efa\u8f6f\u4ef6\u955c\u50cf\u3002\u4e0b\u9762\u5c06\u4ecb\u7ecd\u5728\u6709root\u6743\u9650\u7684\u4e3b\u673a\u4e0a\u5b89\u88c5Singularity\u4ee5\u53ca\u4f7f\u7528Singularity\u521b\u5efa\u8f6f\u4ef6\u955c\u50cf\u7684\u65b9\u6cd5\u3002\u540c\u65f6\uff0c\u8fd8\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728\u914d\u7f6e\u4e86fakeroot\u8282\u70b9\u4e0a\u901a\u8fc7Singularity\u6784\u5efa\u8f6f\u4ef6\u955c\u50cf\u3002<\/p>\n<pre><code class=\"language-text\"># \u5b89\u88c5\u4f9d\u8d56\nyum install -y gcc libuuid-devel squashfs-tools openssl-devel make\n# \u5b89\u88c5go\nexport VERSION=1.17.2 OS=linux ARCH=amd64   \nwget https:\/\/dl.google.com\/go\/go$VERSION.$OS-$ARCH.tar.gz \ntar -C \/usr\/local -xzvf go$VERSION.$OS-$ARCH.tar.gz\nrm -f go$VERSION.$OS-$ARCH.tar.gz \necho 'export PATH=\/usr\/local\/go\/bin:$PATH' &gt;&gt; \/etc\/profile\nsource \/etc\/profile\n# \u5b89\u88c5singularity\nexport VERSION=3.9.2\nwget https:\/\/github.com\/sylabs\/singularity\/releases\/download\/v${VERSION}\/singularity-ce-${VERSION}.tar.gz \ntar -xzf singularity-ce-${VERSION}.tar.gz\ncd singularity-ce-${VERSION}\n.\/mconfig --prefix=\/opt\/singularity\/${VERSION}\ncd builddir\/\nmake &amp;&amp; make install\necho \"export PATH=\/opt\/singularity\/${VERSION}\/bin:$PATH\" &gt;&gt; \/etc\/profile<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710504135381_2.webp\" alt=\"cdlinux\u955c\u50cf\u6587\u4ef6\u5728\u54ea\u91cc\"><\/p>\n<pre><code class=\"language-text\"># \u62c9\u53d6docker\u955c\u50cf\u521b\u5efasandbox\u683c\u5f0f\u5bb9\u5668\nsingularity build --sandbox molspin docker:\/\/centos:7.6.1810\n# \u901a\u8fc7\u4ea4\u4e92\u7684\u65b9\u5f0f\u8fdb\u5165\u5bb9\u5668\u955c\u50cf\uff0c\u8fdb\u884c\u8f6f\u4ef6\u7684\u5b89\u88c5\nsingularity shell -w molspin\n# \u5b89\u88c5\u4f9d\u8d56\nyum install epel-release centos-release-scl -y\nyum install devtoolset-7 armadillo-devel -y\nsource \/opt\/rh\/devtoolset-7\/enable\necho \"source \/opt\/rh\/devtoolset-7\/enable\" &gt;&gt; \/environment\n# \u6ce8\u518c\u5e76\u4e0b\u8f7dMolSpin\u5b89\u88c5\u5305, \u89e3\u538b\u540e\u8fdb\u5165\nunzip -d molspin molspin-v1.0.120819.zip\ncd molspin &amp;&amp; make\ncp molspin \/usr\/local\/bin\/\n# \u5728\u5b89\u88c5\u8f6f\u4ef6\u5b8c\u540e\u9000\u51fa\u955c\u50cf\nexit\n# \u751f\u6210sif\u6587\u4ef6\nsingularity build molspin.sif molspin\/\n# \u5c06\u521b\u5efa\u597d\u7684\u8f6f\u4ef6\u955c\u50cf\u4e0a\u4f20\u5230\u9ad8\u6027\u80fd\u8ba1\u7b97\u96c6\u7fa4\uff0c\u52a0\u8f7dsingularity\u8f6f\u4ef6\u73af\u5883\n# \u8fd0\u884c\u955c\u50cf\uff0c\u5176\u4e2dexample.msd\u4e3a\u8f93\u5165\u6587\u4ef6\nsingularity exec molspin.sif  molspin -p 2 -a example.msd<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710504135381_3.webp\" alt=\"cdlinux\u955c\u50cf\u6587\u4ef6\u5728\u54ea\u91cc\"><\/p>\n<p>\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u6765\u4ecb\u7ecd\u5728\u62e5\u6709root\u6743\u9650\u7684\u4e2a\u4eba\u4e3b\u673a\u4e0a\u5b89\u88c5Singularity\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u4ee5\u8f6f\u4ef6molspin\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Singularity\u90e8\u7f72\u8f6f\u4ef6\u955c\u50cf\u3002<\/p>\n<p>SIF\u548csandbox\u662f\u4e24\u79cd\u53ef\u4ee5\u76f8\u4e92\u8f6c\u6362\u7684\u955c\u50cf\u683c\u5f0f\u3002\u8981\u5c06SIF\u683c\u5f0f\u7684\u5bb9\u5668\u8f6c\u6362\u4e3asandbox\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-text\"># \u767b\u5f55\u4e13\u7528\u8282\u70b9\nssh @162.105.133.209\n# \u62c9\u53d6docker\u955c\u50cf\u521b\u5efasandbox\u683c\u5f0f\u5bb9\u5668\n# \u521b\u5efa\u5bb9\u5668\u65f6\u52a0\u5165\u53c2\u6570--fakeroot\nsingularity build --fakeroot --sandbox molspin docker:\/\/centos:7.6.1810\n# \u901a\u8fc7\u4ea4\u4e92\u7684\u65b9\u5f0f\u8fdb\u5165\u5bb9\u5668\u955c\u50cf\uff0c\u4fee\u6539\u5bb9\u5668\u955c\u50cf\n# \u52a0\u5165\u53c2\u6570--fakeroot\nsingularity shell --fakeroot -w molspin\n# \u5b89\u88c5\u4f9d\u8d56\nyum install epel-release centos-release-scl -y\nyum install devtoolset-7 armadillo-devel -y\nsource \/opt\/rh\/devtoolset-7\/enable\necho \"source \/opt\/rh\/devtoolset-7\/enable\" &gt;&gt; \/environment\n# \u6ce8\u518c\u5e76\u4e0b\u8f7dMolSpin\u5b89\u88c5\u5305, \u89e3\u538b\u540e\u8fdb\u5165\nunzip -d molspin molspin-v1.0.120819.zip\ncd molspin &amp;&amp; make\ncp molspin \/usr\/local\/bin\/\n# \u5728\u5b89\u88c5\u8f6f\u4ef6\u5b8c\u540e\u9000\u51fa\u955c\u50cf\nexit\n# \u751f\u6210sif\u6587\u4ef6\nsingularity build --fakeroot molspin.sif molspin\/\n# \u8fd0\u884c\u955c\u50cf\uff0c\u5176\u4e2dexample.msd\u4e3a\u8f93\u5165\u6587\u4ef6\nsingularity exec molspin.sif molspin -p 2 -a example.msd<\/code><\/pre>\n<p>singularity build &#8211;sandbox centos76 centos76.sif<\/p>\n<p>\u8981\u5c06sandbox\u5bb9\u5668\u955c\u50cf\u8f6c\u6362\u4e3aSIF\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>singularity build centos76.sif centos76<\/p>\n<p>\u6b64\u5916\uff0c\u96c6\u7fa4\u4e0a\u8fd8\u90e8\u7f72\u4e86\u4e13\u95e8\u7528\u4e8e\u6784\u5efaSingularity\u8f6f\u4ef6\u955c\u50cf\u7684\u8282\u70b9\u3002\u7528\u6237\u53ef\u4ee5\u5728\u8be5\u8282\u70b9\u4e0a\u4f7f\u7528fakeroot\u5b89\u88c5\u8f6f\u4ef6\u955c\u50cf\uff0c\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-text\"># \u5047\u8bbe\u8981\u5220\u9664\u7684\u4e3a\u6587\u4ef6\u5939\u540d\u4e3amolspin\u7684sandbox\u955c\u50cf\n# \u9996\u5148\uff0c\u4ee5\u53ef\u8bfb\u7684\u6a21\u5f0f\u8fdb\u5165\u8981\u5220\u9664\u7684\u955c\u50cf\nsingularity shell --fakeroot -w molspin\n# \u5220\u9664\u6389\u5bb9\u5668\u4e2d\uff0c\u57fa\u4e8efakeroot\u521b\u5efa\u7684\u6240\u6709\u6587\u4ef6\nrm -rf \/* 1&gt;\/dev\/null 2&gt;&amp;1\n# \u9000\u51fa\u955c\u50cf\nexit\n# \u5c06\u521b\u5efa\u597d\u7684\u8f6f\u4ef6\u955c\u50cf\u4e0a\u4f20\u5230\u9ad8\u6027\u80fd\u8ba1\u7b97\u96c6\u7fa4\uff0c\u52a0\u8f7dsingularity\u8f6f\u4ef6\u73af\u5883\n# \u5220\u9664\u6389\u5269\u4e0b\u7684\nrm -rf molspin<\/code><\/pre>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/zhuanlan.zhihu.com\/p\/517795921 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>cdlinux\u955c\u50cf\u6587\u4ef6\u5728\u54ea\u91cc Singularity \u5b89\u88c5\u4e0e\u4f7f\u7528\u200b\u5bb9\u5668\u6280\u672f\u662f\u4e00\u79cd\u4ee5\u5e94\u7528\u8f6f\u4ef6\u4e3a\u4e2d\u5fc3\u7684\u865a\u62df\u5316\u6280\u672f\u3002\u4ee5\u5e94\u7528\u8f6f\u4ef6\u4e3a\u5355\u5143\uff0c\u5c06\u8f6f\u4ef6\u53ca\u6240\u6709\u7684\u4f9d\u8d56\u6253\u5305\u6210\u5bb9\u5668\u955c\u50cf\uff0c\u6253\u5305\u540e\u7684\u5bb9\u5668\u955c\u50cf\u53ef\u76f4\u63a5\u62f7\u8d1d\u5230\u4e0d\u540c\u7684Linux\u4e3b\u673a\u4e0a\u8fd0\u884c\u3002\u901a\u8fc7\u5bb9\u5668\u6280\u672f\uff0c\u53ef\u4ee5\u5f88\u597d\u89e3\u51b3\u5b89\u88c5\u8f6f\u4ef6\u65f6<\/p>\n","protected":false},"author":1,"featured_media":972,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-971","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/972"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=971"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}