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

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

JR40159
Copy link
Member

@JR40159 JR40159 commented Aug 28, 2024

No description provided.

Comment on lines 111 to 115
const zipContent = fflate.unzipSync(test, {
filter(file) {
return /[0-9]+.json/.test(file.name)
},
})
Copy link
Member

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.

id: modelCard.modelId,
})
if (!model) {
throw NotFound(`The mirrored model ID found in the notification cannot be found.`, { modelId: modelCard.modelId })
Copy link
Member

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.

Copy link
Member Author

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())
Copy link
Member

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?

Copy link
Member

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()),
Copy link
Member

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())
Copy link
Member

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(
Copy link
Member

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?

@JR40159 JR40159 merged commit 7294665 into main Sep 9, 2024
14 checks passed
@JR40159 JR40159 deleted the feature/BAI-1249-as-a-user-i-want-my-model-cards-stored-as-a-zip-file-in-s3-to-be-viewable-in-bailo branch September 9, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants