数据
Fluid 直接挂载 S3 以及性能测试
· ☕ 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

Fluid 使用 NFS Runtime 以及性能测试
· ☕ 3 分钟
1. 创建 Dataset 1 2 3 4 5 6 7 8 9 10 kubectl apply -f - <<EOF apiVersion: data.fluid.io/v1alpha1 kind: Dataset metadata: name: nfs-demo spec: mounts: - mountPoint: x.x.x.x:/x-x/ name: nfs-demo EOF 2. 创建 Runtime 1 2 3 4 5 6 7 8 9 10 11 12 13 14 kubectl apply -f - <<EOF apiVersion: data.fluid.io/v1alpha1 kind: ThinRuntimeProfile metadata: name: nfs spec: fileSystemType: nfs fuse: image: fluidcloudnative/nfs imageTag: v0.1 imagePullPolicy: IfNotPresent command: - "/usr/local/bin/entrypoint.sh" EOF 1 2 3 4 5 6 7 8 kubectl apply -f - <<EOF apiVersion: data.fluid.io/v1alpha1 kind: ThinRuntime metadata: name: nfs-demo spec: profileName: nfs EOF 3. 创建测试 Pod 1 2 3 4 5 6 7 8 9 10 11 12

运营不再是拍脑袋的事
· ☕ 3 分钟
更多的技巧,请持续关注本文的更新。 1. 运营不再是拍脑袋的事 万物互联,互联网对物理世界的建模越来越准确。我们的地理位置、行动轨迹、在电子设备上的操作都在被记录。如果能汇集各大厂商的用户画像,我们的数字版就出来了。 你只能代表此刻的你,而数字人可以

GrowingIO 数据采集字段分析
· ☕ 2 分钟
1. 字段含义 1.1 u, 用户ID 1 2 3 4 5 6 if cookie.has(gr_user_id){ //使用 cookie 中的 gr_user_id 有效期十年 } else { //按照 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 格式,随机生成一个 gr_user_id } 1.2 s,会话ID 1 2 3 4 5 6 7 if cookie.has(gr_session_id_){ //使用 cookie 中的 gr_session_id_ //gr_session_id_,的有效期为 100 分钟 } else { //按照 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 格式,随机生成一个 gr_session_id_ }

Django 初始化数据之 fixture
· ☕ 2 分钟
1. Fixtures 特点 Fixtures 是一种新的提供初始化数据的方法,并且被 Django 的测试框架用来处理单元测试的测试数据。不同于 SQL 文件的是,使用 fixture 可以提供一个被 Django 的 serialization 系统所能识别的序列化文件,它会被读取并自动转换成对应的 model ,然后保存进数据库。 2. 数据导出 将 app_name 的数据导出为 ini