Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
csst
Scalebox Apps
Commits
dfa0f57e
Commit
dfa0f57e
authored
Nov 25, 2024
by
Zhang Xiaoli
Browse files
header增加dag_run_id字段,进行集成测试
parent
d61800aa
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
30 deletions
+50
-30
L1/dockerfiles/csst-msc-l1-mbi/run.sh
L1/dockerfiles/csst-msc-l1-mbi/run.sh
+13
-1
L1/dockerfiles/csst-msc-l1-qc0/run.sh
L1/dockerfiles/csst-msc-l1-qc0/run.sh
+11
-1
L1/dockerfiles/redis-cli/Dockerfile
L1/dockerfiles/redis-cli/Dockerfile
+1
-1
L1/dockerfiles/redis-cli/Makefile
L1/dockerfiles/redis-cli/Makefile
+2
-2
L1/dockerfiles/redis-cli/config/appconfig.txt
L1/dockerfiles/redis-cli/config/appconfig.txt
+1
-1
L1/dockerfiles/redis-cli/run.sh
L1/dockerfiles/redis-cli/run.sh
+18
-20
L1/pipelines/csst-msc-l1-mbi/app.yaml
L1/pipelines/csst-msc-l1-mbi/app.yaml
+4
-4
No files found.
L1/dockerfiles/csst-msc-l1-mbi/run.sh
View file @
dfa0f57e
...
@@ -26,9 +26,21 @@ if test -f "$timefile"; then
...
@@ -26,9 +26,21 @@ if test -f "$timefile"; then
mv
/pipeline/output/timestamp.txt /work/timestamps.txt
mv
/pipeline/output/timestamp.txt /work/timestamps.txt
fi
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
if
[
$exit_code
-eq
0
]
;
then
if
[
$exit_code
-eq
0
]
;
then
echo
"finish mbi, start sink-job."
echo
"finish mbi, start sink-job."
scalebox task add
$1
scalebox task add
--header
dag_run_id
=
${
dag_run_id
}
"
$1
"
# scalebox task add $1
else
else
echo
"finish mbi, exit_code:
$exit_code
"
echo
"finish mbi, exit_code:
$exit_code
"
fi
fi
...
...
L1/dockerfiles/csst-msc-l1-qc0/run.sh
View file @
dfa0f57e
...
@@ -28,8 +28,18 @@ fi
...
@@ -28,8 +28,18 @@ fi
rm
-rf
/pipeline/input/
*
/pipeline/output/
*
rm
-rf
/pipeline/input/
*
/pipeline/output/
*
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
if
[
$exit_code
-eq
0
]
;
then
if
[
$exit_code
-eq
0
]
;
then
scalebox task add
$1
scalebox task add
--header
dag_run_id
=
${
dag_run_id
}
"
$1
"
echo
"finish qc0, start sink-job."
echo
"finish qc0, start sink-job."
else
else
echo
"finish qc0, exit_code:
$exit_code
"
echo
"finish qc0, exit_code:
$exit_code
"
...
...
L1/dockerfiles/redis-cli/Dockerfile
View file @
dfa0f57e
...
@@ -16,4 +16,4 @@ COPY --from=hub.cstcloud.cn/scalebox/agent /usr/local /usr/local
...
@@ -16,4 +16,4 @@ COPY --from=hub.cstcloud.cn/scalebox/agent /usr/local /usr/local
COPY
*.sh /app/bin/
COPY
*.sh /app/bin/
RUN
chmod
+x /app/bin/
*
.sh
RUN
chmod
+x /app/bin/
*
.sh
CMD
run.sh
CMD
/app/bin/
run.sh
L1/dockerfiles/redis-cli/Makefile
View file @
dfa0f57e
...
@@ -9,8 +9,8 @@ dist:
...
@@ -9,8 +9,8 @@ dist:
push
:
push
:
docker push
$(IMAGE_NAME)
docker push
$(IMAGE_NAME)
run-bash
:
run-bash
:
docker run
-it
--entrypoint
bash
-e
GRPC_SERVER
=
10.3.10.28
-v
${PWD}
/config:/config
$(IMAGE_NAME)
docker run
-it
--entrypoint
bash
-e
PGHOST
=
10.3.10.28:9090
-e
GRPC_SERVER
=
10.3.10.28
-v
${PWD}
/config:/config
$(IMAGE_NAME)
run
:
run
:
docker run
-d
-
-entrypoint
-e
GRPC_SERVER
=
10.3.10.28
-v
${PWD}
/config:/config
$(IMAGE_NAME)
docker run
-d
-
e
PGHOST
=
10.3.10.28:9090
-e
GRPC_SERVER
=
10.3.10.28
-v
${PWD}
/config:/config
$(IMAGE_NAME)
down
:
down
:
docker stop
$(IMAGE_NAME)
docker stop
$(IMAGE_NAME)
L1/dockerfiles/redis-cli/config/appconfig.txt
View file @
dfa0f57e
202411111841239406 9
csst-msc-l1-mbi 9
\ No newline at end of file
\ No newline at end of file
L1/dockerfiles/redis-cli/run.sh
View file @
dfa0f57e
...
@@ -5,34 +5,35 @@
...
@@ -5,34 +5,35 @@
while
true
while
true
do
do
# obsid=$(redis-cli -h ${REDIS_SERVER} -p ${REDIS_PORT} rpop single-image-reduction:obsid)
# obsid=$(redis-cli -h ${REDIS_SERVER} -p ${REDIS_PORT} rpop single-image-reduction:obsid)
#
msg=$(redis-cli -h ${REDIS_SERVER} -p ${REDIS_PORT} -a ${REDIS_PWD} rpop csst_data_list)
msg
=
$(
redis-cli
-h
${
REDIS_SERVER
}
-p
${
REDIS_PORT
}
-a
${
REDIS_PWD
}
rpop csst_data_list
)
msg
=
$(
redis-cli
-h
10.3.10.28
-a
123456 lpop csst_data_list_zxl
)
#
msg=$(redis-cli -h 10.3.10.28 -a 123456 lpop csst_data_list_zxl)
#redis-cli -h 10.3.10.28 -p 26379 -a "csst__2025" rpop csst_data_list
#redis-cli -h 10.3.10.28 -p 26379 -a "csst__2025" rpop csst_data_list
echo
"msg : "
$msg
echo
"msg : "
$msg
if
[
-z
"
$msg
"
]
;
then
if
[
-z
"
$msg
"
]
;
then
echo
"msg is empty"
echo
"msg is empty"
exit
102
code
=
102
else
else
echo
"msg is not empty"
$msg
echo
"msg is not empty"
$msg
# 提取dag_id 模块名
# 提取dag_id 对应app_id
app_name
=
$(
echo
"
$msg
"
| jq
-r
'.dag_id'
)
dag_id
=
$(
echo
"
$msg
"
| jq
-r
'.dag_id'
)
echo
"app_name : "
$app_name
echo
"dag_id : "
$dag_id
#检索dag_id与app_id对应关系的配置文件appconfig.txt
# 提取dag_run_id 对应app_id
app_id
=
$(
awk
-v
key
=
"
$dag_id
"
'$1 == key {print $2}'
/config/appconfig.txt
)
dag_run_id
=
$(
echo
"
$msg
"
| jq
-r
'.parameters.dag_run_id'
)
echo
"dag_run_id : "
$dag_run_id
#检索dag_run_id与app_id对应关系的配置文件appconfig.txt
app_id
=
$(
awk
-v
key
=
"
$dag_run_id
"
'$1 == key {print $2}'
/config/appconfig.txt
)
# 检查是否找到app_id
# 检查是否找到app_id
if
[
-n
"
$app_id
"
]
;
then
if
[
-n
"
$app_id
"
]
;
then
echo
"The appid for
$dag_
run_
id
is
$app_id
"
echo
"The appid for
$dag_id
is
$app_id
"
else
else
echo
"
$dag_run_id
not found in appconfig.txt"
echo
"
$dag_id
not found in appconfig.txt"
exit
103
code
=
103
# exit 103
fi
fi
# 提取dag_run_id
dag_run_id
=
$(
echo
"
$msg
"
| jq
-r
'.parameters.dag_run_id'
)
echo
"dag_run_id : "
$dag_run_id
# 提取obsid
# 提取obsid
obsid
=
$(
echo
"
$msg
"
| jq
-r
'.parameters.message.obsid'
)
obsid
=
$(
echo
"
$msg
"
| jq
-r
'.parameters.message.obsid'
)
echo
"obsid :"
$obsid
echo
"obsid :"
$obsid
...
@@ -47,12 +48,9 @@ do
...
@@ -47,12 +48,9 @@ do
#send-message $obsid
#send-message $obsid
job_name
=
"message-router-csst"
job_name
=
"message-router-csst"
scalebox task add
--app-id
${
app_id
}
--sink-job
${
job_name
}
${
message
}
scalebox task add
--app-id
${
app_id
}
--header
dag_run_id
=
${
dag_run_id
}
--sink-job
${
job_name
}
${
message
}
code
=
$?
code
=
$?
#code值不为0时,退出
if
[
$code
-ne
0
]
;
then
exit
$code
fi
fi
fi
echo
$code
echo
$code
done
done
\ No newline at end of file
L1/pipelines/csst-msc-l1-mbi/app.yaml
View file @
dfa0f57e
...
@@ -63,7 +63,7 @@ jobs:
...
@@ -63,7 +63,7 @@ jobs:
sink_vjobs
:
sink_vjobs
:
-
csst-msc-l1-mbi
-
csst-msc-l1-mbi
hosts
:
hosts
:
-
h0:1
-
h0:1
csst-msc-l1-mbi
:
csst-msc-l1-mbi
:
label
:
多色成像
label
:
多色成像
base_image
:
cnic/csst-msc-l1-mbi
base_image
:
cnic/csst-msc-l1-mbi
...
@@ -95,8 +95,8 @@ jobs:
...
@@ -95,8 +95,8 @@ jobs:
sink_vjobs
:
sink_vjobs
:
-
csst-msc-l1-mbi-photmix
-
csst-msc-l1-mbi-photmix
hosts
:
hosts
:
-
h0:1
#
- h0:1
0
#
- c0:
1
0
-
c0:
2
0
# - c1:1
# - c1:1
# - c2:1
# - c2:1
csst-msc-l1-mbi-photmix
:
csst-msc-l1-mbi-photmix
:
...
@@ -128,7 +128,7 @@ jobs:
...
@@ -128,7 +128,7 @@ jobs:
-
${CSST_AST_TEMP}:/pipeline/temp
-
${CSST_AST_TEMP}:/pipeline/temp
# command: docker run -d --network=host %ENVS% %VOLUMES% %IMAGE%
# command: docker run -d --network=host %ENVS% %VOLUMES% %IMAGE%
hosts
:
hosts
:
-
h0:1
-
h0:1
0
# - c0:10
# - c0:10
# - c1:1
# - c1:1
# - c2:1
# - c2:1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment