AI
如何预热 Juicefs 数据
· ☕ 1 分钟
1. 关于 JuiceFS 的缓存 在主机上,预热的缓存是直接放在主机上的。 在集群中,分为两级缓存: Worker,提供集群级别共享的缓存 Fuse,提供仅当前节点级别的缓存 2. 使用 JuiceFS 客户端预热数据 指定目录 1 juicefs warmup /mnt/jfs/dataset-1 批量指定目录 1 juicefs warmup -f warm.txt 其中 warm.txt 为预热目录列表,每行一个目

Ascend NPU 驱动安装
· ☕ 3 分钟
1. 安装驱动 创建 HwHiAiUser 用户 1 2 groupadd -g 1000 HwHiAiUser useradd -g HwHiAiUser -u 1000 -d /home/HwHiAiUser -m HwHiAiUser -s /bin/bash 添加目录权限 1 2 chown -R HwHiAiUser /usr/local/Ascend chmod -R 755 /usr/local/Ascend 下载驱动、固件 前往 https://www.hiascend.ru/hardware/firmware-drivers/community?product=1&model=30&cann=All&driver=1.0.26.alpha 找到对应的驱动和固件。 1 wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend%20HDK/Ascend%20HDK%2024.1.RC2.2/Ascend-hdk-910b-npu-driver_24.1.rc2.2_linux-x86-64.run 1 wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Ascend%20HDK/Ascend%20HDK%2024.1.RC2.2/Ascend-hdk-910b-npu-firmware_7.3.0.2.220.run 安装驱动 1 bash ./Ascend-hdk-910b-npu-driver_24.1.rc2.2_linux-x86-64.run --full --install-for-all 安装固件 1 bash ./Ascend-hdk-910b-npu-firmware_7.3.0.2.220.run --full 2. 安装 ascend-docker-runtime 下载 ascend-docker-runtime 前往 https://gitee.com/ascend/ascend-docker-runtime/releases/tag/v5.0.0-RC3.2 找到对应架构的下载链接。 1 wget https://gitee.com/ascend/ascend-docker-runtime/releases/download/v5.0.0-RC3.2/Ascend-docker-runtime_5.0.RC3.2_linux-x86_64.run 安装 ascend-docker-runtime 1 bash ./Ascend-docker-runtime_5.0.RC3.2_linux-x86_64.run --install 3.

Fluid 挂载 S3 为 PVC 以及性能测试
· ☕ 1 分钟
1. 创建 Dataset 1 2 3 4 5 6 7 8 9 10 kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: my-s3 type: Opaque stringData: aws.accessKeyId: xxx aws.secretKey: xxx EOF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 kubectl apply -f - <<EOF apiVersion: data.fluid.io/v1alpha1 kind: Dataset metadata: name: my-s3 spec: mounts: - mountPoint: s3://BUCKET/ name: s3 options: alluxio.underfs.s3.endpoint: ks3-cn-beijing-internal.ksyun.com alluxio.underfs.s3.disable.dns.buckets: "false" encryptOptions: - name: aws.accessKeyId valueFrom: secretKeyRef: name: my-s3 key: aws.accessKeyId - name: aws.secretKey valueFrom: secretKeyRef: name: my-s3 key: aws.secretKey accessModes: - ReadWriteMany EOF 2. 创建 Runtime 1 2 3 4 5 6 7 8 9

Fluid 使用 Lustre Runtime 以及性能测试
· ☕ 4 分钟
1. 分析 Fluid 挂载 NFS 存储 查看 Fuse Pod 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 kubectl get pod nfs-demo-fuse-f9wg8 -oyaml apiVersion: v1 kind: Pod metadata: generateName: nfs-demo-fuse- spec: containers: - command: - /usr/local/bin/entrypoint.sh env: - name: FLUID_RUNTIME_TYPE value: thin - name: FLUID_RUNTIME_NS value: default - name: FLUID_RUNTIME_NAME value: nfs-demo - name: MOUNT_POINT value: /runtime-mnt/thin/default/nfs-demo/thin-fuse - name: MOUNT_OPTIONS value: ro image: fluidcloudnative/nfs:v0.1 imagePullPolicy: IfNotPresent lifecycle: preStop: exec: command: - sh - -c - umount /runtime-mnt/thin/default/nfs-demo/thin-fuse name: thin-fuse securityContext: privileged: true volumeMounts:

Fluid 使用 Lustre Runtime 以及性能测试
· ☕ 3 分钟
1. 打包 Fluid Runtime 镜像 创建 fluid_config_init.py 脚本 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #!/usr/bin/env python import json rawStr = "" with open("/etc/fluid/config.json", "r") as f: rawStr = f.readlines() rawStr = rawStr[0] script = """ #!/bin/sh set -ex MNT_FROM=$mountPoint MNT_TO=$targetPath trap "umount ${MNT_TO}" SIGTERM mkdir -p ${MNT_TO} mount -t lustre -o relatime,flock ${MNT_FROM} ${MNT_TO} sleep inf """ obj = json.loads(rawStr) with open("mount-lustre.sh", "w") as f: f.write('mountPoint="%s"\n' % obj["mounts"][0]["mountPoint"]) f.write('targetPath="%s"\n' % obj["targetPath"]) f.write(script) 只需调整一下 mount 命令即可。 创建启动脚本 entrypoint.sh 1 2 3