Commit 7677fe0b authored by Zhang Xiaoli's avatar Zhang Xiaoli
Browse files

调通mbi和sls,增加优先级sorted_tag

parent a9428011
......@@ -38,9 +38,18 @@ fi
echo "dag_run_id:$dag_run_id" >> /work/extra-attributes.txt
pattern='"sorted_tag":"([^"]+)"'
if [[ $headers =~ $pattern ]]; then
sorted_tag="${BASH_REMATCH[1]}"
echo "sorted_tag: $sorted_tag"
else
# no sorted_tag in json
sorted_tag=1
fi
if [ $exit_code -eq 0 ]; then
echo "finish mbi, start sink-job."
scalebox task add --header dag_run_id=${dag_run_id} --header repeatable=yes --upsert ${message}
scalebox task add --header sorted_tag=${sorted_tag} --header dag_run_id=${dag_run_id} --header repeatable=yes --upsert ${message}
# scalebox task add $1
else
echo "finish mbi, exit_code: $exit_code"
......
FROM 10.3.10.10:8113/csst/csst-msc-l1-sls
FROM csu-harbor.csst.nao:10443/csst/csst-msc-l1-sls
USER root
COPY run.sh /app/bin/
......
IMAGE_NAME:=cnic/csst-msc-l1-sls
IMAGE_PATH:=/nfsdata/tmp
IMAGE_PATH:=/nfs/tmp/scalebox-images
build:
docker build --network=host -t $(IMAGE_NAME) .
dist: build
#docker save $(IMAGE_NAME) | zstdmt | pv | ssh c0 'zstd -d | docker load'
docker save $(IMAGE_NAME) > $(IMAGE_PATH)/msc-l1-sls.tar
ssh sc1 docker load -i $(IMAGE_PATH)/msc-l1-sls.tar
ssh sc2 docker load -i $(IMAGE_PATH)/msc-l1-sls.tar
ssh sc3 docker load -i $(IMAGE_PATH)/msc-l1-sls.tar
push:
docker push $(IMAGE_NAME)
run:
......
#!/bin/bash
arr=($(echo $1 | tr "-" " "))
obsid="${arr[0]}"
detector="${arr[1]}"
echo "obsid: "$obsid
echo "detector: "$detector
#TRACE=yes 临时办法
rm -rf /work/*
message=$1
echo "message: "$message
cd /pipeline/output/
python /pipeline/app/run.py $obsid $detector
python /pipeline/app/run.py $message
exit_code=$?
echo "=====pipeline.log====" > /work/custom-out.txt
......@@ -23,13 +24,34 @@ if test -f "$timefile"; then
mv /pipeline/output/timestamps.txt /work/timestamps.txt
fi
headers=$2
pattern='"dag_run_id":"([^"]+)"'
if [[ $headers =~ $pattern ]]; then
dag_run_id="${BASH_REMATCH[1]}"
echo "dag_run_id: $dag_run_id"
else
# no dag_run_id in json
dag_run_id=""
fi
echo "dag_run_id:$dag_run_id" >> /work/extra-attributes.txt
pattern='"sorted_tag":"([^"]+)"'
if [[ $headers =~ $pattern ]]; then
sorted_tag="${BASH_REMATCH[1]}"
echo "sorted_tag: $sorted_tag"
else
# no sorted_tag in json
sorted_tag=1
fi
if [ $exit_code -eq 0 ]; then
echo "finish sls, start sink-job."
scalebox task add --sink-job msc-l1-sls-extraction-zero $1
scalebox task add --header sorted_tag=${sorted_tag} --header dag_run_id=${dag_run_id} --header repeatable=yes --upsert ${message}
# scalebox task add $1
else
echo "finish sls, exit_code: $exit_code"
fi
rm -rf /pipeline/input/* /pipeline/output/*
exit $exit_code
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment