-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'publish' into 'master'
- Loading branch information
Showing
93 changed files
with
803 additions
and
608 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
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 @@ | ||
# This file is a template, and might need editing before it works on your project. | ||
# Official framework image. Look for the different tagged releases at: | ||
# https://hub.docker.com/r/library/python | ||
image: python:2.7 | ||
|
||
# Pick zero or more services to be used on all builds. | ||
# Only needed when using a docker container to run your tests in. | ||
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service | ||
# services: | ||
|
||
# This folder is cached between builds | ||
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache | ||
cache: | ||
paths: | ||
- ~/.cache/pip/ | ||
|
||
# This is a basic example for a gem or script which doesn't use | ||
# services such as redis or postgres | ||
before_script: | ||
- python -V # Print out python version for debugging | ||
# Uncomment next line if your Django app needs a JS runtime: | ||
# - apt-get update -q && apt-get install nodejs -yqq | ||
- pip install -r requirements.txt | ||
- pip install coverage==4.5.1 | ||
|
||
# To get Django tests to work you may need to create a settings file using | ||
# the following DATABASES: | ||
# | ||
# DATABASES = { | ||
# 'default': { | ||
# 'ENGINE': 'django.db.backends.postgresql_psycopg2', | ||
# 'NAME': 'ci', | ||
# 'USER': 'postgres', | ||
# 'PASSWORD': 'postgres', | ||
# 'HOST': 'postgres', | ||
# 'PORT': '5432', | ||
# }, | ||
# } | ||
# | ||
# and then adding `--settings app.settings.ci` (or similar) to the test command | ||
|
||
test: | ||
variables: | ||
WAVES_SSH_TEST_SGE_CELL: $WAVES_SSH_TEST_SGE_CELL | ||
WAVES_TEST_SGE_BASE_DIR: $WAVES_TEST_SGE_BASE_DIR | ||
script: | ||
- python manage.py test | ||
- coverage run --source='.' manage.py test waves |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
include LICENSE.md | ||
include README.md | ||
include requirements.txt | ||
recursive-include waves/wcore/static * | ||
recursive-include waves/wcore/templates * | ||
recursive-include waves/front/templates * | ||
recursive-include docs * | ||
recursive-exclude waves_core * | ||
recursive-exclude waves/wcore/migrations * | ||
# recursive-exclude waves/wcore/migrations *. |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -45,4 +45,5 @@ Documentation | |
|
||
waves_dev_doc | ||
api_user_doc | ||
sample_code | ||
|
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,89 @@ | ||
WAVES python samples code | ||
========================= | ||
|
||
|
||
.. note:: | ||
These examples use coreapi package functionalities | ||
see: http://www.coreapi.org/ | ||
|
||
|
||
Interact with services | ||
---------------------- | ||
|
||
.. code-block:: python | ||
from coreapi import Client, auth | ||
from coreapi.codecs import CoreJSONCodec, JSONCodec | ||
decoders = [JSONCodec(), CoreJSONCodec()] | ||
# Create a client client codecs | ||
client = Client(decoders=decoders) | ||
document = client.get('http://waves.demo.atgc-montpellier.fr/waves/api/schema') | ||
# get service list - replace with actual waves-api urls | ||
serviceList = client.action(document, ['services', 'list']) | ||
print(serviceList) | ||
# get service details | ||
serviceDetails = client.action(document, ["services", "read"], params={'service_app_name': 'sample_service'}) | ||
print(serviceDetails['name']) | ||
# get service submissions | ||
submissions = client.action(document, ["services", "submissions_list"], | ||
params={"service_app_name": 'sample_service'}) | ||
# get first submission details | ||
sub_details = client.action(document, ["services", "submission"], | ||
params={"service_app_name": "sample_service", | ||
"submission_app_name": "default"}) | ||
# get inputs / outputs | ||
expected_inputs = sub_details['inputs'] | ||
print(expected_inputs) | ||
expected_outputs = sub_details['outputs'] | ||
print(expected_outputs) | ||
Authenticate with token: | ||
------------------------ | ||
|
||
Some WAVES API entries required to be authenticated (jobs list, job details, job submission) | ||
|
||
.. code-block:: python | ||
client = Client(decoders=decoders, | ||
auth=auth.TokenAuthentication( | ||
token="6241961ef45e4bbe7bb01a05f938ed9f0f2a3926", | ||
scheme="Token")) | ||
document = client.get('http://waves.demo.atgc-montpellier.fr/waves/api/schema') | ||
# list jobs | ||
# get job list | ||
job_list = client.action(document, ['jobs', 'list']) | ||
print("job_list", job_list) | ||
if (len(job_list) > 0): | ||
job_details = client.action(document, ['jobs', 'read'], params={'unique_id': job_list[0]['slug']}) | ||
print(job_details['title']) | ||
print(job_details['created']) | ||
print(job_details['updated']) | ||
Create a job: | ||
------------- | ||
|
||
.. code-block:: python | ||
# submit a job | ||
from coreapi.utils import File | ||
from os.path import join, dirname | ||
with open(join(dirname(__file__), "test.fasta"), 'r') as f: | ||
inputs = { | ||
"text_input": "This is text input", | ||
"input_file": File("test.fasta", f) | ||
} | ||
client.action(document, ["services", "submissions", "jobs", "create"], | ||
params={ | ||
**inputs, | ||
"title": "Job Name", | ||
"service_app_name": "sample_service", | ||
"submission_app_name": "default" | ||
}, validate=False, encoding='multipart/form-data') | ||
job_list = client.action(document, ['jobs', 'list']) | ||
print(job_list) | ||
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
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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
coreapi==2.3.3 | ||
Django~=1.11 | ||
coreapi==2.3.3 | ||
daemons==1.3.0 | ||
django-admin-sortable2==0.6.19 | ||
django-environ==0.4.4 | ||
django-cors-headers==2.2.0 | ||
django-crispy-forms==1.7.2 | ||
django-polymorphic==2.0.2 | ||
djangorestframework==3.7.7 | ||
backports.ssl-match-hostname==3.5.0.1 | ||
git+https://github.com/marcoooo/django-crontab#egg=django_crontab | ||
djangorestframework==3.8.2 | ||
backports.ssl-match-hostname | ||
inflection==0.3.1 | ||
psutil==5.4.0 | ||
psutil==5.4.5 | ||
pycrypto==2.6.1 | ||
python-magic==0.4.13 | ||
saga-python==0.47 | ||
python-magic==0.4.15 | ||
saga-python==0.47.6 | ||
setproctitle==1.1.10 | ||
six==1.11.0 | ||
swapper==1.1.0 |
Oops, something went wrong.