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

[BUG]: junifer reset fails as it tries to delete junifer_jobs directory #332

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

synchon
Copy link
Member

@synchon synchon commented Apr 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

  1. Queue a job (do not submit)
  2. Run junifer reset

You see this:

OSError: [Errno 39] Directory not empty: '/home/fraimondo/dev/scratch/neurodc/junifer_jobs'

Expected Behavior

No error, and that directory is not deleted.

Steps To Reproduce

  1. Install latest (--pre) from pip
  2. Queue any yaml

Environment

junifer:
  version: 0.0.5.dev27
python:
  version: 3.11.8
  implementation: CPython
dependencies:
  click: 8.1.7
  numpy: 1.26.4
  scipy: 1.11.4
  datalad: 0.19.6
  pandas: 2.1.4
  nibabel: 5.2.1
  nilearn: 0.10.2
  sqlalchemy: 2.0.29
  ruamel.yaml: 0.17.40
  httpx: 0.26.0
  tqdm: 4.66.1
  templateflow: 24.2.0
  looseversion: None
system:
  platform: Linux-6.6.13+bpo-amd64-x86_64-with-glibc2.36
environment:
  LC_CTYPE: en_US.UTF-8
  PATH: 
    /home/fraimondo/miniconda3/envs/neurodc/bin:/home/fraimondo/miniconda3/condabin:/home/fraimondo/.dotfiles/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/local/games:/usr/games

Relevant log output

2024-04-12 22:35:59,336 - JUNIFER - INFO - ===== Lib Versions =====
2024-04-12 22:35:59,336 - JUNIFER - INFO - numpy: 1.26.4
2024-04-12 22:35:59,336 - JUNIFER - INFO - scipy: 1.11.4
2024-04-12 22:35:59,336 - JUNIFER - INFO - pandas: 2.1.4
2024-04-12 22:35:59,336 - JUNIFER - INFO - nilearn: 0.10.2
2024-04-12 22:35:59,336 - JUNIFER - INFO - nibabel: 5.2.1
2024-04-12 22:35:59,336 - JUNIFER - INFO - junifer: 0.0.5.dev27
2024-04-12 22:35:59,336 - JUNIFER - INFO - ========================
2024-04-12 22:35:59,336 - JUNIFER - INFO - Parsing yaml file: /home/fraimondo/dev/scratch/neurodc/aomic_fc.yaml
2024-04-12 22:35:59,345 - JUNIFER - INFO - Deleting /data/group/riseml/fraimondo/ds003097_FC/ds003097_FC.hdf5
2024-04-12 22:35:59,345 - JUNIFER - INFO - Deleting job directory at /home/fraimondo/dev/scratch/neurodc/junifer_jobs/aomic_fc
Traceback (most recent call last):
  File "/home/fraimondo/miniconda3/envs/neurodc/bin/junifer", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/junifer/api/cli.py", line 451, in reset
    api_reset(config)
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/site-packages/junifer/api/functions.py", line 363, in reset
    job_dir.parent.rmdir()
  File "/home/fraimondo/miniconda3/envs/neurodc/lib/python3.11/pathlib.py", line 1156, in rmdir
    os.rmdir(self)
OSError: [Errno 39] Directory not empty: '/home/fraimondo/dev/scratch/neurodc/junifer_jobs'

Anything else?

No response

@fraimondo fraimondo added bug Something isn't working triage New issues waiting to be reviewed labels Apr 12, 2024
@synchon synchon changed the title [BUG]: Junifer reset fails as it tries to delete junifer_jobs directory [BUG]: junifer reset fails as it tries to delete junifer_jobs directory Apr 15, 2024
@synchon synchon requested a review from fraimondo April 15, 2024 09:46
@synchon synchon removed the triage New issues waiting to be reviewed label Apr 15, 2024
@synchon synchon self-assigned this Apr 15, 2024
@synchon synchon added this to the 0.0.5 (alpha 4) milestone Apr 15, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8f96159) to head (b7f6b89).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #332   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            1         1           
=========================================
  Hits             1         1           
Flag Coverage Δ
docs 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link

github-actions bot commented Apr 15, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-04-30 11:42 UTC

@synchon synchon merged commit 0646a6f into main Apr 30, 2024
24 of 28 checks passed
@synchon synchon deleted the fix/reset branch April 30, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants