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

Test pairing #155

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
08ae5a0
fix merge conflict
stevekm Jan 22, 2020
9bf2ce7
Merge branch 'develop' into test-pairing
stevekm Jan 28, 2020
d77be1d
add tests for base RoslinQcOperator class
stevekm Jan 29, 2020
563009c
add test to Makefile
stevekm Feb 4, 2020
ce2a2c5
Merge branch 'develop' into roslin-qc
stevekm Feb 4, 2020
0d4dfb9
merge against develop
stevekm Feb 5, 2020
da2449a
update fixture dump script for dumping Run's
stevekm Feb 5, 2020
bd4bf07
start Roslin QC operator and input parsing with tests and fixtures
stevekm Feb 5, 2020
a4816de
merge against develop
stevekm Feb 5, 2020
83bf428
add tests for serializer using output_metadata field
stevekm Feb 11, 2020
b1406d9
merge against develop
stevekm Feb 11, 2020
9e3419b
update demo run methods and input.json template
stevekm Feb 12, 2020
33a8c19
add fixture duplication script
stevekm Feb 15, 2020
6cd29d2
Merge branch 'duplication-script' into roslin-qc
stevekm Feb 15, 2020
d452748
add multiple run handling for roslin qc input, update fixtures and sc…
stevekm Feb 16, 2020
1464afc
merge against develop
stevekm Feb 16, 2020
40f49f6
merge against develop
stevekm Feb 16, 2020
300bea2
add RoslinQCOperator to get by classname for Operator Factory
stevekm Feb 18, 2020
de58404
make Roslin operator data easier to read
stevekm Feb 19, 2020
e9670d1
update Makefile and operator tests
stevekm Feb 19, 2020
30284a2
add roslin qc pipeline fixture
stevekm Feb 19, 2020
84d182a
clean up Roslin operator
stevekm Feb 19, 2020
5eccbf1
add sorting to QC inputs for reproducibility
stevekm Feb 19, 2020
851ad77
update Roslin qc operator and tests
stevekm Feb 19, 2020
cdeb92d
disable bid to cwl conversion since its handled elsewhere
stevekm Feb 20, 2020
40869d4
remove CWL conversion
stevekm Feb 20, 2020
2787baa
refactor job data generation methods
stevekm Feb 24, 2020
0d2bc2b
update Roslin QC operator tests
stevekm Feb 24, 2020
e615bf4
update test for input generation
stevekm Feb 24, 2020
0a7c95a
merge against develop and fix conflicts
stevekm Feb 24, 2020
145fd99
merge against develop
stevekm Feb 25, 2020
39f13c8
merge against roslin-qc
stevekm Feb 25, 2020
c43cc7d
update serializer tests
stevekm Feb 25, 2020
8e70561
merge against roslin-qc
stevekm Feb 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ db*
scripts/*.json
conda*
input.json
scripts/*.json*
*.swp
37 changes: 28 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ check-env:
BEAGLE_AUTH_LDAP_SERVER_URI \
BEAGLE_LIMS_PASSWORD \
BEAGLE_LIMS_USERNAME; do \
[ -z "$$(printenv BEAGLE_LIMS_USERNAME)" ] && echo ">>> env variable $$i is not set; some features may not work" || : ; done
[ -z "$$(printenv $$i)" ] && echo ">>> env variable $$i is not set; some features may not work" || : ; done

# start the RabbitMQ server in the background
rabbitmq-start: $(LOG_DIR_ABS)
Expand Down Expand Up @@ -316,10 +316,14 @@ export DJ_DEBUG_LOG:=$(LOG_DIR_ABS)/dj.debug.log
# initialize the Django app in the database
# do this after setting up the db above
django-init:
python manage.py makemigrations --merge
python manage.py makemigrations # --merge
python manage.py migrate
$(MAKE) django-load-fixtures
python manage.py createsuperuser

django-load-fixtures:
python manage.py loaddata \
beagle_etl.operator.json \
file_system.filegroup.json \
file_system.filetype.json \
file_system.storage.json \
Expand Down Expand Up @@ -430,6 +434,7 @@ files-request:
--data '{"request_ids":["$(REQID)"]}' \
http://$(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)/v0/fs/files/
# python ./beagle_cli.py files list --metadata='requestId:$(REQID)'
# http://localhost:6991/v0/fs/files/?metadata=requestId:DemoRequest1

# get info on a single file
REQFILE:=b37.fasta
Expand All @@ -440,22 +445,28 @@ file-get:
http://$(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)/v0/fs/files/?filename=$(REQFILE)

# start a Roslin run for a given request in the Beagle db
run-request:
PIPELINE:=roslin
run-request: $(AUTH_FILE)
token=$$( jq -r '.token' "$(AUTH_FILE)" ) && \
echo ">>> token: $$token" && \
curl -H "Content-Type: application/json" \
-X POST \
-H "Authorization: Bearer $(TOKEN)" \
--data '{"request_ids":["$(REQID)"], "pipeline_name": "roslin"}' \
-H "Authorization: Bearer $$token" \
--data '{"request_ids":["$(REQID)"], "pipeline_name": "$(PIPELINE)"}' \
http://$(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)/v0/run/request/

# send a pipeline input to the API to start running
REQJSON:=fixtures/tests/run_roslin.json
run-request-api: $(AUTH_FILE)
@token=$$( jq -r '.token' "$(AUTH_FILE)" ) && \
token=$$( jq -r '.token' "$(AUTH_FILE)" ) && \
echo ">>> token: $$token" && \
curl -H "Content-Type: application/json" \
-X POST \
-H "Authorization: Bearer $$token" \
--data @$(REQJSON) \
http://$(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)/v0/run/api/
# http://localhost:6991/v0/run/api/?metadata=requestId:10277_C
# http://localhost:6991/v0/run/api/?requestId%3D10277_C/

# make a demo Roslin input.json file from the template fixture;
# need to update the fixture with the app ID of the demo pipeline that was loaded in the database
Expand All @@ -471,12 +482,22 @@ $(DEMO_INPUT): $(INPUT_TEMPLATE) $(AUTH_FILE)
.PHONY: $(DEMO_INPUT)

# submit a demo Roslin run using the dev Roslin pipeline entry in the database
demo-run: register-dev-pipeline $(DEMO_INPUT)
# submit using the API endpoint; bypasses the Operator
demo-run-api: register-dev-pipeline $(DEMO_INPUT)
@python manage.py loaddata fixtures/tests/juno_roslin_demo2.file.json
@python manage.py loaddata fixtures/tests/juno_roslin_demo2.filemetadata.json
@python manage.py loaddata fixtures/tests/roslin_reference_files.json
@$(MAKE) run-request-api REQID=DemoRequest1 REQJSON=$(DEMO_INPUT)

# run the update-request endpoint for a request ID in order to update the metadata about a request
update-request:
@token=$$( jq -r '.token' "$(AUTH_FILE)" ) && \
curl -H "Content-Type: application/json" \
-X POST \
-H "Authorization: Bearer $$token" \
--data '{"request_ids":["$(REQID)"], "pipeline_name": "roslin"}' \
http://$(DJANGO_BEAGLE_IP):$(DJANGO_BEAGLE_PORT)/v0/etl/update-requests/

# check if the ports needed for services and servers are already in use on this system
ifeq ($(UNAME), Darwin)
# On macOS High Sierra, use this command: lsof -nP -i4TCP:$PORT | grep LISTEN
Expand Down Expand Up @@ -514,5 +535,3 @@ PORT=
port-check:
ss -lntup | grep ':$(PORT)'
endif


10 changes: 10 additions & 0 deletions beagle_etl/fixtures/beagle_etl.operator.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,15 @@
"class_name": "AccessOperator",
"slug": "access"
}
},
{
"model": "beagle_etl.operator",
"pk": 3,
"fields": {
"active": true,
"recipes": "[]",
"class_name": "RoslinQcOperator",
"slug": "roslin-qc"
}
}
]
Loading