更新时间:2024-07-04 GMT+08:00
挂载OBS使用限制
云容器实例通过辅助容器(SideCar Container)挂载OBS路径,并将路径共享给主容器,如图1所示。
限制条件
挂载OBS时有如下限制:
- 创建Pod时需要添加annotations字段:obssidecar-injector-webhook/inject: 'true'。
- obssidecar-injector-webhook/inject: 'true' : 表示挂载OBS需要创建obssidecar容器。
- 挂载obs并行文件系统时,obssidecar容器需预留一定内存以保障业务可靠性,防止容器因资源不足异常退出。当业务容器挂载单个obs并行文件系统时,CPU和内存规格建议配置如下:
"obssidecar-injector-webhook/cpu": "500m",
"obssidecar-injector-webhook/memory": "1024Mi"
当业务容器挂载多个obs并行文件系统时,相应CPU和内存规格逐倍增加。- obssidecar-injector-webhook/cpu: 表示obssidecar容器cpu规格。
- obssidecar-injector-webhook/memory: 表示obssidecar容器memory规格。
- 挂载obs并行文件系统时,可指定挂载的umask来限制文件或目录权限。
- obssidecar-injector-webhook/umask:表示obssidecar容器挂载时的权限掩码。
启动命令。
示例如下:
{ "apiVersion": "batch/v1", "kind": "Job", "metadata": { "annotations": { "description": "" }, "enable": true, "name": "obs-casoffinder", "namespace": "cci-namespace-tibgpu", "labels": {} }, "spec": { "template": { "metadata": { "enable": true, "name": "obs-casoffinder", "annotations": { "obssidecar-injector-webhook/inject": "true", "obssidecar-injector-webhook/cpu": "500m", "obssidecar-injector-webhook/memory": "2048Mi", "cri.cci.io/gpu-driver": "gpu-418.126" } }, "spec": { "containers": [ { "image": "swr.cn-north-1.myhuaweicloud.com/aeocdc/opencl1:v1", "name": "casoffinder-obs", "terminationMessagePolicy": "File", "resources": { "limits": { "cpu": "4", "memory": "32Gi", "nvidia.com/gpu-tesla-v100-32GB":"1" }, "requests": { "cpu": "4", "memory": "32Gi", "nvidia.com/gpu-tesla-v100-32GB":"1" } }, "command": [ "/bin/sh", "-c", "/tmp/obs0/gBIG/cas-offinder /tmp/obs0/gBIG/off_targetInput.txt G /tmp/obs0/gBIG/off_targetOutput.txt && echo >/obssidecar/terminate/0" ], "lifecycle": {}, "volumeMounts": [ { "name": "cci-obs-import-jzt9g50x-tunn", "mountPath": "/tmp/obs0" } ] } ], "imagePullSecrets": [ { "name": "imagepull-secret" } ], "restartPolicy": "Never", "volumes": [ { "persistentVolumeClaim": { "claimName": "cci-obs-import-jzt9g50x-tunn" }, "name": "cci-obs-import-jzt9g50x-tunn" } ] } }, "activeDeadlineSeconds": 200 } }
父主题: 附录