Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File installation via rsync and install target installation added #3796

Merged
merged 31 commits into from
Oct 4, 2020

Conversation

datamel
Copy link
Contributor

@datamel datamel commented Aug 31, 2020

Install by target

Remote installation is now on a per install target rather than a per platform basis. Targets can be configured in the global.cylc e.g.

[platforms]
    [[<platform name>]]
        install target = localhost
  • Remote initialisation is skipped where installed target is local.
  • Remote inititalisation returns REMOTE_INIT_FAILED where a key for a different target is found on the remote.
  • If a key for the correct target is found, it refreshes the keys. This was to prevent a situation where you could not run an existing suite that was cancelled inelegantly e.g. ctrl-c.

Existing keys are identified by filename (where the install target is now added to it). The initial implementation was through the key metadata. However, it turns out that metadata goes in the secret key only and not the public key.

There is now no mechanism for checking for a shared file system because uuid file has been removed. This now has to be configured in global.cylc.

Notes on call to task_remote_mgr.remote_init(...)

Previously, platform name was being sent to remote_init and then a skeleton platform dictionary was generated from that. We're now sending a complete dictionary rather than regenerating.

In restart_remote_init we were using a set to pick distinct platforms. As platform is a dictionary and not an object (where we could add a hash), the method is reworked to create a list of platforms filtered as distinct install targets

File install via Rsync

File installation is now via rsync. Files to be installed are configurable in the flow.cylc file (translated to rsync include and filter rules).

File install is still a push but happens after remote initialisation in the callback because we need to know whether or not the file install is required before we push files across.

Add files to the rsunc in the flow.cylc:

[scheduler]
    includes = dir/, dir2/, file1, file2

This currently supports top level directories and files - I have also added validation for this feature.

Rsync Logging

New RSYNC_LOG log which will be created in the suite log directory. Any errors from the file installation will appear in the suite log.

These changes close #3687

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase). - I'll tidy branch after feedback.
  • Does not contain off-topic changes (use other PRs for other changes).
  • Appropriate tests are included (unit and/or functional).
  • Existing tests also adapted.
  • Appropriate change log will be completed after feedback
  • (master branch) I will open a documentation PR at cylc/cylc-doc.
  • No dependency changes.

@datamel datamel added this to the cylc-8.0a3 milestone Aug 31, 2020
@datamel datamel self-assigned this Aug 31, 2020
@datamel
Copy link
Contributor Author

datamel commented Aug 31, 2020

Note, I will do a read through/double check doc strings and fix a broken functional test that I have written (tests/f/remote/03-install-target.t)

cylc/flow/remote.py Outdated Show resolved Hide resolved
cylc/flow/suite_files.py Outdated Show resolved Hide resolved
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some RST formatting comments...

cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/platforms.py Outdated Show resolved Hide resolved
cylc/flow/remote.py Outdated Show resolved Hide resolved
cylc/flow/remote.py Show resolved Hide resolved
cylc/flow/scheduler.py Show resolved Hide resolved
cylc/flow/scheduler.py Outdated Show resolved Hide resolved
@datamel datamel force-pushed the rsync_file_install_with_platform branch from 3790acf to ac029d0 Compare September 8, 2020 11:26
@datamel datamel force-pushed the rsync_file_install_with_platform branch 2 times, most recently from 3f57dce to 45e3263 Compare September 16, 2020 13:17
@datamel datamel force-pushed the rsync_file_install_with_platform branch from 45e3263 to a0f0d1b Compare September 21, 2020 09:55
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished code review, some minor comments:

cylc/flow/cfgspec/globalcfg.py Outdated Show resolved Hide resolved
cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/config.py Outdated Show resolved Hide resolved
cylc/flow/remote.py Outdated Show resolved Hide resolved
cylc/flow/remote.py Outdated Show resolved Hide resolved
@datamel datamel force-pushed the rsync_file_install_with_platform branch from 3e42882 to 6f73a25 Compare September 22, 2020 11:59
@oliver-sanders
Copy link
Member

The new logging is working fine, logs roll over when the suite restarts.

One small niggle is that the log files are created a few seconds apart so their timestamps don't match but we can address that later on.

$ ls -1tr log/suite/
file-installation-log.20200923T112819+01
log.20200923T112811+01
log
file-installation-log
file-installation-log.20200923T113034+01
log.20200923T113027+01

@datamel datamel force-pushed the rsync_file_install_with_platform branch from dc05f4c to c3e47ba Compare September 23, 2020 12:27
@datamel
Copy link
Contributor Author

datamel commented Sep 23, 2020

One small niggle is that the log files are created a few seconds apart so their timestamps don't match but we can address that later on.

$ ls -1tr log/suite/
file-installation-log.20200923T112819+01
log.20200923T112811+01
log
file-installation-log
file-installation-log.20200923T113034+01
log.20200923T113027+01

Yes, that is a bit of a niggle. I guess it would be nicer for the suite log and the file-installation-log timestamps to match. I can put an issue up and assign myself so it doesn't hold this up if you like?

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests pass for me (with the cylc version diff I sent you), looks good, works as expected.

Few more comments which could be addressed on this PR if time permits but which needn't delay merge.

cylc/flow/scheduler.py Outdated Show resolved Hide resolved
cylc/flow/task_remote_mgr.py Show resolved Hide resolved
tests/functional/cylc-ping/05-check-keys-sharedfs.t Outdated Show resolved Hide resolved
tests/functional/remote/01-basic-file-install.t Outdated Show resolved Hide resolved
tests/functional/remote/02-file-install-configured.t Outdated Show resolved Hide resolved
tests/functional/remote/02-file-install-configured.t Outdated Show resolved Hide resolved
Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of minor comments and suggestions, but generally looking great 🎉

cylc/flow/cfgspec/suite.py Outdated Show resolved Hide resolved
cylc/flow/config.py Outdated Show resolved Hide resolved
cylc/flow/config.py Outdated Show resolved Hide resolved
cylc/flow/config.py Outdated Show resolved Hide resolved
cylc/flow/hostuserutil.py Outdated Show resolved Hide resolved
cylc/flow/scheduler.py Outdated Show resolved Hide resolved
cylc/flow/scheduler.py Show resolved Hide resolved
cylc/flow/task_remote_mgr.py Outdated Show resolved Hide resolved
cylc/flow/task_remote_mgr.py Show resolved Hide resolved
tests/functional/remote/02-file-install-configured.t Outdated Show resolved Hide resolved
@datamel datamel mentioned this pull request Sep 25, 2020
@wxtim
Copy link
Member

wxtim commented Sep 28, 2020

The conflicting files

 tests/functional/validate/71-platform-basic.t
tests/functional/validate/72-host-to-platform-upgrade.t 

have been moved to tests/functional/platforms by me in the meantime, so the rebase should be easy, just delete to match master. :)

@datamel
Copy link
Contributor Author

datamel commented Sep 28, 2020

Thanks @wxtim!

@datamel datamel force-pushed the rsync_file_install_with_platform branch from c279af4 to cb56b54 Compare September 29, 2020 12:48
@datamel datamel force-pushed the rsync_file_install_with_platform branch from 1e805fc to 71d47ea Compare October 1, 2020 09:02
Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 nice work @datamel

@hjoliver hjoliver merged commit 7497ae4 into cylc:master Oct 4, 2020
@hjoliver hjoliver modified the milestones: cylc-8.0a3, cylc-8.0b0 Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

platforms: suite installation on remote platforms
5 participants