-
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 #80 from EOSC-synergy/release/1.4.0
Release/1.4.0
- Loading branch information
Showing
4 changed files
with
162 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM ubuntu:20.04 | ||
|
||
MAINTAINER Fernando Aguilar "[email protected]" | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y curl python3-pip python3-dev git vim lsof | ||
|
||
RUN ls | ||
RUN git clone https://github.com/EOSC-synergy/FAIR_eva.git | ||
|
||
WORKDIR /FAIR_eva | ||
|
||
RUN pip3 install -r requirements.txt | ||
|
||
EXPOSE 5000 9090 | ||
RUN ls | ||
RUN cp config.ini.template config.ini | ||
RUN cd /FAIR_eva | ||
RUN chmod 777 start.sh | ||
RUN cat start.sh | ||
COPY fair-eva.py /usr/bin | ||
RUN chmod +x /usr/bin/fair-eva.py | ||
ENV CONFIG_FILE=/FAIR_eva/config.ini | ||
CMD ["/FAIR_eva/start.sh", "/FAIR_eva/config.ini"] |
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,54 @@ | ||
#!/usr/bin/python3 | ||
|
||
import argparse | ||
import json | ||
import requests | ||
from pathlib import Path | ||
|
||
|
||
def get_input_args(): | ||
parser = argparse.ArgumentParser(description=( | ||
'Prepare requests for FAIR assessment tool' | ||
)) | ||
parser.add_argument( | ||
'-ID', | ||
metavar='ID', | ||
type=str, | ||
help='Persistent Identifier' | ||
) | ||
parser.add_argument( | ||
'-R', | ||
metavar='PLUGIN', | ||
type=str, | ||
help='HTTP method' | ||
) | ||
parser.add_argument( | ||
'-B', | ||
metavar='OAI-PMH', | ||
type=str, | ||
help='OAI-PMH_ENDPOINT' | ||
) | ||
parser.add_argument( | ||
'--tool_endpoint', | ||
metavar='ENDPOINT', | ||
type=str, | ||
help='Enpoint to perform HTTP request. Example: http://localhost:9090/v1.0/rda/rda_all' | ||
) | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def main(): | ||
args = get_input_args() | ||
url = args.tool_endpoint | ||
headers = {'Content-Type':'application/json'} | ||
data = { | ||
"id": args.ID, | ||
"repo": args.R, | ||
"oai_base": args.B, | ||
"lang": "ES" | ||
} | ||
r = requests.post(url,data=json.dumps(data), headers=headers) | ||
return json.dumps(r.text) | ||
|
||
print(main()) |
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