nextflow源码修改及部署
-
1. nextflow 详情
版本: 22.10.7
本地地址:http://192.168.0.135:30080/root/nextflow.git代码修改介绍:
K8sTaskHandler.groovy 中208行.withHostMount(k8sConfig.get("hostPath").toString(), k8sConfig.get("hostMountPath").toString)
支持k8s模式下hostpath本地路径;2. 部署方式:
2.1 docker
nextflow1.conf
docker { enabled = true runOptions = '-v /ceph_disk2:/ceph_disk2 --network=host --user root' }application.yml
server: port: 9081 spring: redis: host: 192.168.1.2 port: 6379 datasource: url: jdbc:postgresql://192.168.1.2:5435/qiime username: postgres password: anneng@1235_Jike2015 driver-class-name: org.postgresql.Driver mybatis: mapper-locations: classpath:mybatis/*.xml type-aliases-package: com.anneng.model nextflow: config: /ceph_disk2/app/nextflow/genostack_nextflow_api/config/nextflow1.conf weblog-url: http://localhost:9081/nextflow/catchMessage dataPath: /ceph_disk2/app/nextflow/genostack_nextflow_api/dag workdir: /ceph_disk2/app/nextflow/genostack_nextflow_api/nextflow_workdir path: /ceph_disk2/app/nextflow/genostack_nextflow_api/nextflow-22.10.7-all phpsource: /ceph_disk2/data/hongyuan/data/source_v3启动脚本:
docker run -p 9089:9081 -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /ceph_disk2:/ceph_disk2 -v /ceph_disk2/app/nextflow/genostack_nextflow_api/config/application.yml:/application.yml -d dockerhub.genostack.com:8090/library/nextflowapi:v1.91k8s启动方式:
nextflow1.conf
process { container = 'quay.io/nextflow/bash' executor = 'k8s' } k8s { namespace = 'default' hostPath = '/cephfs_data/' hostMountPath = '/cephfs_data/' }application.yml
server: port: 9081 spring: redis: host: 192.168.0.135 port: 30009 datasource: url: jdbc:postgresql://192.168.0.135:30008/qiime username: postgres password: anneng@1235_Jike2015 driver-class-name: org.postgresql.Driver mybatis: mapper-locations: classpath:mybatis/*.xml type-aliases-package: com.anneng.model nextflow: config: /cephfs_data/genostack_v3/genostack_nextflow_api/config/nextflow1.conf weblog-url: http://localhost:9081/nextflow/catchMessage dataPath: /cephfs_data/genostack_v3/genostack_nextflow_api/dag workdir: /cephfs_data/genostack_v3/genostack_nextflow_api/nextflow_workdir path: nextflow phpsource: /cephfs_data/genostack_v3/genostack_php/source_v3部署脚本;
sa.yaml--- apiVersion: v1 kind: Namespace metadata: name: wave-demo --- apiVersion: v1 kind: ServiceAccount metadata: namespace: wave-demo name: wave-sa annotations: eks.amazonaws.com/role-arn: "arn:aws:iam::011206878118:role/wave-demo-role" --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: namespace: wave-demo name: wave-role rules: - apiGroups: [""] resources: ["pods", "pods/status", "pods/log", "pods/exec"] verbs: ["get", "list", "watch", "create", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: namespace: wave-demo name: wave-rolebind roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: wave-role subjects: - kind: ServiceAccount name: wave-sanextflow.yaml
--- apiVersion: apps/v1 kind: Deployment metadata: name: nextflow labels: app: nextflow layer: backend spec: replicas: 1 selector: matchLabels: app: nextflow template: metadata: labels: app: nextflow spec: serviceAccountName: wave-sa serviceAccount: wave-sa containers: - name: nextflow image: dockerhub.genostack.com:8090/library/nextflowapi:v1.91 ports: - containerPort: 9081 volumeMounts: #容器内挂载点的定义部分 - name: data #容器内挂载点名称 subPath: genostack_v3/genostack_nextflow_api/config/application.yml mountPath: /application.yml - name: data mountPath: /cephfs_data volumes: #本地需要挂载到容器里的数据卷定义部分 - name: data hostPath: path: /cephfs_data --- kind: Service apiVersion: v1 metadata: name: nextflow labels: app: nextflow layer: backend spec: type: ClusterIP selector: app: nextflow ports: - port: 9081 targetPort: 9081 -
配置文件的优先级
Selector priorityWhen mixing generic process configuration and selectors the following priority rules are applied (from lower to higher):
Process generic configuration.
Process specific directive defined in the workflow script.
withLabel selector definition.
withName selector definition.