代码拉取完成,页面将自动刷新
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from toolService import ToolService
from dataService import DataService
class ContainerService:
def __init__(self):
self.tool = ToolService()
self.data = DataService()
def gen_def(self, image):
config_file = self.data.get_config_file_name()
def_file_content = f'''BootStrap: docker
From: {image}
%environment
source /etc/profile || true
cd $JARVIS_ROOT
source env.sh
%post
# Install the necessary development environment
yum install -y environment-modules git dmidecode pciutils wget vim
# Install base gcc
yum install -y gcc gcc-c++ gcc-gfortran glibc-devel make libgfortran
# install network package
yum install -y tcsh tcl lsof tk bc
source /etc/profile || true
git config --global http.sslVerify false
git clone https://gitee.com/openeuler/hpcrunner
cd hpcrunner
source ./init.sh
# add your personal files here
# Switch config
./jarvis -use {config_file}
# download dependency
./jarvis -d
# install dependency
./jarvis -dp
# build hpc
./jarvis -b
# run hpc
./jarvis -r
# clean tmp directory
rm -rf downloads tmp
'''
def_file = config_file+'.def'
self.tool.write_file(def_file, def_file_content)
print(f'Singularity file {def_file} successfully generated!')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。