Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config file, options #1

Open
wants to merge 540 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
540 commits
Select commit Hold shift + click to select a range
08ab89e
Update syncS3toS3.py
kkellerlbl Feb 25, 2021
5532dc9
Update syncS3toS3.py
kkellerlbl Feb 25, 2021
71dd1c7
Update syncS3toS3.py
kkellerlbl Feb 25, 2021
99cc762
Update syncS3toS3.py
kkellerlbl Feb 25, 2021
c83c54a
Update verifyBlobstoreS3.py
kkellerlbl Mar 3, 2021
9046671
Update verifyBlobstoreS3.py
kkellerlbl Mar 3, 2021
79e9200
Update syncS3toS3.py
kkellerlbl Mar 3, 2021
ca55bb0
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
78be00c
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
fa00125
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
8290e0f
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
aa300ff
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
d002c7c
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
c012b1b
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
b52703a
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
0d7842f
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
b081091
Use boto3 instead of mc to copy
kkellerlbl Mar 5, 2021
62fc42f
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
a849825
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
bd4c25c
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
38982d6
Update syncS3toS3.py
kkellerlbl Mar 5, 2021
5f07c84
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
d0dbeeb
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
a15f577
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
0874aa4
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
799f683
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
702bc6d
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
5c59165
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
f9ccbad
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
1bd2508
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
9254e18
Try using upload_fileobj
kkellerlbl Mar 6, 2021
4b12b1f
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
16d155c
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
461cc41
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
3e051f6
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
8d244b5
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
d108258
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
68b35de
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
7e6ca3b
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
7870d08
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
f85d73b
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
8c61be2
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
c295d98
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
e8788bf
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
9505fc3
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
82697db
Update syncS3toS3.py
kkellerlbl Mar 6, 2021
735baa0
Switch to python3
kkellerlbl Mar 9, 2021
27bb85f
Update syncS3toS3.py
kkellerlbl Mar 9, 2021
1ff5be3
Update syncS3toS3.py
kkellerlbl Mar 9, 2021
711ffc9
Update syncS3toS3.py
kkellerlbl Mar 9, 2021
5f664da
Update syncS3toS3.py
kkellerlbl Mar 9, 2021
e814eb7
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
b14902f
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
9edd3df
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
67e1b58
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
2349adb
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
570d5c8
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
e855f57
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
5f5df36
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
dda7852
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
5a38184
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
84e702c
Update syncS3toS3.py
kkellerlbl Mar 10, 2021
6c6ffc5
Update syncS3toS3.py
kkellerlbl Mar 11, 2021
c0c2965
Update syncS3toS3.py
kkellerlbl Mar 11, 2021
b11e7ee
Create syncS3blobstore.ini
kkellerlbl Mar 11, 2021
e23a7b5
Update syncS3ws.ini
kkellerlbl Mar 11, 2021
a3e0dca
Update syncS3blobstore.ini
kkellerlbl Mar 11, 2021
9de524e
Update syncS3toS3.py
kkellerlbl Mar 11, 2021
f2120f0
Update syncS3toS3.py
kkellerlbl Mar 11, 2021
a91a187
Update syncS3toS3.py
kkellerlbl Mar 11, 2021
df2e46f
Update verifyBlobstoreS3.py
kkellerlbl Mar 11, 2021
6425b4e
Update verifyBlobstoreS3.py
kkellerlbl Mar 11, 2021
bb6395d
Update verifyBlobstoreS3.py
kkellerlbl Mar 11, 2021
8d3b3cd
Update verifyBlobstoreS3.py
kkellerlbl Mar 11, 2021
897b044
Update verifyBlobstoreS3.py
kkellerlbl Mar 11, 2021
4e3273b
Merge pull request #8 from kbase/replacemc
kkellerlbl Mar 11, 2021
51eba95
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
7b52f10
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
be2fcd7
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
2b09211
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
16c2dea
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
00c98af
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
565c920
Update verifyWorkspaceS3.py
kkellerlbl Mar 12, 2021
b64bf5c
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
ed8ccc8
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
54821ff
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
65c2301
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
21317c3
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
b01cccc
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
185489c
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
1c2ed03
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
665f376
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
4f865fa
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
9bdd132
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
29bc443
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
89de37b
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
3dfe152
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
1d573d5
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
a196cb8
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
c54de90
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
e684582
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
a428b93
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
936b697
Update verifyWorkspaceS3.py
kkellerlbl Mar 13, 2021
29aafde
Update verifyWorkspaceS3.py
kkellerlbl Mar 16, 2021
b852855
Update verifyWorkspaceS3.py
kkellerlbl Mar 16, 2021
0863d2f
Update verifyWorkspaceS3.py
kkellerlbl Mar 16, 2021
2ed2bf0
Update verifyWorkspaceS3.py
kkellerlbl Mar 16, 2021
4ed2aa2
Update verifyWorkspaceS3.py
kkellerlbl Mar 16, 2021
b21967f
Merge pull request #9 from kbase/parallelVerify
kkellerlbl Mar 16, 2021
06327bc
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
611f4ca
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
f3f4747
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
bd7a4e0
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
26c5da3
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
22ae207
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
97cfcb7
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
f954729
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
da3b291
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
45d3698
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
a9fc2a4
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
086247f
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
361cb82
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
671f2fb
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
cc46f1b
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
2dacda8
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
9e0245a
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
fac9690
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
751566e
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
3f65338
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
e50fb00
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
6de4c30
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
3e5505c
Update verifyWorkspaceS3.py
kkellerlbl Mar 17, 2021
81c9be0
Create verifyMinio.py
kkellerlbl Mar 18, 2021
523c0c8
Rename verifyMinio.py to verifyS3.py
kkellerlbl Mar 18, 2021
8ba444e
Update verifyS3.py
kkellerlbl Mar 18, 2021
e1d6c8e
Update verifyS3.py
kkellerlbl Mar 18, 2021
e2c636a
Update verifyS3.py
kkellerlbl Mar 18, 2021
f029afe
Update verifyS3.py
kkellerlbl Mar 18, 2021
2fdcfad
Update verifyS3.py
kkellerlbl Mar 18, 2021
ff070e5
Update verifyS3.py
kkellerlbl Mar 18, 2021
32c4fbf
Update verifyS3.py
kkellerlbl Mar 18, 2021
b5ac140
Update verifyS3.py
kkellerlbl Mar 18, 2021
c110e32
Update verifyS3.py
kkellerlbl Mar 18, 2021
31d61ea
Update verifyS3.py
kkellerlbl Mar 18, 2021
77eb3c2
Update verifyS3.py
kkellerlbl Mar 18, 2021
d6546f6
Update verifyS3.py
kkellerlbl Mar 18, 2021
7dee286
Update verifyS3.py
kkellerlbl Mar 18, 2021
8749448
Update verifyS3.py
kkellerlbl Mar 18, 2021
f5b411b
Update verifyS3.py
kkellerlbl Mar 18, 2021
38956f2
Update verifyS3.py
kkellerlbl Mar 18, 2021
75ae98d
Update verifyS3.py
kkellerlbl Mar 18, 2021
aa5bb28
Update verifyS3.py
kkellerlbl Mar 18, 2021
e74639c
Update verifyS3.py
kkellerlbl Mar 18, 2021
a17528b
Update verifyS3.py
kkellerlbl Mar 18, 2021
87b794a
Update verifyS3.py
kkellerlbl Mar 18, 2021
1169332
Update verifyS3.py
kkellerlbl Mar 18, 2021
c148a72
Update verifyS3.py
kkellerlbl Mar 18, 2021
4138e4c
Update verifyS3.py
kkellerlbl Mar 18, 2021
623dc81
Update verifyS3.py
kkellerlbl Mar 18, 2021
d02d7ad
Update verifyS3.py
kkellerlbl Mar 18, 2021
476da0e
Update verifyS3.py
kkellerlbl Mar 18, 2021
6cd348e
Update verifyS3.py
kkellerlbl Mar 18, 2021
793eb83
Update verifyS3.py
kkellerlbl Mar 18, 2021
49e3aa9
Update verifyS3.py
kkellerlbl Mar 18, 2021
2c8ba2b
Update verifyS3.py
kkellerlbl Mar 18, 2021
e901f17
Update verifyS3.py
kkellerlbl Mar 18, 2021
6c570f6
Update verifyS3.py
kkellerlbl Mar 18, 2021
8fc8e6d
Update verifyS3.py
kkellerlbl Mar 18, 2021
a11f241
Update verifyS3.py
kkellerlbl Mar 18, 2021
616be81
Rename verifyBlobstoreS3.py to attic/verifyBlobstoreS3.py
kkellerlbl Mar 18, 2021
5960e99
Rename verifyWorkspaceS3.py to attic/verifyWorkspaceS3.py
kkellerlbl Mar 18, 2021
a66dd54
Update and rename config.ini to example-config.ini
kkellerlbl Mar 18, 2021
1cb3f0a
Update syncS3ws.ini
kkellerlbl Mar 18, 2021
5ba23ee
Update syncS3blobstore.ini
kkellerlbl Mar 18, 2021
5367dbd
Update syncS3ws.ini
kkellerlbl Mar 18, 2021
46aebd7
Update verifyS3.py
kkellerlbl Jun 18, 2021
8623d00
Update verifyS3.py
kkellerlbl Jun 18, 2021
eb8f94a
Update verifyS3.py
kkellerlbl Jun 22, 2021
571ae8b
Update verifyS3.py
kkellerlbl Jun 22, 2021
0cf0c88
Update verifyS3.py
kkellerlbl Jun 22, 2021
9afd186
Update verifyS3.py
kkellerlbl Jun 22, 2021
e666f19
Update verifyS3.py
kkellerlbl Jun 22, 2021
f1cb272
Update verifyS3.py
kkellerlbl Jun 22, 2021
d674682
Update verifyS3.py
kkellerlbl Jun 22, 2021
d71bd48
Update verifyS3.py
kkellerlbl Jun 22, 2021
3f96ada
Update verifyS3.py
kkellerlbl Jun 22, 2021
9e99140
Update verifyS3.py
kkellerlbl Jun 23, 2021
96ee0c9
Update verifyS3.py
kkellerlbl Jun 25, 2021
0682ef0
Update verifyS3.py
kkellerlbl Jun 25, 2021
b2b4a2f
Update verifyS3.py
kkellerlbl Aug 4, 2021
62bda4c
Update verifyS3.py
kkellerlbl Aug 5, 2021
21aa541
Update verifyS3.py
kkellerlbl Aug 5, 2021
3b9ce13
Update verifyS3.py
kkellerlbl Aug 6, 2021
c4ab56e
add new exception for put_object
kkellerlbl Sep 21, 2021
810c330
Update syncS3toS3.py
kkellerlbl Sep 21, 2021
63a2b00
Normalize filename metadata to ASCII
kkellerlbl Sep 22, 2021
e4da1dc
check for key
kkellerlbl Sep 22, 2021
58aa758
Update syncS3toS3.py
kkellerlbl Sep 24, 2021
d783265
Update syncS3toS3.py
kkellerlbl Sep 24, 2021
37bd9d0
Update syncS3toS3.py
kkellerlbl Sep 24, 2021
6fdf91b
Update syncS3toS3.py
kkellerlbl Sep 24, 2021
5031388
Merge pull request #10 from kbase/nonascii
kkellerlbl Sep 24, 2021
54ef7d3
Update verifyS3.py
kkellerlbl Sep 29, 2021
4f526b3
Update syncS3toS3.py
kkellerlbl Sep 29, 2021
ba27a40
storageclass key
kkellerlbl Sep 29, 2021
31eeff0
Update syncS3toS3.py
kkellerlbl Sep 29, 2021
f9f75ac
Rename shockMongoRecordsToS3.py to attic/shockMongoRecordsToS3.py
kkellerlbl Oct 19, 2021
59c914e
Rename shockNodeList.py to attic/shockNodeList.py
kkellerlbl Oct 19, 2021
fd19fe6
Rename workspaceShockToS3.py to attic/workspaceShockToS3.py
kkellerlbl Oct 19, 2021
3ccf68d
Update syncS3toS3.py
kkellerlbl Oct 19, 2021
321acb6
Update syncS3ws.ini
kkellerlbl Oct 20, 2021
e423c7e
Update syncS3toS3.py
kkellerlbl Oct 20, 2021
0e836b2
Update syncS3toS3.py
kkellerlbl Oct 21, 2021
b2eae59
Update syncS3toS3.py
kkellerlbl Oct 21, 2021
ef60bc3
Update syncS3toS3.py
kkellerlbl Oct 21, 2021
bbf7503
Update syncS3toS3.py
kkellerlbl Oct 21, 2021
4c2b72e
Update syncS3toS3.py
kkellerlbl Oct 21, 2021
b7492fe
Update syncS3toS3.py
kkellerlbl Oct 26, 2021
59bbe35
Update syncS3toS3.py
kkellerlbl Oct 26, 2021
66be3d9
Update syncS3toS3.py
kkellerlbl Oct 27, 2021
b2ba030
Merge pull request #11 from kbase/storageClasses
kkellerlbl Oct 27, 2021
4079307
Update verifyS3.py
kkellerlbl Jan 13, 2022
bcb7ecb
Update verifyS3.py
kkellerlbl Jan 13, 2022
d15c638
--disable-multipart option
kkellerlbl Jan 13, 2022
ee6ab72
Update syncS3ws.ini
kkellerlbl Jan 13, 2022
a177d1f
Update syncS3blobstore.ini
kkellerlbl Jan 13, 2022
165da4f
Update syncS3toS3.py
kkellerlbl Jan 13, 2022
f468f6d
Update verifyS3.py
kkellerlbl Mar 1, 2022
03af0d4
Update verifyS3.py
kkellerlbl Mar 1, 2022
1b1703d
Update verifyS3.py
kkellerlbl Mar 1, 2022
96cf52a
Update verifyS3.py
kkellerlbl Mar 1, 2022
941e069
Update verifyS3.py
kkellerlbl Mar 1, 2022
82db3e6
Create Dockerfile
bio-boris Dec 23, 2022
26e73e8
Create release-main.yml
bio-boris Dec 23, 2022
e32860b
Create pr_build.yml
bio-boris Dec 23, 2022
442cc63
Create manual-build.yml
bio-boris Dec 23, 2022
93767a5
Update README.md
bio-boris Dec 23, 2022
c022952
Update README.md
bio-boris Dec 23, 2022
2ba0fd3
Merge pull request #12 from kbase/disable-multipart
kkellerlbl Dec 23, 2022
f04b415
Merge pull request #13 from kbase/add-dockerfile
jsfillman Jan 3, 2023
0bd57c8
Updating to test failed CI push (due to URL)
jsfillman Jan 3, 2023
4ae822d
Merge pull request #14 from kbase/add-dockerfile
jsfillman Jan 3, 2023
85e0161
Update syncS3blobstore.ini
kkellerlbl Mar 23, 2023
8b4ac22
Update syncS3blobstore.ini
kkellerlbl Mar 23, 2023
48751e5
Update syncS3blobstore.ini
kkellerlbl Mar 23, 2023
ab3ff25
Update syncS3toS3.py
kkellerlbl Apr 5, 2023
5106fa4
Update verifyS3.py
kkellerlbl Apr 5, 2023
117136d
Merge pull request #15 from kbase/remove-botocore-vendored
kkellerlbl Apr 5, 2023
46ef2e7
Update syncS3toS3.py
kkellerlbl Apr 6, 2023
8d30ff4
Merge pull request #16 from kbase/insecure-mc
kkellerlbl Apr 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Manual Build & Push
on:
workflow_dispatch:
jobs:
build-push:
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: br-${{ github.ref_name }}
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Pull Request Build, Tag, & Push
on:
pull_request:
branches:
- develop
- main
- master
types:
- opened
- reopened
- synchronize
- closed
jobs:
build-develop-open:
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build.yml@main
secrets: inherit
build-develop-merge:
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: pr-${{ github.event.number }},latest
secrets: inherit
build-main-open:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }}
secrets: inherit
build-main-merge:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }},latest-rc
secrets: inherit
trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release - Build & Push Image
on:
release:
branches:
- main
- master
types: [ published ]
jobs:
check-source-branch:
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
with:
build_branch: '${{ github.event.release.target_commitish }}'
validate-release-tag:
needs: check-source-branch
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
with:
release_tag: '${{ github.event.release.tag_name }}'
build-push:
needs: validate-release-tag
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: '${{ github.event.release.tag_name }},latest'
secrets: inherit
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.9.16
RUN apt-get update
RUN apt-get install -y vim

RUN curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \
-o $HOME/minio-binaries/mc

RUN chmod +x $HOME/minio-binaries/mc
RUN mv $HOME/minio-binaries/mc /bin/mc

RUN pip install boto3 pymongo
RUN mkdir /s3transfer
COPY *.py /s3transfer/
COPY *.ini /s3transfer/
WORKDIR /s3transfer
ENTRYPOINT ["/bin/bash", "-c"]
CMD "/bin/sleep"
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Shock to S3 scripts

Scripts for moving / transforming KBase data files and database records as part of the Shock to S3 data storage conversion.
Scripts for moving and transforming KBase data files and database records as part of the Shock to S3 data storage conversion.

# Transferring S3 to S3
* Use syncs3tos3.py
* fill out syncs3blobstore.ini example config file
* you may need to edit /etc/hosts for mongo replicas to correctly get queried e.g

```
X.X.1.1 next01
X.X.1.6 next06
```
* for the first run, it will create a "now" file with the timestamp. You can cancel the run, and edit the file, and set the date to the year 2000
* you can monitor progress in the rsync log at blobstoresync.log
* it may help to enable debug mode or add print statements to help figure out what the script is doing
219 changes: 219 additions & 0 deletions attic/shockMongoRecordsToS3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
#!/usr/bin/env python3

'''
This script converts a subset of Shock (https://github.com/kbase/Shock) node records to
BlobStore (https://github.com/kbase/blobstore) records in MongoDB only.
The script does not alter the Shock backend records and may be re-run multiple times without issue.
It also does not copy any files to S3.

The script expects key names based on a uuid in the same way Shock directories are
based on the UUID; for example the UUID 06f5d3ec-8ebf-4d32-8c1c-41e27e40b7fd would be

06/f5/d3/06f5d3ec-8ebf-4d32-8c1c-41e27e40b7fd

... as a key in S3 or a directory tree in Shock.

To use:
1) Start the blobstore at least once so that the proper indexes are created in MongoDB.
2) Fill in the configuration variables below and run the script normally.
'''

import configparser
import argparse
import datetime
import uuid
from pprint import pprint
from pymongo.mongo_client import MongoClient
from pymongo import UpdateOne
from pymongo.errors import ServerSelectionTimeoutError
from pymongo.errors import BulkWriteError

parser = argparse.ArgumentParser(description='Import Shock Mongo data to blobstore Mongo.')
parser.add_argument('--config-file', dest='configfile', required=True,
help='Path to config file (INI format). (required)')
args = parser.parse_args()

configfile=args.configfile
conf=configparser.ConfigParser()
conf.read(configfile)

###### CONFIGURATION VARIABLES ######

CONFIG_MONGO_SHOCK_HOST = conf['shock']['mongo_host']
CONFIG_MONGO_SHOCK_DATABASE = conf['shock']['mongo_database']
CONFIG_MONGO_SHOCK_USER = conf['shock']['mongo_user']
CONFIG_MONGO_SHOCK_PWD = conf['shock']['mongo_pwd']

CONFIG_MONGO_BLOBSTORE_HOST = conf['blobstore']['mongo_host']
CONFIG_MONGO_BLOBSTORE_DATABASE = conf['blobstore']['mongo_database']
CONFIG_MONGO_BLOBSTORE_USER = conf['blobstore']['mongo_user']
CONFIG_MONGO_BLOBSTORE_PWD = conf['blobstore']['mongo_pwd']

CONFIG_SHOCK_WS_UUID = conf['shock']['ws_uuid']

# dumb but lazy
CONFIG_START_YEAR = conf['shock']['start_year'] or 2000
CONFIG_START_MONTH = conf['shock']['start_month'] or 1
CONFIG_START_DAY = conf['shock']['start_day'] or 1
CONFIG_END_YEAR = conf['shock']['end_year'] or 2037
CONFIG_END_MONTH = conf['shock']['end_month'] or 12
CONFIG_END_DAY = conf['shock']['end_day'] or 28

CONFIG_START_DATE = datetime.datetime(int(CONFIG_START_YEAR),int(CONFIG_START_MONTH),int(CONFIG_START_DAY),0,0,0)
CONFIG_END_DATE = datetime.datetime(int(CONFIG_END_YEAR),int(CONFIG_END_MONTH),int(CONFIG_END_DAY),0,0,0)

CONFIG_BATCH_SIZE = 10000

#### END CONFIGURATION VARIABLES ####

BS_COL_NODES = 'nodes'
BS_COL_USERS = 'users'

BS_KEY_USERS_ID = 'id'
BS_KEY_USERS_USER = 'user'

BS_KEY_NODES_ID = 'id'
BS_KEY_NODES_OWNER = 'own'
BS_KEY_NODES_READERS = 'read'
BS_KEY_NODES_FILENAME = 'fname'
BS_KEY_NODES_FORMAT = 'fmt'
BS_KEY_NODES_SIZE = 'size'
BS_KEY_NODES_MD5 = 'md5'
BS_KEY_NODES_STORED = 'time'
BS_KEY_NODES_PUBLIC = 'pub'


SHOCK_COL_NODES = 'Nodes'
SHOCK_COL_USERS = 'Users'

SHOCK_KEY_USERS_ID = 'uuid'
SHOCK_KEY_USERS_USER = 'username'

SHOCK_KEY_NODES_ID = 'id'
SHOCK_KEY_NODES_CREATED = 'created_on'
SHOCK_KEY_NODES_FILE = 'file'
SHOCK_KEY_NODES_FILE_NAME = 'name'
SHOCK_KEY_NODES_FILE_SIZE = 'size'
SHOCK_KEY_NODES_FILE_CHKSUM = 'checksum'
SHOCK_KEY_NODES_FILE_CHKSUM_MD5 = 'md5'
SHOCK_KEY_NODES_FILE_FORMAT = 'format'
SHOCK_KEY_NODES_ACLS = 'acl'
SHOCK_KEY_NODES_ACLS_OWNER = 'owner'
SHOCK_KEY_NODES_ACLS_READERS = 'read'
SHOCK_KEY_NODES_ACLS_PUBLIC = 'public'

def main():
shockdb = get_mongo_client(CONFIG_MONGO_SHOCK_HOST, CONFIG_MONGO_SHOCK_DATABASE,
CONFIG_MONGO_SHOCK_USER, CONFIG_MONGO_SHOCK_PWD)[CONFIG_MONGO_SHOCK_DATABASE]
bsdb = get_mongo_client(CONFIG_MONGO_BLOBSTORE_HOST, CONFIG_MONGO_BLOBSTORE_DATABASE,
CONFIG_MONGO_BLOBSTORE_USER, CONFIG_MONGO_BLOBSTORE_PWD)[CONFIG_MONGO_BLOBSTORE_DATABASE]

query = { 'acl.owner': { '$ne': CONFIG_SHOCK_WS_UUID }, 'created_on': { '$gt': CONFIG_START_DATE, '$lt': CONFIG_END_DATE } }
# print(query)

totalNodes = shockdb[SHOCK_COL_NODES].count_documents(query)

count = 0
seenusers = {}
doc_update_list = []
lastPrint = 'Processed {}/{} records'.format(count,totalNodes)
print (lastPrint)

for node in shockdb[SHOCK_COL_NODES].find(query,batch_size=CONFIG_BATCH_SIZE,no_cursor_timeout=True):
# print(node['id'])
#print (node['id'][0:2] + '/' + node['id'][2:4] + '/' + node['id'][4:6] + '/' + node['id'] + '/' + node['id'] + '.data')

bsnode = toBSNode(node, seenusers, shockdb, bsdb)
# pprint(bsnode)
doc_update_list.append(UpdateOne(
{ BS_KEY_NODES_ID: node['id'] } ,
{ '$set': bsnode }
, upsert=True
))

# bsdb[BS_COL_NODES].update_one({BS_KEY_NODES_ID: node}, {'$set': bsnode}, upsert=True)
count += 1

if len(doc_update_list) % CONFIG_BATCH_SIZE == 0:
bulk_update_blobstore_nodes(bsdb, doc_update_list)
doc_update_list = []

if count % CONFIG_BATCH_SIZE == 0:
lastPrint = 'Processed {}/{} records'.format(count,totalNodes)
print (lastPrint)

# last update
if len(doc_update_list) > 0:
bulk_update_blobstore_nodes(bsdb, doc_update_list)
lastPrint = 'Processed {}/{} records'.format(count,totalNodes)
print(lastPrint)

def toBSNode(shocknode, seenusers, shockdb, bsdb):
n = shocknode
# pprint(n['id'])
owner = n[SHOCK_KEY_NODES_ACLS][SHOCK_KEY_NODES_ACLS_OWNER]
try:
md5 = n[SHOCK_KEY_NODES_FILE][SHOCK_KEY_NODES_FILE_CHKSUM][SHOCK_KEY_NODES_FILE_CHKSUM_MD5]
except KeyError:
pprint('node ' + n['id'] + ' has no md5, assigning None')
md5 = None
readers = n[SHOCK_KEY_NODES_ACLS][SHOCK_KEY_NODES_ACLS_READERS]
pub = SHOCK_KEY_NODES_ACLS_PUBLIC in readers
while SHOCK_KEY_NODES_ACLS_PUBLIC in readers: readers.remove(SHOCK_KEY_NODES_ACLS_PUBLIC)

bsnode = {
BS_KEY_NODES_ID: n[SHOCK_KEY_NODES_ID],
BS_KEY_NODES_OWNER: get_user(owner, seenusers, shockdb, bsdb),
BS_KEY_NODES_READERS: [get_user(r, seenusers, shockdb, bsdb) for r in readers],
BS_KEY_NODES_STORED: n[SHOCK_KEY_NODES_CREATED],
BS_KEY_NODES_FILENAME: n[SHOCK_KEY_NODES_FILE][SHOCK_KEY_NODES_FILE_NAME],
BS_KEY_NODES_SIZE: n[SHOCK_KEY_NODES_FILE][SHOCK_KEY_NODES_FILE_SIZE],
BS_KEY_NODES_FORMAT: n[SHOCK_KEY_NODES_FILE][SHOCK_KEY_NODES_FILE_FORMAT],
BS_KEY_NODES_MD5: md5,
BS_KEY_NODES_PUBLIC: pub,
}
return bsnode

def get_user(uuid, seenusers, shockdb, bsdb):
if uuid in seenusers:
return {BS_KEY_USERS_ID: uuid, BS_KEY_USERS_USER: seenusers[uuid]}

u = shockdb[SHOCK_COL_USERS].find_one({SHOCK_KEY_USERS_ID: uuid})
if not u:
raise ValueError('Missing user in Shock ' + uuid)
bsdb[BS_COL_USERS].update_one(
{BS_KEY_USERS_ID: uuid},
{'$set': {BS_KEY_USERS_USER: u[SHOCK_KEY_USERS_USER]}},
upsert=True)
seenusers[uuid] = u[SHOCK_KEY_USERS_USER]
return {BS_KEY_USERS_ID: uuid, BS_KEY_USERS_USER: u[SHOCK_KEY_USERS_USER]}

def toUUID(s3key):
u = s3key.split('/')
uuidStr = u[3]
if uuidStr[0:2] != u[0] or uuidStr[2:4] != u[1] or uuidStr[4:6] != u[2]:
raise ValueError("Illegal S3 key: " + uuidStr)
try:
uuid.UUID(hex=uuidStr)
except TypeError as _:
raise ValueError("Illegal S3 key: " + uuidStr)
return uuidStr

def get_mongo_client(host, db, user, pwd):
if user:
return MongoClient(host, authSource=db, username=user, password=pwd, retryWrites=False)
else:
return MongoClient(host, retryWrites=False)


def bulk_update_blobstore_nodes(db, doc_update_list):
try:
update_result = db[BS_COL_NODES].bulk_write(doc_update_list,ordered=False)
except BulkWriteError as bwe:
print(bwe.details)
print('nInserted: ' + str(update_result.bulk_api_result['nInserted']) + ' ; nUpserted: ' + str(update_result.bulk_api_result['nUpserted']) + ' ; writeErrors: ' + str(update_result.bulk_api_result['writeErrors']))
# pprint(update_result.bulk_api_result)

if __name__ == '__main__':
main()

Loading