-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature/bai 1249 as a user i want my model cards stored as a zip file in s3 to be viewable in bailo #1476
Conversation
…ards-stored-as-a-zip-file-in-s3-to-be-viewable-in-bailo
This reverts commit ca86327.
…ards-stored-as-a-zip-file-in-s3-to-be-viewable-in-bailo
…ards-stored-as-a-zip-file-in-s3-to-be-viewable-in-bailo
const zipContent = fflate.unzipSync(test, { | ||
filter(file) { | ||
return /[0-9]+.json/.test(file.name) | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be tempted to catch invalid zip files here and throw a 500 error? The output if it's an invalid file is not very human readable. Even if res.ok
it seems to throw a fflate error.
backend/src/services/model.ts
Outdated
id: modelCard.modelId, | ||
}) | ||
if (!model) { | ||
throw NotFound(`The mirrored model ID found in the notification cannot be found.`, { modelId: modelCard.modelId }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify what notification means in this context? I'm not exactly clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think this is confusing so I've simplified it.
} | ||
|
||
const modelCards: ModelCardRevisionInterface[] = [] | ||
const test = new Uint8Array(await res.arrayBuffer()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you consider calling this data
I think test
might be misleading?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also clarify that this is the zipped data?
schema: z.object({ | ||
mirroredModelId: z.string(), | ||
sourceModelId: z.string(), | ||
modelCardVersions: z.array(z.string()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these return an array of numbers?
} | ||
|
||
const modelCards: ModelCardRevisionInterface[] = [] | ||
const test = new Uint8Array(await res.arrayBuffer()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also clarify that this is the zipped data?
…-as-a-zip-file-in-s3-to-be-viewable-in-bailo' of github.com:gchq/Bailo into feature/BAI-1249-as-a-user-i-want-my-model-cards-stored-as-a-zip-file-in-s3-to-be-viewable-in-bailo
|
||
async function checkReleaseFiles( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we catch if AV scanning is enabled?
No description provided.