Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-cicd
csst-dag
Commits
4908426d
Commit
4908426d
authored
May 03, 2025
by
BO ZHANG
🏀
Browse files
refactor dfs
parent
a625f967
Changes
2
Show whitespace changes
Inline
Side-by-side
csst_dag/dfs.py
→
csst_dag/dfs
/__init__
.py
View file @
4908426d
...
...
@@ -5,7 +5,7 @@ from csst_dfs_client import plan, level0
from
astropy.table
import
Table
import
socket
CONFIG
=
toml
.
load
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"config"
,
"config.toml"
))
CONFIG
=
toml
.
load
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"config.toml"
))
def
check_port
(
ip
,
port
,
timeout
=
3
):
...
...
@@ -34,10 +34,9 @@ def check_port(ip, port, timeout=3):
class
DFS
:
def
__init__
(
self
,
location
=
None
):
# try each location
print
(
"Test all locations
:
"
,
end
=
""
)
print
(
"Test all locations
...
"
,
end
=
""
)
status_list
=
[]
for
loc
in
CONFIG
.
keys
():
print
(
f
"
{
loc
}
..."
,
end
=
""
)
dfs_ip
=
CONFIG
[
loc
][
"dfs"
][
"CSST_DFS_GATEWAY"
].
split
(
":"
)[
0
]
dfs_port
=
int
(
CONFIG
[
loc
][
"dfs"
][
"CSST_DFS_GATEWAY"
].
split
(
":"
)[
1
])
redis_ip
=
CONFIG
[
loc
][
"redis"
][
"host"
]
...
...
@@ -55,7 +54,7 @@ class DFS:
print
(
"Done!
\n
"
)
status_table
=
Table
(
status_list
)
print
(
status_table
)
print
(
"
\n
"
)
if
status_table
[
"status"
].
sum
()
==
0
:
raise
ValueError
(
"No DFS location is available"
)
elif
status_table
[
"status"
].
sum
()
>
1
:
...
...
csst_dag/
config
/config.toml
→
csst_dag/
dfs
/config.toml
View file @
4908426d
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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