This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
forked from cylc/cylc-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote-init/tidy: command to init/tidy remotes
New commands to initialise/tidy suite directory hierarchy for remote task runs. Commands now run in the background, and launched on remote hosts as using `cylc.remote` remote run mechanism. (Tick a box in cylc#2302.) Update log and runtime database only before the real submission command.
- Loading branch information
1 parent
36ce9c3
commit dc7a4a1
Showing
9 changed files
with
572 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python | ||
|
||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2017 NIWA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
"""cylc [task] remote-init UUID RUND | ||
(This command is for internal use.) | ||
Install suite service files on a task remote (i.e. a [owner@]host): | ||
* ".service/contact" | ||
* ".service/passphrase" | ||
* ".service/ssl.cert" | ||
Content of items to install from a tar file read from STDIN. | ||
Return 0 on success or if initialisation not required. Return 1 on failure. | ||
Print SuiteSrvFilesManager.REMOTE_INIT_NOT_REQUIRED if initialisation not | ||
required (e.g. remote has shared file system with suite host). | ||
Print SuiteSrvFilesManager.REMOTE_INIT_DONE on success. | ||
""" | ||
|
||
|
||
from cylc.remote import remrun | ||
|
||
|
||
if __name__ == '__main__' and not remrun().execute(): | ||
from cylc.option_parsers import CylcOptionParser as COP | ||
from cylc.task_remote_cmd import remote_init | ||
parser = COP(__doc__, argdoc=[ | ||
('UUID', 'UUID of current suite running process'), | ||
('RUND', 'The run directory of the suite')]) | ||
uuid_str, rund = parser.parse_args()[1] | ||
remote_init(uuid_str, rund) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
# THIS FILE IS PART OF THE CYLC SUITE ENGINE. | ||
# Copyright (C) 2008-2017 NIWA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
"""cylc [task] remote-tidy RUND | ||
(This command is for internal use.) | ||
Remove ".service/contact" from a task remote (i.e. a [owner@]host). | ||
Remove ".service" directory on the remote if emptied. | ||
""" | ||
|
||
|
||
from cylc.remote import remrun | ||
|
||
|
||
if __name__ == '__main__' and not remrun().execute(): | ||
from cylc.option_parsers import CylcOptionParser as COP | ||
from cylc.task_remote_cmd import remote_tidy | ||
parser = COP(__doc__, argdoc=[('RUND', 'The run directory of the suite')]) | ||
remote_tidy(parser.parse_args()[1][0]) # position argument 1, rund |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.