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
535fdba5
Commit
535fdba5
authored
Jul 18, 2025
by
Zhang Xiaoli
Browse files
星冕仪和星冕仪QC0模块测试通过。
parent
ec34ec22
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
207 additions
and
17 deletions
+207
-17
L1/dockerfiles/csst-cpic-l1-qc0/Dockerfile
L1/dockerfiles/csst-cpic-l1-qc0/Dockerfile
+15
-0
L1/dockerfiles/csst-cpic-l1-qc0/Makefile
L1/dockerfiles/csst-cpic-l1-qc0/Makefile
+21
-0
L1/dockerfiles/csst-cpic-l1-qc0/run.sh
L1/dockerfiles/csst-cpic-l1-qc0/run.sh
+46
-0
L1/dockerfiles/csst-cpic-l1-qc0/test/Makefile
L1/dockerfiles/csst-cpic-l1-qc0/test/Makefile
+16
-0
L1/dockerfiles/csst-cpic-l1-qc0/test/add_task.sh
L1/dockerfiles/csst-cpic-l1-qc0/test/add_task.sh
+16
-0
L1/dockerfiles/csst-cpic-l1-qc0/test/app.yaml
L1/dockerfiles/csst-cpic-l1-qc0/test/app.yaml
+42
-0
L1/dockerfiles/csst-cpic-l1/Dockerfile
L1/dockerfiles/csst-cpic-l1/Dockerfile
+9
-4
L1/dockerfiles/csst-cpic-l1/Makefile
L1/dockerfiles/csst-cpic-l1/Makefile
+7
-7
L1/dockerfiles/csst-cpic-l1/run.sh
L1/dockerfiles/csst-cpic-l1/run.sh
+35
-6
No files found.
L1/dockerfiles/csst-cpic-l1-qc0/Dockerfile
0 → 100644
View file @
535fdba5
FROM
csu-harbor.csst.nao:10443/csst/csst-cpic-l1-qc0:latest
USER
root
COPY
run.sh /app/bin/
RUN
chmod
+x /app/bin/run.sh
COPY
--from=hub.cstcloud.cn/scalebox/agent /usr/local /usr/local
RUN
mkdir
/work/
RUN
chown
-R
csst:csst /work
RUN
chown
-R
csst:csst /pipeline
WORKDIR
/work/
USER
csst
ENTRYPOINT
["goagent"]
L1/dockerfiles/csst-cpic-l1-qc0/Makefile
0 → 100644
View file @
535fdba5
IMAGE_NAME
:=
cnic/csst-cpic-l1-qc0
IMAGE_PATH
:=
/nfs/tmp/scalebox-images
build
:
docker pull csu-harbor.csst.nao:10443/csst/csst-cpic-l1-qc0
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)/cpic-l1-qc0.tar
ssh
sc1
docker
load
-i
$(IMAGE_PATH)/cpic-l1-qc0.tar
ssh
sc2
docker
load
-i
$(IMAGE_PATH)/cpic-l1-qc0.tar
ssh
sc3
docker
load
-i
$(IMAGE_PATH)/cpic-l1-qc0.tar
push
:
docker push
$(IMAGE_NAME)
run
:
docker run
-it
--entrypoint
bash
$(IMAGE_NAME)
down
:
docker stop
$(IMAGE_NAME)
scp
:
scp
-r
./ csst-csu:/root/csst/csst-cpic-l1/
\ No newline at end of file
L1/dockerfiles/csst-cpic-l1-qc0/run.sh
0 → 100644
View file @
535fdba5
#!/bin/bash
message
=
$1
echo
"message: "
$message
cd
/pipeline/output/
python /pipeline/app/run.py
$message
exit_code
=
$?
echo
"=====pipeline.log===="
>
/work/custom-out.txt
cat
/pipeline/output/pipeline.log
>>
/work/custom-out.txt
echo
"======module.log======"
>>
/work/custom-out.txt
cat
/pipeline/output/module.log|tail
-n
100
>>
/work/custom-out.txt
timefile
=
/pipeline/output/timestamp.txt
if
test
-f
"
$timefile
"
;
then
echo
"
$timefile
exist"
mv
/pipeline/output/timestamp.txt /work/timestamps.txt
fi
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
echo
"dag_run_id:
$dag_run_id
"
>>
/work/extra-attributes.txt
if
[
$exit_code
-eq
0
]
;
then
# scalebox task add --header dag_run_id=${dag_run_id} --header repeatable=yes --upsert ${message}
echo
"finish cpic-l1-qc0."
else
echo
"finish cpic-l1-qc0, exit_code:
$exit_code
"
fi
exit
$exit_code
L1/dockerfiles/csst-cpic-l1-qc0/test/Makefile
0 → 100644
View file @
535fdba5
CLUSTER
=
csst
all
:
reset build
run
:
scalebox app create
--env-file
zjs.env
reset
:
cd
${HOME}
/docker-scalebox/clusters/
$(CLUSTER)
&&
make
&&
cd
-
down
:
make
-C
${HOME}
/docker-scalebox/clusters/
$(CLUSTER)
down
list
:
make
-C
${HOME}
/docker-scalebox/clusters/
$(CLUSTER)
list
L1/dockerfiles/csst-cpic-l1-qc0/test/add_task.sh
0 → 100644
View file @
535fdba5
#!/bin/bash
POSTGRES_USER
=
scalebox
POSTGRES_HOST
=
localhost
POSTGRES_DB
=
scalebox
PGPORT
=
5432
job_id
=
$1
for
m
in
{
41000000101..41000000104
}
;
do
echo
$m
docker
exec
-t
database psql
-U
${
POSTGRES_USER
}
-h
${
POSTGRES_HOST
}
-d
${
POSTGRES_DB
}
-p
${
PGPORT
}
\
-c
"INSERT INTO t_task(job,key_message) VALUES(
${
job_id
}
,'
${
m
}
')"
done
L1/dockerfiles/csst-cpic-l1-qc0/test/app.yaml
0 → 100644
View file @
535fdba5
name
:
cpic-l1.app.process
label
:
星冕仪
comment
:
精测模块星冕仪一级流水线
cluster
:
csst
parameters
:
initial_status
:
RUNNING
jobs
:
cpic-l1
:
label
:
星冕仪
base_image
:
cnic/csst-cpic-l1
schedule_mode
:
HEAD
variables
:
always_running
:
yes
reserved_on_exit
:
yes
output_text_size
:
100000
text_tranc_mode
:
TAIL
locale_mode
:
NONE
parameters
:
# start_message: 41000000101
key_group_regex
:
^(.{6})(.{3})$
key_group_seq
:
1,2
environments
:
-
CSST_DFS_API_MODE=${CSST_DFS_API_MODE}
-
CSST_DFS_GATEWAY=${CSST_DFS_GATEWAY}
-
CSST_DFS_APP_ID=${CSST_DFS_APP_ID}
-
CSST_DFS_APP_TOKEN=${CSST_DFS_APP_TOKEN}
-
CRDS_SERVER_URL=${CRDS_SERVER_URL}
paths
:
-
${CSST_AUX_DIR}:/pipeline/aux
-
${CSST_DFS_ROOT}:/dfsroot
-
${CSST_CRDS_REF}:/crdsref
# command: docker run -d --network=host %ENVS% %VOLUMES% %IMAGE%
# sink_jobs:
# hosts:
# - h0:1
# - c0:1
# - c1:1
# - c2:1
L1/dockerfiles/csst-cpic-l1/Dockerfile
View file @
535fdba5
FROM
csst/csst-cpic-l1:latest
FROM
csu-harbor.csst.nao:10443/
csst/csst-cpic-l1:latest
USER
root
COPY
run.sh /app/bin/
RUN
chmod
+x /app/bin/run.sh
COPY
--from=hub.cstcloud.cn/scalebox/
base
/usr/local
/sbin
/usr/local
/sbin
COPY
--from=hub.cstcloud.cn/scalebox/
agent
/usr/local /usr/local
RUN
mkdir
/work/
RUN
chown
-R
csst:csst /work
RUN
chown
-R
csst:csst /pipeline
WORKDIR
/work/
USER
csst
ENTRYPOINT
["goagent"]
L1/dockerfiles/csst-cpic-l1/Makefile
View file @
535fdba5
IMAGE_NAME
:=
cnic/csst-cpic-l1
IMAGE_PATH
:=
/
sharewcl
/t
e
mp
IMAGE_PATH
:=
/
nfs
/tmp
/scalebox-images
build
:
docker pull csu-harbor.csst.nao:10443/csst/csst-cpic-l1
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)/cpic-l1.tar
ssh
c0
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
c1
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
c2
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
n0
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
n1
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
sc1
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
sc2
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
ssh
sc3
docker
load
-i
$(IMAGE_PATH)/cpic-l1.tar
push
:
docker push
$(IMAGE_NAME)
run
:
...
...
@@ -18,4 +18,4 @@ run:
down
:
docker stop
$(IMAGE_NAME)
scp
:
scp
-r
./ csst-zjs:/root/csst/csst-cpic-l1/
\ No newline at end of file
scp
-r
./ csst-csu:/root/csst/csst-cpic-l1/
\ No newline at end of file
L1/dockerfiles/csst-cpic-l1/run.sh
View file @
535fdba5
#!/bin/bash
# obsid 41000000101 - 41000000104
obsid
=
$1
python /pipeline/src/run.py
$obsid
message
=
$1
echo
"message: "
$message
cd
/pipeline/output/
python /pipeline/app/run.py
$message
exit_code
=
$?
timefile
=
/pipeline/output/timestamps.txt
echo
"=====pipeline.log===="
>
/work/custom-out.txt
cat
/pipeline/output/pipeline.log
>>
/work/custom-out.txt
echo
"======module.log======"
>>
/work/custom-out.txt
cat
/pipeline/output/module.log|tail
-n
100
>>
/work/custom-out.txt
timefile
=
/pipeline/output/timestamp.txt
if
test
-f
"
$timefile
"
;
then
echo
"
$timefile
exist"
mv
/pipeline/output/timestamp
s
.txt /work/timestamps.txt
mv
/pipeline/output/timestamp.txt /work/timestamps.txt
fi
rm
-rf
/pipeline/input/
*
/pipeline/output/
*
echo
finish cpic.
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
if
[
$exit_code
-eq
0
]
;
then
# scalebox task add --header dag_run_id=${dag_run_id} --header repeatable=yes --upsert ${message}
echo
"finish cpic."
exit
$exit_code
else
echo
"finish cpic, exit_code:
$exit_code
"
fi
exit
$exit_code
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