| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -14,11 +14,16 @@ SOURCES = [ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  (_DATA_ACCOUNT_CI, "commadataci"), | 
					 | 
					 | 
					 | 
					  (_DATA_ACCOUNT_CI, "commadataci"), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					] | 
					 | 
					 | 
					 | 
					] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					DEST_KEY = azureutil.get_user_token(_DATA_ACCOUNT_CI, "openpilotci") | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SOURCE_KEYS = [azureutil.get_user_token(account, bucket) for account, bucket in SOURCES] | 
					 | 
					 | 
					 | 
					def get_azure_keys(): | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SERVICE = BlockBlobService(_DATA_ACCOUNT_CI, sas_token=DEST_KEY) | 
					 | 
					 | 
					 | 
					  dest_key = azureutil.get_user_token(_DATA_ACCOUNT_CI, "openpilotci") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  source_keys = [azureutil.get_user_token(account, bucket) for account, bucket in SOURCES] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  service = BlockBlobService(_DATA_ACCOUNT_CI, sas_token=dest_key) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  return dest_key, source_keys, service | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def upload_route(path, exclude_patterns=None): | 
					 | 
					 | 
					 | 
					def upload_route(path, exclude_patterns=None): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  dest_key, _, _ = get_azure_keys() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if exclude_patterns is None: | 
					 | 
					 | 
					 | 
					  if exclude_patterns is None: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    exclude_patterns = ['*/dcamera.hevc'] | 
					 | 
					 | 
					 | 
					    exclude_patterns = ['*/dcamera.hevc'] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -29,27 +34,28 @@ def upload_route(path, exclude_patterns=None): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    "azcopy", | 
					 | 
					 | 
					 | 
					    "azcopy", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    "copy", | 
					 | 
					 | 
					 | 
					    "copy", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    f"{path}/*", | 
					 | 
					 | 
					 | 
					    f"{path}/*", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    f"https://{_DATA_ACCOUNT_CI}.blob.core.windows.net/openpilotci/{destpath}?{DEST_KEY}", | 
					 | 
					 | 
					 | 
					    f"https://{_DATA_ACCOUNT_CI}.blob.core.windows.net/openpilotci/{destpath}?{dest_key}", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    "--recursive=false", | 
					 | 
					 | 
					 | 
					    "--recursive=false", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    "--overwrite=false", | 
					 | 
					 | 
					 | 
					    "--overwrite=false", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  ] + [f"--exclude-pattern={p}" for p in exclude_patterns] | 
					 | 
					 | 
					 | 
					  ] + [f"--exclude-pattern={p}" for p in exclude_patterns] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  subprocess.check_call(cmd) | 
					 | 
					 | 
					 | 
					  subprocess.check_call(cmd) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def sync_to_ci_public(route): | 
					 | 
					 | 
					 | 
					def sync_to_ci_public(route): | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  dest_key, source_keys, service = get_azure_keys() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  key_prefix = route.replace('|', '/') | 
					 | 
					 | 
					 | 
					  key_prefix = route.replace('|', '/') | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  dongle_id = key_prefix.split('/')[0] | 
					 | 
					 | 
					 | 
					  dongle_id = key_prefix.split('/')[0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if next(azureutil.list_all_blobs(SERVICE, "openpilotci", prefix=key_prefix), None) is not None: | 
					 | 
					 | 
					 | 
					  if next(azureutil.list_all_blobs(service, "openpilotci", prefix=key_prefix), None) is not None: | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return True | 
					 | 
					 | 
					 | 
					    return True | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  print(f"Uploading {route}") | 
					 | 
					 | 
					 | 
					  print(f"Uploading {route}") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  for (source_account, source_bucket), source_key in zip(SOURCES, SOURCE_KEYS): | 
					 | 
					 | 
					 | 
					  for (source_account, source_bucket), source_key in zip(SOURCES, source_keys): | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    print(f"Trying {source_account}/{source_bucket}") | 
					 | 
					 | 
					 | 
					    print(f"Trying {source_account}/{source_bucket}") | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    cmd = [ | 
					 | 
					 | 
					 | 
					    cmd = [ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "azcopy", | 
					 | 
					 | 
					 | 
					      "azcopy", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "copy", | 
					 | 
					 | 
					 | 
					      "copy", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      f"https://{source_account}.blob.core.windows.net/{source_bucket}/{key_prefix}?{source_key}", | 
					 | 
					 | 
					 | 
					      f"https://{source_account}.blob.core.windows.net/{source_bucket}/{key_prefix}?{source_key}", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      f"https://{_DATA_ACCOUNT_CI}.blob.core.windows.net/openpilotci/{dongle_id}?{DEST_KEY}", | 
					 | 
					 | 
					 | 
					      f"https://{_DATA_ACCOUNT_CI}.blob.core.windows.net/openpilotci/{dongle_id}?{dest_key}", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "--recursive=true", | 
					 | 
					 | 
					 | 
					      "--recursive=true", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "--overwrite=false", | 
					 | 
					 | 
					 | 
					      "--overwrite=false", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      "--exclude-pattern=*/dcamera.hevc", | 
					 | 
					 | 
					 | 
					      "--exclude-pattern=*/dcamera.hevc", | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |