'tfmgr' problem while Integrating new template into TemplateFlow

Hi @oesteban and the templateflow users,
I have been working on merging a new adolescent template to templateFlow. While following the instructions from [Submitting a new template - TemplateFlow], I got some complain from the tfmgr tool.
It looks like the tfmgr tool has been updated after the tutorial is created, do you have experiences regarding this issue? Thanks! The template files and liscence are ready.
The GitHub issue is here: [Add template: China Typical school-age children · Issue #85 · templateflow/templateflow · GitHub].
Qing (Vincent)

Hi Qing,

We are currently revising the templateflow submission pipeline, and ironing around the corners (which are plenty). I will let you know over here as soon as the new processes are set in place.

Sorry about the inconvenience - we are overwhelmed with maintenance and responding much slower than we would like.


Thanks for your reply, I understand. Just take your time and we can deal with this problem later.
Qing (Vincent)

Hi, Oscar,
Hope everything goes well. How is the templateflow updating going? One of my friend just reminded me about the integration of the template.
Qing Wang (Vincent)

Hi Vincent,

We have just concluded an overhaul of the template submission system, and it should be ready for you to try. I can’t promise you won’t hit any snags, but it is way more reliable it used to be.

You’ll need:

  1. Install the development version of the manager: pip install git+https://github.com/templateflow/python-manager.git
  2. Make sure you have your username and password for https://osf.io ready. It will be easier if you set them with:
    export OSF_USERNAME='<your username, typically an e-mail>'
    export OSF_PASSWORD='<your password>'
  3. Make sure you have a GitHub account with personal access token with sufficient permissions (Creating a personal access token - GitHub Docs). Once you have this info, export it too:
    export GITHUB_TOKEN='ghp_<token>'
    Please note that GitHub has recently deprecated old tokens and now they must have a prefix like ghp_ to be valid.
  4. Organize your template with TemplateFlow’s structure and nomenclature. Make sure you have a template_description.json with all relevant metadata, such as species and funding sources. For now on, let’s say you create a copy with your files organized under $HOME/templateflow-outbound/tpl-NewTemplateID
  5. Initiate the submission process:
    pushd $HOME/templateflow-outbound
    tfmgr add tpl-NewTemplateID
    The tool will again ask for your github username and password (instead of the password, you should use your token again).

That should end with a PR automatically opened at https://github.com/templateflow/templateflow which we can review and give you feedback.

Let us know how it went down.


1 Like

Sorry for the huge delay, I just got the chance to push the template. Datalad seems to give me some issues, here are the datails:

  1. I have followd all the steps and it runs smoothly until the datalad step;
  2. After running tfmgr add tpl-NewTemplateID, It compains about git from datalad, what do you think?

Guess you are quite busy on OHBM and have fun!

Cloning into 'templateflow'...
remote: Enumerating objects: 295, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 295 (delta 0), reused 0 (delta 0), pack-reused 294
Receiving objects: 100% (295/295), 65.53 KiB | 906.00 KiB/s, done.
Resolving deltas: 100% (93/93), done.
Traceback (most recent call last):
  File "/home/vincent/anaconda3/bin/tfmgr", line 8, in <module>
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/tfmanager/cli.py", line 219, in add
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/interface/utils.py", line 447, in eval_func
    return return_func(*args, **kwargs)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/interface/utils.py", line 439, in return_func
    results = list(results)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/interface/utils.py", line 357, in generator_func
    for r in _process_results(
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/interface/utils.py", line 544, in _process_results
    for res in results:
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/core/local/create.py", line 375, in __call__
    tbrepo, add_to_git = _setup_annex_repo(
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/core/local/create.py", line 518, in _setup_annex_repo
    tbrepo = AnnexRepo(
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/dataset/repo.py", line 152, in __call__
    instance = type.__call__(cls, *new_args, **new_kwargs)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/support/annexrepo.py", line 202, in __init__
    super(AnnexRepo, self).__init__(
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/support/gitrepo.py", line 900, in __init__
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/dataset/gitrepo.py", line 573, in init
    stdout, stderr = self._call_git(
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/dataset/gitrepo.py", line 386, in _call_git
    for file_no, line in self._generator_call_git(args,
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/dataset/gitrepo.py", line 345, in _generator_call_git
    for file_no, content in generator:
  File "/home/vincent/anaconda3/lib/python3.8/_collections_abc.py", line 317, in __next__
    return self.send(None)
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/runner/nonasyncrunner.py", line 99, in send
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/runner/nonasyncrunner.py", line 81, in _check_result
  File "/home/vincent/anaconda3/lib/python3.8/site-packages/datalad/runner/nonasyncrunner.py", line 261, in _check_result
    raise CommandError(cmd=self.cmd,
datalad.runner.exception.CommandError: CommandError: 'git -c diff.ignoreSubmodules=none -C /tmp/tmpl3l3nmjv/templateflow/tpl-devCCNP2020Dong init --initial-branch=main' failed with exitcode 129 [err: 'error: unknown option `initial-branch=main'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree']```