Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
d6a40f40
Commit
d6a40f40
authored
Feb 21, 2022
by
tlc@void
Browse files
Fix conflict
parent
1ff5a98f
Pipeline
#123304
passed with stages
in 41 minutes and 20 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
nomad/app/v1/routers/entries.py
View file @
d6a40f40
...
...
@@ -1042,20 +1042,23 @@ async def get_entry_raw_file(
return
StreamingResponse
(
raw_file_content
,
media_type
=
mime_type
)
async
def
answer_entry_archive_request
(
query
:
Dict
[
str
,
Any
],
required
:
ArchiveRequired
,
user
:
User
):
async
def
answer_entry_archive_request
(
query
:
Dict
[
str
,
Any
],
required
:
ArchiveRequired
,
user
:
User
,
entry_metadata
=
None
):
required_reader
=
_validate_required
(
required
)
response
=
perform_search
(
owner
=
Owner
.
visible
,
query
=
query
,
required
=
MetadataRequired
(
include
=
[
'entry_id'
,
'upload_id'
,
'parser_name'
]),
user_id
=
user
.
user_id
if
user
is
not
None
else
None
)
if
not
entry_metadata
:
response
=
perform_search
(
owner
=
Owner
.
visible
,
query
=
query
,
required
=
MetadataRequired
(
include
=
[
'entry_id'
,
'upload_id'
,
'parser_name'
]),
user_id
=
user
.
user_id
if
user
is
not
None
else
None
)
if
response
.
pagination
.
total
==
0
:
raise
HTTPException
(
status_code
=
status
.
HTTP_404_NOT_FOUND
,
detail
=
'The entry does not exist or is not visible to you.'
)
if
response
.
pagination
.
total
==
0
:
raise
HTTPException
(
status_code
=
status
.
HTTP_404_NOT_FOUND
,
detail
=
'The entry does not exist or is not visible to you.'
)
entry_metadata
=
response
.
data
[
0
]
entry_metadata
=
response
.
data
[
0
]
entry_id
=
entry_metadata
[
'entry_id'
]
uploads
=
_Uploads
()
...
...
nomad/app/v1/routers/uploads.py
View file @
d6a40f40
...
...
@@ -934,16 +934,16 @@ async def put_upload_raw_path(
archive
=
None
if
entry
and
entry
.
process_status
==
ProcessStatus
.
SUCCESS
and
include_archive
:
# NOTE: We can't rely on ES to get the metadata for the entry, since it may
# not have had
e
enough time to update its index etc. For now, we will just
# not have had enough time to update its index etc. For now, we will just
# ignore this, as we do not need it.
entry_metadata
=
dict
(
upload_id
=
upload_id
,
entry_id
=
entry
.
entry_id
,
parser_name
=
entry
.
parser_name
)
archive
=
answer_entry_archive_request
(
archive
=
(
await
answer_entry_archive_request
(
dict
(
upload_id
=
upload_id
,
mainfile
=
full_path
),
required
=
'*'
,
user
=
user
,
entry_metadata
=
entry_metadata
)[
'data'
][
'archive'
]
entry_metadata
=
entry_metadata
)
)
[
'data'
][
'archive'
]
response
=
PutRawFileResponse
(
upload_id
=
upload_id
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment