Skip to content

Commit

Permalink
Correct archives location
Browse files Browse the repository at this point in the history
Follow-up related to issue 877. The archives folder was mentioned
in a few additional locations that need to be updated
  • Loading branch information
arhall0 committed Dec 13, 2024
1 parent 6245eae commit 43bc6bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions beeflow/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def reset(archive: bool = typer.Option(False, '--archive', '-a',
Shutdown beeflow and all BEE components.
Delete the bee_workdir directory which results in:
Removing the archive of all workflows.
(unless archives is configured elsewhere).
Removing the archive of workflow containers
(unless container_archive is configured elsewhere).
Reset all databases associated with the beeflow app.
Expand Down
4 changes: 3 additions & 1 deletion beeflow/wf_manager/resources/wf_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from beeflow.common.db import wfm_db
from beeflow.common.db.bdb import connect_db
from beeflow.common.config_driver import BeeConfig as bc

log = bee_logging.setup(__name__)
db_path = wf_utils.get_db_path()
Expand Down Expand Up @@ -77,7 +78,8 @@ def delete(self, wf_id):
bee_workdir = wf_utils.get_bee_workdir()
workflow_dir = f"{bee_workdir}/workflows/{wf_id}"
shutil.rmtree(workflow_dir, ignore_errors=True)
archive_path = f"{bee_workdir}/archives/{wf_id}.tgz"
archive_dir = bc.get('DEFAULT', 'bee_archive_dir')
archive_path = f"{archive_dir}/{wf_id}.tgz"
if os.path.exists(archive_path):
os.remove(archive_path)
return resp
Expand Down
5 changes: 3 additions & 2 deletions beeflow/wf_manager/resources/wf_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from beeflow.common.db import wfm_db
from beeflow.common.db.bdb import connect_db
from beeflow.common.config_driver import BeeConfig as bc

log = bee_logging.setup(__name__)

Expand Down Expand Up @@ -150,9 +151,9 @@ def patch(self):
"""Copy workflow archive."""
reqparser = reqparse.RequestParser()
data = reqparser.parse_args()
bee_workdir = wf_utils.get_bee_workdir()
wf_id = data['wf_id']
archive_path = os.path.join(bee_workdir, 'archives', wf_id + '.tgz')
archive_dir = bc.get('DEFAULT', 'bee_archive_dir')
archive_path = os.path.join(archive_dir, wf_id + '.tgz')
with open(archive_path, 'rb') as archive:
archive_file = jsonpickle.encode(archive.read())
archive_filename = os.path.basename(archive_path)
Expand Down

0 comments on commit 43bc6bf

Please sign in to comment.