add repo templates, fix s3 export

This commit is contained in:
bpinsard 2024-01-30 13:43:32 -05:00
parent b6053a4c47
commit ad5eb5bbb6
10 changed files with 59 additions and 5 deletions

View File

@ -426,19 +426,21 @@ def export_to_s3(
# TODO: check if we can reuse a single bucket (or per study) with fileprefix # TODO: check if we can reuse a single bucket (or per study) with fileprefix
# git-annex initremote remotename ... # git-annex initremote remotename ...
remote_name = s3_url.hostname remote_name = s3_url.hostname
bucket_name, path = pathlib.Path(s3_url.path).parts _, bucket_name, *fileprefix = pathlib.Path(s3_url.path).parts
ds.repo.initremote( fileprefix.append(session_metas['StudyInstanceUID']+'/')
ds.repo.init_remote(
remote_name, remote_name,
S3_REMOTE_DEFAULT_PARAMETERS S3_REMOTE_DEFAULT_PARAMETERS
+ [ + [
f"host={s3_url.hostname}", f"host={s3_url.hostname}",
f"bucket={bucket_name}", f"bucket={bucket_name}",
f"fileprefix={'/'.join(path)}", f"fileprefix={'/'.join(fileprefix)}",
], ],
) )
ds.repo.set_preferred_content( ds.repo.set_preferred_content(
remote_name, "wanted",
"include=**.{7z,tar.gz,zip}", "include=*7z or include=*.tar.gz or include=*zip",
remote=remote_name,
) )
ds.push(to=remote_name) ds.push(to=remote_name)

View File

@ -0,0 +1,5 @@
{
"files": [
"README"
]
}

View File

@ -0,0 +1,3 @@
**/anat/*localizer*
**/anat/*scout*
**/*__dup*

View File

@ -0,0 +1 @@
qc/mriqc

View File

@ -0,0 +1,13 @@
**/.git* annex.largefiles=nothing
* annex.largefiles=(largerthan=100kb)
*.yml annex.largefiles=nothing
*.json annex.largefiles=nothing
*.txt annex.largefiles=nothing
*.tsv annex.largefiles=nothing
*.nii.gz annex.largefiles=anything
*.tgz annex.largefiles=anything
*_scans.tsv annex.largefiles=anything
# annex event files as they contain subjects behavioral responses
sub-*/**/*_events.tsv annex.largefiles=anything
*.bk2 annex.largefiles=anything
.bidsignore annex.largefiles=nothing

View File

@ -0,0 +1,2 @@
.pybids_cache/**
.heudiconv

View File

@ -0,0 +1,4 @@
include:
- project: 'unf/ni-dataops'
file:
- 'ci-pipelines/bids/bids_repo.yml'

View File

@ -0,0 +1,6 @@
# xyz dataset
## Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- ALL-CONTRIBUTORS-LIST:END -->

View File

@ -0,0 +1,12 @@
**/.git* annex.largefiles=nothing
* annex.largefiles=(largerthan=100kb)
*.yml annex.largefiles=nothing
*.json annex.largefiles=nothing
*.txt annex.largefiles=nothing
*.tsv annex.largefiles=nothing
*.nii.gz annex.largefiles=anything
*.tgz annex.largefiles=anything
*_scans.tsv annex.largefiles=anything
# annex event files as they contain subjects behavioral responses
sub-*/**/*_events.tsv annex.largefiles=anything
*.bk2 annex.largefiles=anything

View File

@ -0,0 +1,6 @@
include:
- local: /ci-env.yml
- project: 'unf/ni-dataops'
file:
- 'ci-pipelines/sources/dicoms_study.yml'