-
Notifications
You must be signed in to change notification settings - Fork 32
UW-657 fs makedirs #572
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
Merged
Merged
UW-657 fs makedirs #572
Changes from 29 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
c1ae271
WIP
maddenp-cu 9cd667d
Work on tests
maddenp-cu 5514c1e
Work on tests
maddenp-cu 8901b79
Work on tests
maddenp-cu 2b78d89
Work on tests
maddenp-cu 28472f8
WIP
maddenp-cu ed73451
Add stage-dirs.jsonschema
maddenp-cu 1a5df26
Works
maddenp-cu e2d7d6d
WIP
maddenp-cu 8e52ebb
Update docs
maddenp-cu d0da865
Update docs
maddenp-cu ffaeab4
WIP
maddenp-cu b8d145a
WIP
maddenp-cu 219960f
WIP
maddenp-cu ce2e4d4
WIP
maddenp-cu dc7e828
WIP
maddenp-cu 778a2eb
Revert 'stage-files' to 'files-to-stage'
maddenp-cu 6e523e4
Reposition test block
maddenp-cu b7ea345
Fix doc
maddenp-cu e73ac23
Doc update
maddenp-cu a2c92b6
Update docs/sections/user_guide/yaml/mkdir.rst
maddenp-cu 6068ad9
Update docstring
maddenp-cu f615100
mkdir -> makedirs
maddenp-cu d7c612e
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu 9b9c944
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu 09c6055
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu ad8a74e
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu ccfc3e5
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu d562142
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu e56c47d
Renames
maddenp-cu 7297e46
file -> fs
maddenp-cu 1802f37
WIP
maddenp-cu 04402ee
Renames
maddenp-cu e08b0a7
file -> fs in docs
maddenp-cu 4e978b3
Work on docs
maddenp-cu 159709e
Work on docs
maddenp-cu 8e6bebb
Update mode fs description in CLI
maddenp-cu 23e37a1
Update docs
maddenp-cu 81db421
Doc update
maddenp-cu dfca65a
Doc update
maddenp-cu d7d79fd
Merge branch 'main' into uw-657-file-mkdir
maddenp-cu 5389215
Update docs/index.rst
maddenp-cu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
docs/sections/user_guide/cli/tools/file/copy-exec-no-target-dir-err.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
[2024-07-26T21:51:23] ERROR Relative path 'foo' requires the target directory to be specified | ||
[2024-08-14T15:19:59] INFO Validating config against internal schema: files-to-stage | ||
[2024-08-14T15:19:59] INFO 0 UW schema-validation errors found | ||
[2024-08-14T15:19:59] ERROR Relative path 'foo' requires the target directory to be specified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ Positional arguments: | |
Copy files | ||
link | ||
Link files | ||
makedirs | ||
Make directories |
4 changes: 3 additions & 1 deletion
4
docs/sections/user_guide/cli/tools/file/link-exec-no-target-dir-err.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
[2024-07-26T21:51:23] ERROR Relative path 'foo' requires the target directory to be specified | ||
[2024-08-14T15:19:57] INFO Validating config against internal schema: files-to-stage | ||
[2024-08-14T15:19:57] INFO 0 UW schema-validation errors found | ||
[2024-08-14T15:19:57] ERROR Relative path 'foo' requires the target directory to be specified |
8 changes: 8 additions & 0 deletions
8
docs/sections/user_guide/cli/tools/file/makedirs-config-timedep.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
config: | ||
makedirs: | ||
- foo/{{ yyyymmdd }}/{{ hh }}/{{ nnn }}/bar | ||
- baz/{{ yyyymmdd }}/{{ hh }}/{{ nnn }}/qux | ||
yyyymmdd: "{{ cycle.strftime('%Y%m%d') }}" | ||
hh: "{{ cycle.strftime('%H') }}" | ||
nnn: "{{ '%03d' % (leadtime.total_seconds() // 3600) }}" | ||
validtime: "{{ (cycle + leadtime).strftime('%Y-%m-%dT%H') }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
config: | ||
makedirs: | ||
- foo | ||
- bar |
1 change: 1 addition & 0 deletions
1
docs/sections/user_guide/cli/tools/file/makedirs-exec-no-target-dir-err.cmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uw file makedirs --config-file makedirs-config.yaml config |
3 changes: 3 additions & 0 deletions
3
docs/sections/user_guide/cli/tools/file/makedirs-exec-no-target-dir-err.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[2024-08-14T15:19:58] INFO Validating config against internal schema: makedirs | ||
[2024-08-14T15:19:58] INFO 0 UW schema-validation errors found | ||
[2024-08-14T15:19:58] ERROR Relative path 'foo' requires the target directory to be specified |
4 changes: 4 additions & 0 deletions
4
docs/sections/user_guide/cli/tools/file/makedirs-exec-timedep.cmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rm -rf makedirs-parent-timedep | ||
uw file makedirs --target-dir makedirs-parent-timedep --config-file makedirs-config-timedep.yaml --cycle 2024-05-29T12 --leadtime 6 config | ||
echo | ||
tree -F makedirs-parent-timedep |
29 changes: 29 additions & 0 deletions
29
docs/sections/user_guide/cli/tools/file/makedirs-exec-timedep.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[2024-08-12T04:35:49] INFO Validating config against internal schema: makedirs | ||
[2024-08-12T04:35:49] INFO 0 UW schema-validation errors found | ||
[2024-08-12T04:35:49] INFO Directories: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directories: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Requirement(s) ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Executing | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/foo/20240529/12/006/bar: Final state: Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/baz/20240529/12/006/qux: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/baz/20240529/12/006/qux: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/baz/20240529/12/006/qux: Requirement(s) ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/baz/20240529/12/006/qux: Executing | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent-timedep/baz/20240529/12/006/qux: Final state: Ready | ||
[2024-08-12T04:35:49] INFO Directories: Final state: Ready | ||
|
||
makedirs-parent-timedep/ | ||
├── baz/ | ||
│ └── 20240529/ | ||
│ └── 12/ | ||
│ └── 006/ | ||
│ └── qux/ | ||
└── foo/ | ||
└── 20240529/ | ||
└── 12/ | ||
└── 006/ | ||
└── bar/ | ||
|
||
11 directories, 0 files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rm -rf makedirs-parent | ||
uw file makedirs --target-dir makedirs-parent --config-file makedirs-config.yaml config | ||
echo | ||
tree -F makedirs-parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[2024-08-12T04:35:49] INFO Validating config against internal schema: makedirs | ||
[2024-08-12T04:35:49] INFO 0 UW schema-validation errors found | ||
[2024-08-12T04:35:49] INFO Directories: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directories: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/foo: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/foo: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/foo: Requirement(s) ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/foo: Executing | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/foo: Final state: Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/bar: Initial state: Not Ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/bar: Checking requirements | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/bar: Requirement(s) ready | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/bar: Executing | ||
[2024-08-12T04:35:49] INFO Directory makedirs-parent/bar: Final state: Ready | ||
[2024-08-12T04:35:49] INFO Directories: Final state: Ready | ||
|
||
makedirs-parent/ | ||
├── bar/ | ||
└── foo/ | ||
|
||
3 directories, 0 files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uw file makedirs --help |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
usage: uw file makedirs [-h] [--version] [--config-file PATH] | ||
[--target-dir PATH] [--cycle CYCLE] | ||
[--leadtime LEADTIME] [--dry-run] [--quiet] | ||
[--verbose] | ||
[KEY ...] | ||
|
||
Make directories | ||
|
||
Optional arguments: | ||
-h, --help | ||
Show help and exit | ||
--version | ||
Show version info and exit | ||
--config-file PATH, -c PATH | ||
Path to UW YAML config file (default: read from stdin) | ||
--target-dir PATH | ||
Root directory for relative destination paths | ||
--cycle CYCLE | ||
The cycle in ISO8601 format (e.g. 2024-08-12T00) | ||
--leadtime LEADTIME | ||
The leadtime as hours[:minutes[:seconds]] | ||
--dry-run | ||
Only log info, making no changes | ||
--quiet, -q | ||
Print no logging messages | ||
--verbose, -v | ||
Print all logging messages | ||
KEY | ||
YAML key leading to file dst/src block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. _makedirs_yaml: | ||
|
||
Directory Blocks | ||
================ | ||
|
||
Directory blocks define a sequence of one or more directories to be created, nested under a ``makedirs:`` key. Each value is either an absolute path, or a path relative to the target directory, specified either via the CLI or an API call. | ||
|
||
Example block with absolute paths: | ||
|
||
.. code-block:: yaml | ||
|
||
makedirs: | ||
- /path/to/dir1 | ||
- /path/to/dir2 | ||
|
||
Example block with relative paths: | ||
|
||
.. code-block:: yaml | ||
|
||
makedirs: | ||
- /subdir/dir1 | ||
- ../../dir2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.