-
Notifications
You must be signed in to change notification settings - Fork 175
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
Cleanup duplicated data config paths #4314
Cleanup duplicated data config paths #4314
Conversation
SQL/New_patches/2019-02-08_cleanup_duplicated_data_path_in_Config.sql
Outdated
Show resolved
Hide resolved
SQL/0000-00-03-ConfigTables.sql
Outdated
@@ -133,7 +130,7 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, | |||
|
|||
-- Loris-MRI/Imaging Pipeline options from the $profile (commonly "prod") file | |||
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('imaging_pipeline', 'Imaging Pipeline settings', 1, 0, 'Imaging Pipeline', 12); | |||
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'dataDirBasepath', 'Base Path to the data directory of Loris-MRI', 1, 0, 'text', ID, 'Loris-MRI Data Directory', 1 FROM ConfigSettings WHERE Name="imaging_pipeline"; | |||
INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'dataDirBasepath', 'Base Path to the data ' || 'directory of Loris-MRI', 1, 0, 'text', ID, 'Loris-MRI Data Directory', 1 FROM ConfigSettings WHERE Name="Paths"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of this should specify whether this is relative to the imaging server or the web server (and the type will need to be changed once #4023 is merged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the last imaging meeting, we discussed we would only keep one setting so technically this one would work for both. We can bring it up again at the next imaging meeting. I'll add it to the agenda.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it can't work for both imaging pipeline and web server, the paths are different if they're mounted on different places on the different servers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driusan in the next commit I reintegrated the imagePath for the apache server and kept the dataDirBasepath for the LORIS-MRI server. Please re-review
Travis is failing because of exception handling from this PR https://github.com/aces/Loris/pull/4165/files. If the settings there have been deleted, make sure to remove them from the checks. That should satisfy Travis. :) |
@PapillonMcGill Thanks! I fixed your comments |
@johnsaigle I am confused. I have not touched the config settings mentioned in https://github.com/aces/Loris/pull/4165/files so there should not be an issue. I only removed a few path config settings and cannot grep in the code for the old config settings so I am not sure where it gets it from. |
@cmadjar Hm yeah I see your point. That function will catch any ConfigurationException that occurs so maybe there is something else going on? Are you able to access |
I don't see how this is going to work when the web server and imaging pipeline server don't have the same data dir mounted in the same location. Don't we need 2 settings, one relative to each? |
@driusan I did the change you requested and there is indeed two paths remaining: one for the webserver and one for the imaging pipeline. I forgot to update the description of the PR and apparently to add again the |
@cmadjar sorry, I'm still confused.. I'm just looking at the diff in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driusan See my comments directly on 0000-00-03-ConfigTables.sql to answer your question.
@@ -230,7 +226,7 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "Produced by LorisDB" FROM Confi | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, "S3cret" FROM ConfigSettings WHERE Name="JWTKey"; | |||
|
|||
|
|||
INSERT INTO Config (ConfigID, Value) SELECT ID, "/PATH/TO/DATA/location" FROM ConfigSettings cs WHERE cs.Name="Loris-MRI Data Directory"; | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/%PROJECTNAME%/data/" FROM ConfigSettings cs WHERE cs.Name="dataDirBasepath"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@driusan in this line, I modified the default path of dataDirBasepath but I did not add it (the line in red above is for the same config setting)
@@ -187,9 +185,7 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "YMd" FROM ConfigSettings WHERE | |||
|
|||
INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/%PROJECTNAME%/data/" FROM ConfigSettings WHERE Name="imagePath"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imagePath is in this INSERT statement. I did not need to modify the default path in it which is why it does not show up in the diff, but the INSERT statement is still here :)
@driusan @PapillonMcGill Could you approve the PR if you are happy with the changes please? Thank you :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, could you change this to the major branch? It seems like it could introduce complications that should be caught in a LORIS testing round.. other than that it looks good.
removed mincPath and imagePath from get_file.php replaced all instances of imagePath and mincPath by dataDirBasepath in the code missed one instance of mincPath Melanie's feedback reintegrated imagePath to have one path for apache and one for the LORIS-MRI server if ever the paths are different forgot to add again the imagePath to the Config SQL default schema...
413f2cd
to
def9351
Compare
@driusan @PapillonMcGill I rebased the branch to major. Please re-review at your convenience :) |
Brief summary of changes
This PR cleans up all the different paths that are referring to the same path (a.k.a.
/data/%PROJECT%/data/
. This gets rid of the Config settingsmincPath
anddata
and updates the code accordingly.The code changes on the LORIS-MRI front can be found in aces/Loris-MRI#399
This resolves issue...
To test this change...
Caveat for existing projects
Make sure that your Config setting
dataDirBasepath
andimagePath
are configured to the proper data path (typically/data/%PROJECT%/data
). Note thatdataDirBasepath
is the path used by the LORIS-MRI pipelines andimagePath
is the path where the imaging data can be read by the web server.