|
@@ -1,233 +0,0 @@
|
|
|
-
|
|
|
-set -x
|
|
|
-
|
|
|
-source /root/anaconda3/bin/activate py37
|
|
|
-
|
|
|
-export SPARK_HOME=/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8
|
|
|
-export PATH=$SPARK_HOME/bin:$PATH
|
|
|
-export HADOOP_CONF_DIR=/etc/taihao-apps/hadoop-conf
|
|
|
-export JAVA_HOME=/usr/lib/jvm/java-1.8.0
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-table='alg_recsys_sample_all'
|
|
|
-today="$(date +%Y%m%d)"
|
|
|
-today_early_3="$(date -d '3 days ago' +%Y%m%d)"
|
|
|
-
|
|
|
-
|
|
|
-begin_early_2_Str="$(date -d '2 days ago' +%Y%m%d)"
|
|
|
-end_early_2_Str="$(date -d '2 days ago' +%Y%m%d)"
|
|
|
-beginHhStr=00
|
|
|
-endHhStr=23
|
|
|
-max_hour=05
|
|
|
-max_minute=00
|
|
|
-
|
|
|
-
|
|
|
-originDataPath=/dw/recommend/model/41_recsys_sample_data/
|
|
|
-
|
|
|
-valueDataPath=/dw/recommend/model/14_feature_data/
|
|
|
-
|
|
|
-bucketDataPath=/dw/recommend/model/43_recsys_train_data/
|
|
|
-
|
|
|
-MODEL_PATH=/root/joe/recommend-emr-dataprocess/model
|
|
|
-
|
|
|
-PREDICT_PATH=/root/joe/recommend-emr-dataprocess/predict
|
|
|
-
|
|
|
-LAST_MODEL_HOME=/root/joe/model_online
|
|
|
-
|
|
|
-model_name=model_nba8
|
|
|
-
|
|
|
-FM_HOME=/root/sunmingze/alphaFM/bin
|
|
|
-
|
|
|
-HADOOP=/opt/apps/HADOOP-COMMON/hadoop-common-current/bin/hadoop
|
|
|
-OSS_PATH=oss://art-recommend.oss-cn-hangzhou.aliyuncs.com/zhangbo/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-echo "$(date +%Y-%m-%d_%H-%M-%S)----------step0------------开始校验是否生产完数据,分区信息:beginStr:${begin_early_2_Str}${beginHhStr},endStr:${end_early_2_Str}${endHhStr}"
|
|
|
-while true; do
|
|
|
- python_return_code=$(python /root/joe/recommend-emr-dataprocess/qiaojialiang/checkHiveDataUtil.py --table ${table} --beginStr ${begin_early_2_Str}${beginHhStr} --endStr ${end_early_2_Str}${endHhStr})
|
|
|
- echo "python 返回值:${python_return_code}"
|
|
|
- if [ $python_return_code -eq 0 ]; then
|
|
|
- echo "Python程序返回0,校验存在数据,退出循环。"
|
|
|
- break
|
|
|
- fi
|
|
|
- echo "Python程序返回非0值,不存在数据,等待五分钟后再次调用。"
|
|
|
- sleep 300
|
|
|
- current_hour=$(date +%H)
|
|
|
- current_minute=$(date +%M)
|
|
|
-
|
|
|
- if (( current_hour > max_hour || (current_hour == max_hour && current_minute >= max_minute) )); then
|
|
|
- echo "最长等待时间已到,失败:${current_hour}-${current_minute}"
|
|
|
- /root/anaconda3/bin/python monitor_util.py --level error --msg "荐模型数据更新 \n【任务名称】:step0校验是否生产完数据\n【是否成功】:error\n【信息】:最长等待时间已到,失败:${current_hour}-${current_minute}"
|
|
|
- exit 1
|
|
|
- fi
|
|
|
-done
|
|
|
-
|
|
|
-
|
|
|
-echo "$(date +%Y-%m-%d_%H-%M-%S)----------step1------------开始根据${table}生产原始数据"
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
|
|
|
---class com.aliyun.odps.spark.examples.makedata_recsys.makedata_recsys_41_originData_20240709 \
|
|
|
---master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
|
|
|
-../target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
|
|
|
-tablePart:64 repartition:32 \
|
|
|
-beginStr:${begin_early_2_Str}00 endStr:${end_early_2_Str}09 \
|
|
|
-savePath:${originDataPath} \
|
|
|
-table:${table} &
|
|
|
-
|
|
|
-/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
|
|
|
---class com.aliyun.odps.spark.examples.makedata_recsys.makedata_recsys_41_originData_20240709 \
|
|
|
---master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
|
|
|
-../target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
|
|
|
-tablePart:64 repartition:32 \
|
|
|
-beginStr:${begin_early_2_Str}10 endStr:${end_early_2_Str}15 \
|
|
|
-savePath:${originDataPath} \
|
|
|
-table:${table} &
|
|
|
-
|
|
|
-/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
|
|
|
---class com.aliyun.odps.spark.examples.makedata_recsys.makedata_recsys_41_originData_20240709 \
|
|
|
---master yarn --driver-memory 1G --executor-memory 2G --executor-cores 1 --num-executors 16 \
|
|
|
-../target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
|
|
|
-tablePart:64 repartition:32 \
|
|
|
-beginStr:${begin_early_2_Str}16 endStr:${end_early_2_Str}23 \
|
|
|
-savePath:${originDataPath} \
|
|
|
-table:${table} &
|
|
|
-
|
|
|
-wait
|
|
|
-if [ $? -ne 0 ]; then
|
|
|
- echo "Spark原始样本生产任务执行失败"
|
|
|
- /root/anaconda3/bin/python monitor_util.py --level error --msg "荐模型数据更新 \n【任务名称】:step1根据${table}生产原始数据\n【是否成功】:error\n【信息】:Spark原始样本生产任务执行失败"
|
|
|
- exit 1
|
|
|
-else
|
|
|
- echo "spark原始样本生产执行成功"
|
|
|
-fi
|
|
|
-
|
|
|
-
|
|
|
-echo "$(date +%Y-%m-%d_%H-%M-%S)----------step2------------根据特征分桶生产重打分特征数据"
|
|
|
-/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
|
|
|
---class com.aliyun.odps.spark.examples.makedata_recsys.makedata_recsys_43_bucketData_20240709 \
|
|
|
---master yarn --driver-memory 2G --executor-memory 4G --executor-cores 1 --num-executors 16 \
|
|
|
-../target/spark-examples-1.0.0-SNAPSHOT-shaded.jar \
|
|
|
-readPath:${originDataPath} \
|
|
|
-savePath:${bucketDataPath} \
|
|
|
-beginStr:${begin_early_2_Str} endStr:${end_early_2_Str} repartition:500 \
|
|
|
-filterNames:XXXXXXXXX \
|
|
|
-fileName:20240609_bucket_314.txt \
|
|
|
-whatLabel:is_return whatApps:0,4,21,17
|
|
|
-if [ $? -ne 0 ]; then
|
|
|
- echo "Spark特征分桶处理任务执行失败"
|
|
|
- /root/anaconda3/bin/python monitor_util.py --level error --msg "荐模型数据更新 \n【任务名称】:step3训练数据产出\n【是否成功】:error\n【信息】:Spark特征分桶处理任务执行失败"
|
|
|
- exit 1
|
|
|
-else
|
|
|
- echo "spark特征分桶处理执行成功"
|
|
|
-fi
|
|
|
-echo "$(date +%Y-%m-%d_%H-%M-%S)----------step5------------spark特征分桶处理执行成功:${begin_early_2_Str}"
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|