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

sync #1

Merged
merged 32 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fdade0d
Merge pull request #3 from ESIPFed/main
ZihengSun Apr 3, 2023
6be3ecb
fix server
ZihengSun Apr 3, 2023
59e91aa
Update run_workflow.py
ZihengSun Apr 3, 2023
e4845ab
working
ZihengSun Apr 11, 2023
5e242d5
ignore pyc
ZihengSun Apr 11, 2023
9a5b53c
do not expose utils.py directly to import
gokulprathin8 Apr 15, 2023
339db33
do not expose utils.py directly to import
gokulprathin8 Apr 15, 2023
b5eaa71
remove .idea files
gokulprathin8 Apr 15, 2023
0bfe09c
fix import structure
gokulprathin8 Apr 15, 2023
3593325
fix typo
gokulprathin8 Apr 15, 2023
f6c79e3
updated example.ipynb
gokulprathin8 Apr 15, 2023
c20e1df
refactor
gokulprathin8 Apr 15, 2023
5046fe3
fix run process
gokulprathin8 Apr 15, 2023
62b411f
fix run workflow
gokulprathin8 Apr 15, 2023
ee087ee
history doesn't need three
ZihengSun Apr 16, 2023
8090aa0
Merge branch 'main' into feat/poetry
ZihengSun Apr 16, 2023
289208d
clean up __init__
ZihengSun Apr 16, 2023
f60de55
Merge branch 'feat/poetry' of https://github.com/gokulprathin8/pygeow…
ZihengSun Apr 16, 2023
eebff7a
update ignore
ZihengSun Apr 16, 2023
41e54da
Merge pull request #4 from gokulprathin8/feat/poetry
ZihengSun Apr 16, 2023
dda9df1
refactor and remove duplication
ZihengSun Apr 16, 2023
3619434
test if publish workflow works
ZihengSun Apr 16, 2023
6bca5ce
no test pypi
ZihengSun Apr 16, 2023
71ee639
trusted publish
ZihengSun Apr 16, 2023
a0ca64d
resolve requests dependency
gokulprathin8 Apr 16, 2023
29744d7
Merge pull request #5 from gokulprathin8/deps/requests
ZihengSun Apr 16, 2023
e33dba5
move to test
ZihengSun Apr 16, 2023
44fb7d7
bump version
ZihengSun Apr 16, 2023
826357e
trust publish
ZihengSun Apr 16, 2023
4169903
test tags
ZihengSun Apr 16, 2023
05248dd
Update pyproject.toml
ZihengSun Apr 16, 2023
2566850
Update pyproject.toml
ZihengSun Apr 16, 2023
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
Prev Previous commit
Next Next commit
history doesn't need three
  • Loading branch information
ZihengSun committed Apr 16, 2023
commit ee087ee393b0cf8caaf64444334dcf542dfe1536
18 changes: 16 additions & 2 deletions pygeoweaver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
The main function of pygeoweaver
To run in CLI mode.
"""
from pygeoweaver.history_process import show_process_history
from pygeoweaver.detail_host import detail_host
from pygeoweaver.detail_process import detail_process
from pygeoweaver.detail_workflow import detail_workflow
from pygeoweaver.export_workflow import export_worklfow
from pygeoweaver.history import show_history
from pygeoweaver.import_workflow import import_workflow
from pygeoweaver.list_hosts import list_hosts
from pygeoweaver.list_processes import list_processes
from pygeoweaver.list_workflows import list_workflows
Expand All @@ -18,7 +23,16 @@ def main():
#list_processes()
#list_workflows()
# show history
show_process_history("gfvnp8a7rgh")
#show_history("ll3u3W78eOEfklxhBJ")
# detail host
# detail_host("100001")
# detail process
# detail_process("7pxu8c")
#detail_workflow("5jnhcrq33znbu2mue9v2")
# import workflow
#import_workflow("/Users/joe/Downloads/gr3ykr8dynu12vrwq11oy.zip")
# export workflow
export_worklfow("gr3ykr8dynu12vrwq11oy", "4", "/Users/joe/Downloads/test_pygeoweaver_export.zip")


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions pygeoweaver/export_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def export_worklfow(workflow_id, mode, target_file_path):
<target_file_path> target file path to save the workflow zip
--mode=<export_mode> exportation model options:
1 - workflow only
2 - workflow with process code
2 - workflow with process code
3 - workflow with process code and only good
history
4 - workflow with process code and all the
4 - workflow with process code and all the
history.default option is 4.
"""
if not workflow_id:
raise RuntimeError("Workflow id is missing")
download_geoweaver_jar()
subprocess.run(["java", "-jar", get_geoweaver_jar_path(), "export", "workflow", workflow_id, target_file_path,
"--mode", mode,],
subprocess.run(["java", "-jar", get_geoweaver_jar_path(), "export", "workflow",
f"--mode={mode}", workflow_id, target_file_path,],
cwd=f"{get_root_dir()}/")
12 changes: 12 additions & 0 deletions pygeoweaver/history.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import subprocess
from pygeoweaver.utils import download_geoweaver_jar, get_geoweaver_jar_path, get_root_dir


def show_history(history_id):
"""
Workflow and process history uses the same method to check
"""
if not history_id:
raise RuntimeError("history id is missing")
download_geoweaver_jar()
subprocess.run(["java", "-jar", get_geoweaver_jar_path(), "history", history_id], cwd=f"{get_root_dir()}/")
9 changes: 0 additions & 9 deletions pygeoweaver/history_process.py

This file was deleted.

9 changes: 0 additions & 9 deletions pygeoweaver/history_workflow.py

This file was deleted.

4 changes: 2 additions & 2 deletions pygeoweaver/import_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def import_workflow(workflow_zip_file_path):
if not workflow_zip_file_path:
raise RuntimeError("Workflow zip file path is missing")
download_geoweaver_jar()
subprocess.run(["java", "-jar", get_geoweaver_jar_path(), "import", "workflow", workflow_zip_file_path],
cwd=f"{get_root_dir()}/")
subprocess.run(["java", "-jar", get_geoweaver_jar_path(), "import",
"workflow", workflow_zip_file_path], cwd=f"{get_root_dir()}/")