文档首页 > > 流程语法参考> 流程语法示例> 单一步骤(一个并发)

单一步骤(一个并发)

分享
更新时间: 2019/04/22 GMT+08:00

命令示例

首先以执行单一命令为例。以 gcs sub job 为例,我们使用:

gcs sub job --cpu 1 --memory 1g --tool bwa:0.7.12 --shell sh bwa_help.sh

生成GCS流程示例

该命令将会生成以下模板,并提交基因容器语法解析器:

version: genecontainer_0_1
inputs:
  memory:
    default: 1g
    type: string
  cpu:
    default: 1c
    type: string
  tool:
    default: bwa:0.7.12
    type: string
  job-script:
    default: bwa_help.sh
    type: string
  jobid:
    default: bwa-help-2018-0830-171114-00d34
    type: string
  shell:
    default: sh
    type: string
workflow:
  bwa-help-2018-0830-171114-00d34:
    tool: bwa:0.7.12
    type: GCS.Job
    resources:
      memory: ${memory}
      cpu: ${cpu}
    commands:
      - sh /obs/gcscli/bwa-help-2018-0830-171114-00d34/bwa_help.sh
volumes:
  sample-data:
    mount_path: /obs
    mount_from:
      pvc: ${GCS_DATA_PVC}
  temp-data:
    mount_path: /sfs
    mount_from:
      pvc: ${GCS_SFS_PVC}
  ref-data:
    mount_path: /ref
    mount_from:
      pvc: ${GCS_REF_PVC}
outputs:
  bwa-help-2018-0830-171114-00d34:
    path:
      - /obs/output/bwa-help-2018-0830-171114-00d34

生成 Kubernetes示例

该模板将进一步解析成以下 Kubernetes 模板 ,并提交云容器引擎:

kind: Job
apiVersion: batch/v1
metadata:
  name: bwa-help-2018-0830-171114-00d34-0-81419ff7ad0d11e8
  namespace: default
  selfLink: >-
    /apis/batch/v1/namespaces/default/jobs/bwa-help-2018-0830-171114-00d34-0-81419ff7ad0d11e8
  uid: 815b643b-ad0d-11e8-aba9-fa163ed435e0
  resourceVersion: '706141'
  labels:
    gcs.execution.id: 81419ff7-ad0d-11e8-bebc-0255ac1066a1
    gcs.execution.name: gcs-2018-0830-171114-1-0-2018-0830-171114-35d77
    gcs.source.name: bwa-help-2018-0830-171114-00d34
    source: gcs
    stack-name: gcs-2018-0830-171114-1-0-2018-0830-171114-35d77
spec:
  parallelism: 1
  completions: 1
  backoffLimit: 6
  selector:
    matchLabels:
      controller-uid: 815b643b-ad0d-11e8-aba9-fa163ed435e0
  template:
    metadata:
      creationTimestamp: null
      labels:
        controller-uid: 815b643b-ad0d-11e8-aba9-fa163ed435e0
        gcs.execution.id: 81419ff7-ad0d-11e8-bebc-0255ac1066a1
        gcs.execution.name: gcs-2018-0830-171114-1-0-2018-0830-171114-35d77
        gcs.source.name: bwa-help-2018-0830-171114-00d34
        job-name: bwa-help-2018-0830-171114-00d34-0-81419ff7ad0d11e8
        source: gcs
    spec:
      volumes:
        - name: sample-data
          persistentVolumeClaim:
            claimName: XXXXXXXXX
        - name: temp-data
          persistentVolumeClaim:
            claimName: XXXXXXXXX
        - name: ref-data
          persistentVolumeClaim:
            claimName: XXXXXXXXX
      containers:
        - name: bwa-help-2018-0830-171114-00d34-0-81419ff7ad0d11e8
          image: '100.125.5.235:20202/genecontainer/bwa:0.7.12-r1039-sam18-sbb67'
          command:
            - sh
            - '-c'
            - sh /obs/gcscli/bwa-help-2018-0830-171114-00d34/bwa_help.sh
          resources:
            requests:
              cpu: '1'
              memory: 1G
          volumeMounts:
            - name: sample-data
              mountPath: /obs
            - name: temp-data
              mountPath: /sfs
            - name: ref-data
              mountPath: /ref
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: OnFailure
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        podAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 1
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    source: gcs
                topologyKey: kubernetes.io/hostname
      schedulerName: default-scheduler
分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

跳转到云社区