Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExaCT
Rosetta
Commits
9dde89a6
Commit
9dde89a6
authored
4 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in view log function for remote computing manager.
parent
a812b1a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/webapp/code/rosetta/core_app/computing_managers.py
+10
-9
10 additions, 9 deletions
services/webapp/code/rosetta/core_app/computing_managers.py
with
10 additions
and
9 deletions
services/webapp/code/rosetta/core_app/computing_managers.py
+
10
−
9
View file @
9dde89a6
...
@@ -260,19 +260,20 @@ class RemoteComputingManager(ComputingManager):
...
@@ -260,19 +260,20 @@ class RemoteComputingManager(ComputingManager):
def
_get_task_log
(
self
,
task
,
**
kwargs
):
def
_get_task_log
(
self
,
task
,
**
kwargs
):
# Get computing host
host
=
task
.
computing
.
get_conf_param
(
'
host
'
)
# Get user keys
# Get id_rsa
if
task
.
computing
.
require_user_keys
:
if
task
.
computing
.
require_user_keys
:
user_keys
=
Keys
.
objects
.
get
(
user
=
task
.
user
,
default
=
True
)
user_keys
=
Keys
.
objects
.
get
(
user
=
task
.
user
,
default
=
True
)
id_rsa_file
=
user_keys
.
private_key_file
else
:
else
:
raise
NotImplementedError
(
'
Remote with no keys not yet
'
)
raise
NotImplementedError
(
'
Remote tasks not requiring keys are not yet supported
'
)
# Get computing host
host
=
task
.
computing
.
get_conf_param
(
'
master
'
)
user
=
task
.
computing
.
get_conf_param
(
'
user
'
)
# Stop the task remotely
view_log_command
=
'
ssh -i {} -4 -o StrictHostKeyChecking=no {}@{}
\'
/bin/bash -c
"
cat /tmp/{}.log
"
\'
'
.
format
(
user_keys
.
private_key_file
,
user
,
host
,
task
.
uuid
)
# View the Singularity container log
view_log_command
=
'
ssh -i {} -4 -o StrictHostKeyChecking=no {}
\'
/bin/bash -c
"
cat /tmp/{}.log
"
\'
'
.
format
(
id_rsa_file
,
host
,
task
.
uuid
)
logger
.
debug
(
view_log_command
)
out
=
os_shell
(
view_log_command
,
capture
=
True
)
out
=
os_shell
(
view_log_command
,
capture
=
True
)
if
out
.
exit_code
!=
0
:
if
out
.
exit_code
!=
0
:
raise
Exception
(
out
.
stderr
)
raise
Exception
(
out
.
stderr
)
...
...
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