mysql 镜像获取
https://github.com/PSC-PublicHealth/mysql-singularity-container/blob/master/README.md
启动singularity 服务
一次执行如下shell
sh instance.sh1
2
3
4
5
6!/bin/bash
mkdir -p ${PWD}/mysql/var/lib/mysql ${PWD}/mysql/run/mysqld
/share/app/singularity/3.8.1/bin/singularity instance start \
--bind ${PWD}/mysql/var/lib/mysql/:/var/lib/mysql \
--bind ${PWD}/mysql/run/mysqld:/run/mysqld \
./mysql.simg mysqlsh mysql_server.sh 启动mysql 服务
1
/share/app/singularity/3.8.1/bin/singularity run instance://mysql
创建文件 cromwell.sql
1
2
3
4
5
6CREATE DATABASE IF NOT EXISTS cromwell default charset utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'cromwell'@'localhost' IDENTIFIED BY 'cromwell';
GRANT all privileges ON cromwell.* TO 'cromwell'@'localhost';
grant all privileges on *.* to 'root'@'127.0.0.1' identified by 'root';
grant all privileges on *.* to 'cromwell'@'127.0.0.1' identified by 'cromwell';
flush privileges;sh cromwell_init.sh 创建mysql中的cromwel调度相关表结构
/share/app/singularity/3.8.1/bin/singularity exec instance://mysql mysql < cromwell.sql