|
3 | 3 | """ |
4 | 4 | docker exec -ti codalab_rest-server_1 bash |
5 | 5 | cd /data/codalab0/migration |
6 | | -python codalab-worksheets/scripts/migrate-disk-to-blob.py |
| 6 | +time python codalab-worksheets/scripts/migrate-disk-to-blob.py -p 4 -i 0 -TUVC |
| 7 | +time python codalab-worksheets/scripts/migrate-disk-to-blob.py -p 4 -i 1 -TUVC |
| 8 | +time python codalab-worksheets/scripts/migrate-disk-to-blob.py -p 4 -i 2 -TUVC |
| 9 | +time python codalab-worksheets/scripts/migrate-disk-to-blob.py -p 4 -i 3 -TUVC |
| 10 | +
|
| 11 | +Took ~1 week. |
7 | 12 | """ |
8 | 13 |
|
9 | 14 | import multiprocessing |
@@ -164,7 +169,10 @@ def write_migration_states(self): |
164 | 169 |
|
165 | 170 | def get_bundle_uuids(self, max_bundles): |
166 | 171 | bundle_uuids = self.model.get_all_bundle_uuids(max_results=1e9) |
167 | | - return sorted(list(set(bundle_uuids)))[:max_bundles] |
| 172 | + bundle_uuids = sorted(list(set(bundle_uuids))) |
| 173 | + if max_bundles: |
| 174 | + bundle_uuids = bundle_uuids[:max_bundles] |
| 175 | + return bundle_uuids |
168 | 176 |
|
169 | 177 | def is_linked_bundle(self, bundle_uuid): |
170 | 178 | bundle_link_url = self.model.get_bundle_metadata( |
@@ -514,7 +522,7 @@ def migrate_bundles(self, bundle_uuids): |
514 | 522 | for i, uuid in enumerate(bundle_uuids): |
515 | 523 | self.migrate_bundle(f"{i}/{total}", uuid) |
516 | 524 | now = time.time() |
517 | | - if i == len(bundle_uuids) - 1 or now - self.last_write_time > 60: # 1 minute |
| 525 | + if i == len(bundle_uuids) - 1 or now - self.last_write_time > 20: # every N seconds |
518 | 526 | self.log_times() |
519 | 527 | self.write_migration_states() |
520 | 528 | self.last_write_time = now |
@@ -561,7 +569,7 @@ def run_job(target_store_name, upload, change_db, verify, delete_disk, delete_ta |
561 | 569 |
|
562 | 570 | if __name__ == '__main__': |
563 | 571 | parser = argparse.ArgumentParser() |
564 | | - parser.add_argument('-m', '--max-bundles', type=int, help='Maximum number of bundles to migrate', default=1e9) |
| 572 | + parser.add_argument('-m', '--max-bundles', type=int, help='Maximum number of bundles to migrate') |
565 | 573 | parser.add_argument('-u', '--bundle-uuids', type=str, nargs='*', default=None, help='List of bundle UUIDs to migrate.') |
566 | 574 | parser.add_argument('-t', '--target-store-name', type=str, help='The destination bundle store name', default="blob-prod") |
567 | 575 | parser.add_argument('-U', '--upload', help='Upload', action='store_true') |
|
0 commit comments