neuronsimulator / nrn-modeldb-ci

NEURON ModelDB CI tools
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

modeldb-meta.yaml clone or copy a local repository #111

Open nrnhines opened 9 months ago

nrnhines commented 9 months ago

github: "local: /path/to/repository" github: "copy: /path/to/parentfolder"

This is currently in the form of an ugly hack, but I found the workflow it supports to be very convenient. I think it would be straightforward to clean up the implementation.

Local repository clone

                # Using
                #  github: "local: /path/to/repository"
                # in modeldb-run.yaml implies that we 'git clone /path/to/repository'.
                # This is useful to tentatively explore the effect of
                # model changes on results with different nrn versions
                # without committing to github or before being ready to
                # make a pull request

and even more convenient is a local repository copy

               # Using
                #  github: "copy: /path/to/parentfolder"
                # in modeldb-run.yaml implies that we
                #  'cp -R /path/to/parentfolder/<id> <workingdir>'
                # A copy differs from a clone in that local changes in
                # the checkout are mirrored in the copy without having to
                # be committed. Note the copy leaves out the .git and
                # x86_64 folders.

though I haven't yet bothered to leave out the .git or x86_64 folders

One improvment might be to specify a list of ids in a separate yaml file with a format like

id:
  clone:  /path/to/parent/where/id/is/located
id:
  copy: /path/to/parent/where/id/is/located

in order to avoid temporary changes to modeldb/modeldb-run.yaml

I found the copy to be more useful than the clone so copy alone would suffice. In fact it would probably suffice merely to have an environment variable like

export MODELDB_LOCAL_REPOSITORIES=$HOME/models/modeldb

and any id folder at that location that matches an id specified in getmodels or runmodels is copied from there