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

Fixes #29 changed IN-CORE Dataset DAO and FileStorage implementation with latest API #30

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

navarroc
Copy link
Collaborator

Updated IN-CORE Dataset DAO and FileStorage with the latest Data service API

@@ -369,11 +376,11 @@ public void execute(File cwd) throws AbortException, FailedException {
ds.setTitle(step.getTool().getOutput(impl.getCaptureStdOut()).getTitle());
ds.setCreator(execution.getCreator());

ds = datasetDao.save(ds);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For external file storage like IN-CORE where the dataset is created and then files are attached in a separate operation, we need to save the dataset first. Otherwise, the dataset won't exist yet and file storage will fail.

String bearerToken = null;
try {
String userHome = System.getProperty("user.home");
byte[] encoded = Files.readAllBytes(Paths.get(userHome + "/.incore/.a0309ff368531845cbeef9a617fcf11361da600ec8cc1467b2a579cb52890f85_token"));
Copy link
Member

Choose a reason for hiding this comment

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

will this file always exist? Would it make sense to see if there is a file in ~/.incore that ends with _token?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right, it may not exist if the user didn't log into the server, let me fix that. I can also make this more generalized if I use the same method pyincore uses to create the token name. pyincore takes the sha 256 of the server URL and use that to create the token name in the ".incore" folder. Since the user needs to set the server URL as a parameter in datawolf.properties if I they are using the IN-CORE file storage, I can look for the file with the 256 sha of that name.

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.

Update IN-CORE file storage and dataset dao for latest data service API
2 participants