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

Bootstrap update - import adjustment #47

Merged
merged 12 commits into from
Dec 6, 2021
38 changes: 10 additions & 28 deletions abm-bootstrap/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import os
import time
import json
import io

from pathlib import Path
path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
sys.path.insert(0, path)
from abm import history, workflow
from contextlib import redirect_stdout
from pprint import pprint

# Args from yml config files
# use abm as a library to run commands
Expand All @@ -34,43 +35,24 @@ def main():

# export histories from main
for id in historyID:
# make separate function
# got rid of --no-wait
# returns job id, pass abm the status
# wait for - give cloud id
wait_for("main", id)
# f = io.StringIO()
# with redirect_stdout(f):
# # Should print statement that includes URL
# subprocess.run(["python3", "abm", "main", "history", "export", id])
# out = f.getvalue()
result = history.export([id])
# exportURL.append((out)[32:])
pprint(result)
exit(0)
exportURL.append(result)

# print(exportURL)
# download workflows from js
for wf in workflows:
subprocess.run(["python3", "abm", "main", "wf", "download", wf, "./workflows"])
subprocess.run(["python3", "abm", "main", "wf", "translate", wf])
workflow.export([wf, "./workflows"])
workflow.translate([wf])

# for each instance:
for cloud in clouds:
# import histories from main
for url in exportURL:
subprocess.run(["python3", "abm", cloud, "history", "import", url])
history._import([url])

for filename in os.listdir("./workflow"):
validateStatus = subprocess.run(["python3", "abm", cloud, "wf", "validate", filename],
capture_output=True, text=True)
pprint(json.dumps(validateStatus.stdout))

# pprint Python obj
# take returned json
# import abm folder/workflow/history/etc. and run those methods
# if validateStatus ... ?
subprocess.run(["python3", "abm", cloud, "wf", "upload", filename])
workflow.validate([filename])
workflow.upload([filename])


def wait_for(cloud: str, id: str):
Expand Down
11 changes: 11 additions & 0 deletions bootstrap-config/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Benchmarking DNA
runs: 3
workflow_conf:
- config/test.yml
- config/dna-named.yml
- config/rna-named.yml
cloud:
- iu2
job_configs:
- rules/4x8.yml
- rules/8x16.yml