Prevent task failures by checking for missing SSH keys before launch on Userkey Data Providers#1598
Prevent task failures by checking for missing SSH keys before launch on Userkey Data Providers#1598RafsanNeloy wants to merge 11 commits intoaces:devfrom
Conversation
|
@natacha-beck as per your comment (#1597 (comment)) I have made a PR in |
|
thanks, please rebase it on dev, to make review and merge easier |
|
@MontrealSergiy can you please suggest me how to rebase it. I saw that |
|
Yes the problem is that you PR contain commits from master which are not yet in dev. If you are not familiar with git, I think the easiest workaround is to 1) branch out the feature branch from dev 2) copy paste your new code and 3) forcibly overwrite the present branch. However there is a chance that some error happens during the copying, so the proper recommended way is to rebase. If you feel up to the challenge check a good tutorial on git git rebase might be not most straightforward command. Therefore many developers cheat and use cherry-picking, patching and/or GUI tools instead. I believe RubyMine IDE might allow one to drop commits in GUI though I never tried it myself. UPDATED: I am sorry I just tried RubyMine commit delete, unfortunately it only work in only in the simpler cases, do not use it |
|
Sorry do not use RubyMine to drop commits from history log. Unfortunately GUI commits drops do not always work well. Otherwise most of times this IDE is friendly and reliable |
|
I wonder did you test your PR? |
|
BTW I synced the dev to master. Unfortunately it does not affect the pr change list on github immediately, perhaps, due to some caching on github side. Hopefully you would not need to rebase |
Our SSH key check at line 275 is never reached, as I'm testing in local environment. I tested the fix locally by creating a |
|
It's a good feature but there is a problem with it. A user's SSH key is never missing on a portal, so the check will never report that the key is not available. What we need is a check on whether or not the owner of the data provider has pushed their key to a Bourreau, which is typically a distinct, remote system. Currently, the way CBRAIN records whether or not a key has been pushed is through a clumsy MetaData registry (to check on bourreau 1234, we fetch a date from |
|
I think in fact, we should have a more general mechanism to verify that a given file on a given data provider will be able to be fetched from a bourreau, and the verification mechanism would provide an explanation if not. That way we could make checks not just for user SSH keys, but for other situations, such as a DP that is not allowed to be synced to a particular bourreau. So I think maybe what we would need is new general methods on the DPs that can be overloaded in subclasses, called something like: in the case of a UserKeySshDataProvider, the method would call super and also check that the user's SSH key was pushed on the bourreau. |
Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
|
Implemented the userfile_syncing_issue hook to prevent task failures by preemptively checking if a user's SSH key is pushed to the remote Bourreau before launch. If it's missing, it now gracefully blocks the task and alerts the user. |
|
I'm closing this PR as it contains way too much code for what it should be. I made the changes myself that implements the feature. See my three commits here:
|

Currently, tasks using
UserkeyFlatDirSshDataProviderfail on the cluster with a cryptic RuntimeError if the user hasn't pushed their SSH key locally. This PR adds early validation in TasksController : it shows a clear warning on the task form (directing users to the SSH Panel in "My Account") and adds a hard block on submission if the key is still missing, preventing wasted resources and blocked synchronization.Closes #1562