mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-04 13:02:09 +08:00
openpilot CI: fix azure bucket names (#30477)
fix azure bucket names old-commit-hash: 0addee2b4b9f4ad64d1cea12f4a6badf50e85e9c
This commit is contained in:
@@ -7,8 +7,9 @@ from typing import IO, Union
|
||||
|
||||
DATA_CI_ACCOUNT = "commadataci"
|
||||
DATA_CI_ACCOUNT_URL = f"https://{DATA_CI_ACCOUNT}.blob.core.windows.net"
|
||||
DATA_CI_CONTAINER = "openpilotci"
|
||||
BASE_URL = f"{DATA_CI_ACCOUNT_URL}/{DATA_CI_CONTAINER}/"
|
||||
OPENPILOT_CI_CONTAINER = "openpilotci"
|
||||
DATA_CI_CONTAINER = "commadataci"
|
||||
BASE_URL = f"{DATA_CI_ACCOUNT_URL}/{OPENPILOT_CI_CONTAINER}/"
|
||||
|
||||
TOKEN_PATH = Path("/data/azure_token")
|
||||
|
||||
@@ -51,7 +52,7 @@ def upload_bytes(data: Union[bytes, IO], blob_name: str) -> str:
|
||||
from azure.storage.blob import BlobClient
|
||||
blob = BlobClient(
|
||||
account_url=DATA_CI_ACCOUNT_URL,
|
||||
container_name=DATA_CI_CONTAINER,
|
||||
container_name=OPENPILOT_CI_CONTAINER,
|
||||
blob_name=blob_name,
|
||||
credential=get_azure_credential(),
|
||||
)
|
||||
|
||||
@@ -9,8 +9,8 @@ from tqdm import tqdm
|
||||
|
||||
from openpilot.selfdrive.car.tests.routes import routes as test_car_models_routes
|
||||
from openpilot.selfdrive.test.process_replay.test_processes import source_segments as replay_segments
|
||||
from openpilot.selfdrive.test.openpilotci import (DATA_CI_ACCOUNT, DATA_CI_ACCOUNT_URL, DATA_CI_CONTAINER,
|
||||
get_azure_credential, get_container_sas)
|
||||
from openpilot.selfdrive.test.openpilotci import (DATA_CI_ACCOUNT, DATA_CI_ACCOUNT_URL, OPENPILOT_CI_CONTAINER,
|
||||
DATA_CI_CONTAINER, get_azure_credential, get_container_sas)
|
||||
|
||||
DATA_PROD_ACCOUNT = "commadata2"
|
||||
DATA_PROD_CONTAINER = "commadata2"
|
||||
@@ -23,15 +23,15 @@ SOURCES = [
|
||||
|
||||
@lru_cache
|
||||
def get_azure_keys():
|
||||
dest_container = ContainerClient(DATA_CI_ACCOUNT_URL, DATA_CI_CONTAINER, credential=get_azure_credential())
|
||||
dest_key = get_container_sas(DATA_CI_ACCOUNT, DATA_CI_CONTAINER)
|
||||
dest_container = ContainerClient(DATA_CI_ACCOUNT_URL, OPENPILOT_CI_CONTAINER, credential=get_azure_credential())
|
||||
dest_key = get_container_sas(DATA_CI_ACCOUNT, OPENPILOT_CI_CONTAINER)
|
||||
source_keys = [get_container_sas(*s) for s in SOURCES]
|
||||
return dest_container, dest_key, source_keys
|
||||
|
||||
|
||||
def upload_route(path: str, exclude_patterns: Optional[Iterable[str]] = None) -> None:
|
||||
# TODO: use azure-storage-blob instead of azcopy, simplifies auth
|
||||
dest_key = get_container_sas(DATA_CI_ACCOUNT, DATA_CI_CONTAINER)
|
||||
dest_key = get_container_sas(DATA_CI_ACCOUNT, OPENPILOT_CI_CONTAINER)
|
||||
if exclude_patterns is None:
|
||||
exclude_patterns = ['*/dcamera.hevc']
|
||||
|
||||
@@ -42,7 +42,7 @@ def upload_route(path: str, exclude_patterns: Optional[Iterable[str]] = None) ->
|
||||
"azcopy",
|
||||
"copy",
|
||||
f"{path}/*",
|
||||
f"https://{DATA_CI_ACCOUNT}.blob.core.windows.net/{DATA_CI_CONTAINER}/{destpath}?{dest_key}",
|
||||
f"https://{DATA_CI_ACCOUNT}.blob.core.windows.net/{OPENPILOT_CI_CONTAINER}/{destpath}?{dest_key}",
|
||||
"--recursive=false",
|
||||
"--overwrite=false",
|
||||
] + [f"--exclude-pattern={p}" for p in exclude_patterns]
|
||||
@@ -65,7 +65,7 @@ def sync_to_ci_public(route: str) -> bool:
|
||||
"azcopy",
|
||||
"copy",
|
||||
f"https://{source_account}.blob.core.windows.net/{source_bucket}/{key_prefix}?{source_key}",
|
||||
f"https://{DATA_CI_ACCOUNT}.blob.core.windows.net/{DATA_CI_CONTAINER}/{dongle_id}?{dest_key}",
|
||||
f"https://{DATA_CI_ACCOUNT}.blob.core.windows.net/{OPENPILOT_CI_CONTAINER}/{dongle_id}?{dest_key}",
|
||||
"--recursive=true",
|
||||
"--overwrite=false",
|
||||
"--exclude-pattern=*/dcamera.hevc",
|
||||
|
||||
Reference in New Issue
Block a user