mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-14 11:08:06 +00:00
support multiple corpus accounts (#334)
Add support for sharding across multiple storage accounts for blob containers used for corpus management. Things to note: 1. Additional storage accounts must be in the same resource group, support the "blob" endpoint, and have the tag `storage_type` with the value `corpus`. A utility is provided (`src/utils/add-corpus-storage-accounts`), which adds storage accounts. 2. If any secondary storage accounts exist, they are used by default for containers. 3. Storage account names are cached in memory the Azure Function instance forever. Upon adding new storage accounts, the app needs to be restarted to pick up the new accounts.
This commit is contained in:
@ -8,9 +8,11 @@ import logging
|
||||
from typing import Optional, Union
|
||||
|
||||
from onefuzztypes.models import Report
|
||||
from onefuzztypes.primitives import Container
|
||||
from pydantic import ValidationError
|
||||
|
||||
from .azure.containers import StorageType, get_blob
|
||||
from .azure.containers import get_blob
|
||||
from .azure.storage import StorageType
|
||||
|
||||
|
||||
def parse_report(
|
||||
@ -44,7 +46,7 @@ def parse_report(
|
||||
return entry
|
||||
|
||||
|
||||
def get_report(container: str, filename: str) -> Optional[Report]:
|
||||
def get_report(container: Container, filename: str) -> Optional[Report]:
|
||||
metadata = "/".join([container, filename])
|
||||
if not filename.endswith(".json"):
|
||||
logging.error("get_report invalid extension: %s", metadata)
|
||||
|
Reference in New Issue
Block a user