-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #450 from bento-platform/features/documents-result…
…s-ingestion feat: document experiment results ingestion
- Loading branch information
Showing
3 changed files
with
71 additions
and
1 deletion.
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 @@ | ||
version 1.0 | ||
|
||
workflow document { | ||
input { | ||
Array[File] document_files | ||
String run_dir | ||
String drs_url | ||
String project_id | ||
String dataset_id | ||
String secret__access_token | ||
} | ||
|
||
scatter(file in document_files) { | ||
call post_to_drs { | ||
input: | ||
file_path = file, | ||
drs_url = drs_url, | ||
project_id = project_id, | ||
dataset_id = dataset_id, | ||
token = secret__access_token | ||
} | ||
} | ||
|
||
output { | ||
Array[String] drs_responses = post_to_drs.response_message | ||
} | ||
} | ||
|
||
task post_to_drs { | ||
input { | ||
File file_path | ||
String drs_url | ||
String project_id | ||
String dataset_id | ||
String token | ||
} | ||
command { | ||
curl -k -X POST \ | ||
-F "file=@~{file_path}" \ | ||
-F "project_id=~{project_id}" \ | ||
-F "dataset_id=~{dataset_id}" \ | ||
-H "Authorization: Bearer ~{token}" \ | ||
"~{drs_url}/ingest" | ||
} | ||
output { | ||
String response_message = read_string(stdout()) | ||
} | ||
} |
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