From Fedora Project Wiki
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Getting Waiting Builds From Frontend ==
== Getting Waiting Builds From Frontend ==


To get 10 oldest submitted builds, use http://deployed_frontend_instance/waiting_builds/ - JSON is returned by default, example response:
To get 10 oldest submitted builds (this is currently a hardcoded default, do we want anything else?), use http://deployed_frontend_instance/waiting_builds/ - JSON is returned by default, example response:


<pre>
<pre>
Line 20: Line 20:
         "name": "ff2"
         "name": "ff2"
       },
       },
      "canceled": false,
       "submitted_on": 1351157544,
       "submitted_on": 1351157544,
       "ended_on": null,
       "ended_on": null,
       "pkgs": "http://foo/pkg.src.rpm",
       "pkgs": "http://foo/pkg.src.rpm",
      "chroots": "fedora-17-i386 fedora-17-x86_64",
       "id": 5
       "id": 5
     },
     },
Line 33: Line 35:
         "owner_id": 1,
         "owner_id": 1,
         "repos": "http://foo/repo http://bar/repo",
         "repos": "http://foo/repo http://bar/repo",
         "chroots": "fedora-rawhide-i386 fedora-rawhide-x86_64",
         "chroots": "fedora-rawhide-i386",
         "id": 3,
         "id": 3,
         "name": "baz"
         "name": "baz"
       },
       },
      "canceled": false,
       "submitted_on": 1351153692,
       "submitted_on": 1351153692,
       "ended_on": null,
       "ended_on": null,
       "pkgs": "http://foo/pkg-1.src.rpm http://foo/spam-2.src.rpm",
       "pkgs": "http://foo/pkg-1.src.rpm http://foo/spam-2.src.rpm",
      "chroots": "fedora-rawhide-i386",
       "id": 4
       "id": 4
     },
     },
Line 47: Line 51:


  * When multiple items are present in an entry (pkgs, chroots, repos), they are always separated by one space.
  * When multiple items are present in an entry (pkgs, chroots, repos), they are always separated by one space.
* All chroots for a single copr always have the same Fedora/epel release, but may contain more architectures.
* Each repo must point to a url, that has to contain arch specific dirs (i386/x86_64), each containing repodata dir (like koji has it).
* EDIT [Oct 29]: the build now has a "chroots" attribute too, because chroots of a copr can change before it is built - and we want to build what was submitted => the chroots from the build should be used.
* EDIT [Oct 29]: the build now has a "canceled" attribute - canceled builds will not be listed in waiting builds any more (do we want to support canceling builds on backend, or will we just throw the results away?)
* EDIT [Oct 30]: it may be useful to have "successful" attribute, that would show the result state - could the backend be modified to push an information like that?


Questions:
=== New Draft ===
* What the repos should be: repofiles or urls of the actual repos?
 
* Do we want separate repos for different chroots in one copr (as in "fedora-rawhide-i386: foo-i386", "fedora-rawhide-x86_64: foo-x86_64") or it doesn't matter?
<pre>
{
  "builds": [
    {
      "user_id": 1, # id of user who submitted the build
      "submitted_on": 1351770919,
      "repos": "http://repo", # urls of repos to add to mock chroot, separated by space
      "results": null,
      "started_on": null,
      "copr": {
        "owner": {
          "id": 1, # id of the owner of copr (not necessarily the same as user_id above)
          "name": "bkabrda" # FAS name of the user
        },
        "name": "asd", # name of the copr
        "id": 1 # id of copr
      },
      "canceled": false, # non-canceled builds will not show up here, I can put this away, too
      "ended_on": null,
      "pkgs": "http://package", # urls of packages to build, separated by space
      "chroots": "fedora-16-i386 fedora-16-x86_64", # chroots to build in, separated by space
      "timeout": 1800, # timeout in seconds, defaults to 30 minutes
      "memory_reqs": 2048, # required memory in MB, defaults to 2GB
      "id": 14 # id of the build
    }
  ]
}
</pre>
 
* [Nov 6]: Added memory_reqs and timeout. Are the default values ok?

Latest revision as of 12:05, 6 November 2012

BuildSys Frontend <-> Backend API

Getting Waiting Builds From Frontend

To get 10 oldest submitted builds (this is currently a hardcoded default, do we want anything else?), use http://deployed_frontend_instance/waiting_builds/ - JSON is returned by default, example response:

{
  "builds": [
    {
      "copr_id": 5,
      "user_id": 1,
      "results": null,
      "started_on": null,
      "copr": {
        "owner_id": 2,
        "repos": null,
        "chroots": "fedora-17-i386 fedora-17-x86_64",
        "id": 5,
        "name": "ff2"
      },
      "canceled": false,
      "submitted_on": 1351157544,
      "ended_on": null,
      "pkgs": "http://foo/pkg.src.rpm",
      "chroots": "fedora-17-i386 fedora-17-x86_64",
      "id": 5
    },
    {
      "copr_id": 3,
      "user_id": 1,
      "results": null,
      "started_on": null,
      "copr": {
        "owner_id": 1,
        "repos": "http://foo/repo http://bar/repo",
        "chroots": "fedora-rawhide-i386",
        "id": 3,
        "name": "baz"
      },
      "canceled": false,
      "submitted_on": 1351153692,
      "ended_on": null,
      "pkgs": "http://foo/pkg-1.src.rpm http://foo/spam-2.src.rpm",
      "chroots": "fedora-rawhide-i386",
      "id": 4
    },
  ]
}
* When multiple items are present in an entry (pkgs, chroots, repos), they are always separated by one space.
* All chroots for a single copr always have the same Fedora/epel release, but may contain more architectures.
* Each repo must point to a url, that has to contain arch specific dirs (i386/x86_64), each containing repodata dir (like koji has it).
* EDIT [Oct 29]: the build now has a "chroots" attribute too, because chroots of a copr can change before it is built - and we want to build what was submitted => the chroots from the build should be used.
* EDIT [Oct 29]: the build now has a "canceled" attribute - canceled builds will not be listed in waiting builds any more (do we want to support canceling builds on backend, or will we just throw the results away?)
* EDIT [Oct 30]: it may be useful to have "successful" attribute, that would show the result state - could the backend be modified to push an information like that?

New Draft

{
  "builds": [
    {
      "user_id": 1, # id of user who submitted the build
      "submitted_on": 1351770919,
      "repos": "http://repo", # urls of repos to add to mock chroot, separated by space
      "results": null,
      "started_on": null,
      "copr": {
        "owner": {
          "id": 1, # id of the owner of copr (not necessarily the same as user_id above)
          "name": "bkabrda" # FAS name of the user
        },
        "name": "asd", # name of the copr
        "id": 1 # id of copr
      },
      "canceled": false, # non-canceled builds will not show up here, I can put this away, too
      "ended_on": null,
      "pkgs": "http://package", # urls of packages to build, separated by space
      "chroots": "fedora-16-i386 fedora-16-x86_64", # chroots to build in, separated by space
      "timeout": 1800, # timeout in seconds, defaults to 30 minutes
      "memory_reqs": 2048, # required memory in MB, defaults to 2GB
      "id": 14 # id of the build
    }
  ]
}
  • [Nov 6]: Added memory_reqs and timeout. Are the default values ok?