Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
nomad-FAIR
Commits
249498aa
Commit
249498aa
authored
7 months ago
by
Theodore Chang
Browse files
Options
Downloads
Patches
Plain Diff
Change default value of size limit
parent
fe54bc8d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2057
Change default value of size limit
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nomad/archive/converter.py
+7
-7
7 additions, 7 deletions
nomad/archive/converter.py
nomad/cli/admin/uploads.py
+2
-2
2 additions, 2 deletions
nomad/cli/admin/uploads.py
with
9 additions
and
9 deletions
nomad/archive/converter.py
+
7
−
7
View file @
249498aa
...
...
@@ -58,7 +58,7 @@ def convert_archive(
delete_old
:
bool
=
False
,
counter
:
Counter
=
None
,
force_repack
:
bool
=
False
,
size_limit
:
int
=
4
,
size_limit
:
int
=
-
1
,
):
"""
Convert an archive of the old format to the new format.
...
...
@@ -84,7 +84,7 @@ def convert_archive(
delete_old (bool, optional): Whether to delete the old file after conversion. Defaults to False.
counter (Counter, optional): A counter to track the progress of the conversion. Defaults to None.
force_repack (bool, optional): Force repacking the archive that is already in the new format. Defaults to False.
size_limit (int, optional): The size limit in GB for the archive. Defaults to
4
.
size_limit (int, optional): The size limit in GB for the archive. Defaults to
-1 (no limit)
.
"""
prefix
:
str
=
counter
.
increment
()
if
counter
else
''
...
...
@@ -114,7 +114,7 @@ def convert_archive(
return
original_size
=
os
.
path
.
getsize
(
original_path
)
if
original_size
>
size_limit
*
1024
**
3
:
if
size_limit
>
0
and
original_size
>
size_limit
*
1024
**
3
:
flush
(
f
'
{
prefix
}
[WARNING] File size exceeds limit
{
size_limit
}
GB:
{
original_path
}
'
)
...
...
@@ -174,7 +174,7 @@ def convert_folder(
overwrite
:
bool
=
False
,
delete_old
:
bool
=
False
,
force_repack
:
bool
=
False
,
size_limit
:
int
=
4
,
size_limit
:
int
=
-
1
,
):
"""
Convert archives in the specified folder to the new format using parallel processing.
...
...
@@ -191,7 +191,7 @@ def convert_folder(
overwrite (bool): Whether to overwrite existing files (default is False).
delete_old (bool): Whether to delete the old file after conversion (default is False).
force_repack (bool): Force repacking the archive (default is False).
size_limit (int): Size limit in GB for the archive (default is
4
).
size_limit (int): Size limit in GB for the archive (default is
-1, no limit
).
"""
file_list
:
list
=
[]
...
...
@@ -254,7 +254,7 @@ def convert_upload(
overwrite
:
bool
=
False
,
delete_old
:
bool
=
False
,
force_repack
:
bool
=
False
,
size_limit
:
int
=
4
,
size_limit
:
int
=
-
1
,
):
"""
Function to convert an upload with the given upload_id to the new format.
...
...
@@ -271,7 +271,7 @@ def convert_upload(
overwrite (bool, optional): Whether to overwrite existing files. Defaults to False.
delete_old (bool, optional): Whether to delete the old file after conversion. Defaults to False.
force_repack (bool, optional): Force repacking the existing archive (in new format). Defaults to False.
size_limit (int, optional): Size limit in GB for the archive. Defaults to
4
.
size_limit (int, optional): Size limit in GB for the archive. Defaults to
-1 (no limit)
.
"""
if
isinstance
(
uploads
,
(
str
,
Upload
)):
uploads
=
[
uploads
]
...
...
This diff is collapsed.
Click to expand it.
nomad/cli/admin/uploads.py
+
2
−
2
View file @
249498aa
...
...
@@ -1450,8 +1450,8 @@ def only_v1(path: str):
'
--size-limit
'
,
'
-s
'
,
type
=
int
,
default
=
4
,
help
=
'
Limit archive
size in GB. Default is
4GB
.
'
,
default
=
-
1
,
help
=
'
Only handle archives under limited
size in GB. Default is
-1 (no limit)
.
'
,
)
@click.pass_context
def
convert_archive
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment