Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 666469474
  • Loading branch information
colaboratory-team committed Sep 24, 2024
1 parent d324cf6 commit fab2597
Showing 1 changed file with 23 additions and 33 deletions.
56 changes: 23 additions & 33 deletions google/colab/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,41 +220,31 @@ def _mount(
'Drive File Stream encountered a problem and has stopped'
)
drive_exited = 'drive EXITED'
metadata_auth_arg = (
f'--metadata_server_auth_uri={metadata_server_addr}/computeMetadata/v1 '
)

d.sendline(
(
'( {d}/drive --features='
+ ','.join([
'crash_throttle_percentage:100',
'fuse_max_background:1000',
'max_read_qps:1000',
'max_write_qps:1000',
'max_operation_batch_size:15',
'max_parallel_push_task_instances:10',
'opendir_timeout_ms:{timeout_ms}',
'virtual_folders_omit_spaces:true',
'read_only_mode:{readonly}',
])
+ ' --inet_family='
+ inet_family
+ ' '
+ metadata_auth_arg
+ '--preferences=trusted_root_certs_file_path:{d}/roots.pem,mount_point_path:{mnt}'
' 2>&1 | grep --line-buffered -E'
' "{problem_and_stopped}|{domain_disabled_drivefs}"; echo'
' "{drive_exited}"; ) &'
).format(
d=drive_dir,
timeout_ms=timeout_ms,
mnt=mountpoint,
domain_disabled_drivefs=domain_disabled_drivefs,
problem_and_stopped=problem_and_stopped,
drive_exited=drive_exited,
readonly='true' if readonly else 'false',
)
'('
f' {drive_dir}/drive'
' --features='
'crash_throttle_percentage:100,'
'fuse_max_background:1000,'
'max_read_qps:1000,'
'max_write_qps:1000,'
'max_operation_batch_size:15,'
'max_parallel_push_task_instances:10,'
f'opendir_timeout_ms:{timeout_ms},'
'virtual_folders_omit_spaces:true,'
f'read_only_mode:{str(readonly).lower()}'
f' --inet_family={inet_family}'
f' --metadata_server_auth_uri={metadata_server_addr}/computeMetadata/v1'
' --preferences='
f'trusted_root_certs_file_path:{drive_dir}/roots.pem,'
'feature_flag_restart_seconds:129600,'
f'mount_point_path:{mountpoint}'
' 2>&1 |'
' grep --line-buffered -E'
f' "{problem_and_stopped}|{domain_disabled_drivefs}";'
f' echo "{drive_exited}";'
') &'
)
d.expect(prompt)
timeout_pattern = 'QueryManager timed out'
Expand Down

0 comments on commit fab2597

Please sign in to comment.