alan-turing-institute / simulate

A web framework for research simulations.
http://simulate.readthedocs.io
MIT License
4 stars 1 forks source link

Clone case files from github #112

Open masonlr opened 6 years ago

masonlr commented 6 years ago

Description

It is much more convenient to store required case files as repositories.

Acceptance criteria

Out of scope

Implementation notes

masonlr commented 6 years ago

Idea is to support commit url, commit, path in scripts "source" attribute:

"scripts": [
    {
            "action": "",
            "destination": "constants.yml",
            "source": {
                "url": "https://raw.githubusercontent.com/alan-turing-institute/simulate",
                "commit": "69f3214b01ec46e4c357d73d565e9bacead6d228",
                "path": "foo.yml"
            }
        }
]

Manager would then download url+commit+path, i.e. https://raw.githubusercontent.com/alan-turing-institute/simulate/69f3214b01ec46e4c357d73d565e9bacead6d228/foo.yml.

masonlr commented 6 years ago

We can also support a repository attribute on the case object. If a case's repository is specified then the manager can clone the repo (via simulator-side ssh) prior to any patching.

"repository":  {
   "url": "git@github.com:alan-turing-institute/simulate.git",
   "commit": "69f3214b01ec46e4c357d73d565e9bacead6d228"
}

Simulator-side logic:

git clone git@github.com:alan-turing-institute/simulate.git job_id
cd job_id
git checkout 69f3214b01ec46e4c357d73d565e9bacead6d228

Or alternatively,

"repository":  {
   "url": "git@github.com:alan-turing-institute/simulate.git",
   "branch": "foo"
}

Simulator-side logic:

git clone git@github.com:alan-turing-institute/simulate.git --branch foo job_id
cd job_id
masonlr commented 6 years ago

Possible for operations to report back the frontend (travis-ci style):

image