FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ews-coordinator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gilligan Lab for Epidemiology and Modelling
Wheat rusts
ews-coordinator
Commits
9c66f520
Commit
9c66f520
authored
1 year ago
by
L. Bower
Browse files
Options
Downloads
Patches
Plain Diff
making the tar file check use python when running locally, so can be run on windows machines
parent
93f1fb2f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
coordinator/ProcessorServer.py
+15
-9
15 additions, 9 deletions
coordinator/ProcessorServer.py
with
15 additions
and
9 deletions
coordinator/ProcessorServer.py
+
15
−
9
View file @
9c66f520
...
...
@@ -3,6 +3,8 @@
import
datetime
import
logging
import
os
import
tarfile
from
string
import
Template
from
typing
import
List
...
...
@@ -43,21 +45,25 @@ def process_pre_job_server_download(input_args: dict):
server_name
:
str
=
config
[
'
ServerName
'
]
full_file_path
=
f
"
{
file_path
}
/
{
file_name
}
.tar.gz
"
if
server_name
==
""
:
cmd_check_file
=
[
f
"
test -f
{
full_file_path
}
&& tar -tzf
{
full_file_path
}
> /dev/null
"
]
run_in_shell
:
bool
=
True
"""
check the incoming met data tar exists and is a valid tar file (on either remote or local machine)
"""
if
server_name
==
""
:
# means the file is local
data_is_ready
=
os
.
path
.
exists
(
full_file_path
)
and
tarfile
.
is_tarfile
(
full_file_path
)
else
:
cmd_check_file
=
[
"
ssh
"
,
"
-i
"
,
config
[
'
ServerKey
'
],
"
-o
"
,
"
StrictHostKeyChecking=no
"
,
server_name
,
f
"
test -f
{
full_file_path
}
&& tar -tzf
{
full_file_path
}
>/dev/null
"
]
run_in_shell
:
bool
=
False
description_short
=
'
subprocess_ssh
'
description_long
=
f
"
Checking for existence of
{
file_path
}
/
{
file_name
}
.tar.gz
"
description_short
=
'
subprocess_ssh
'
description_long
=
f
"
Checking for existence of
{
file_path
}
/
{
file_name
}
.tar.gz
"
status
=
subprocess_and_log
(
cmd_check_file
,
description_short
,
description_long
,
check
=
False
,
shell
=
run_in_shell
)
status
=
subprocess_and_log
(
cmd_check_file
,
description_short
,
description_long
,
check
=
False
,
shell
=
run_in_shell
)
data_is_ready
=
status
.
returncode
>
0
if
status
.
returncode
>
0
:
if
not
data_is_ready
:
# a time check in UTC. If it's late, raise warning, if very late, raise error
...
...
@@ -91,7 +97,7 @@ def process_pre_job_server_download(input_args: dict):
logger
.
info
(
message
)
endScript
(
premature
=
True
)
elif
status
.
returncode
==
0
:
elif
not
data_is_ready
:
logger
.
info
(
f
"
Data is available for config
{
i
+
1
}
of
{
len
(
config_paths
)
}
, calculation shall proceed
"
)
return
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment