From 77ce7abb8905f5cb61a2362b83694422e38867bb Mon Sep 17 00:00:00 2001 From: Yuxiang Zhu Date: Nov 20 2018 08:47:18 +0000 Subject: Add a new artifact type: container-image Following up Add a new artifact type `container-image` for representing a generic container image built by CI/CD pipelines or anywhere outside of OSBS. A `container-image` is identified by a repo name and a digest (usually a sha256 digest). For now, only `test.complete` and `test.error` messages are defined. --- diff --git a/examples/container-image.test.complete.json b/examples/container-image.test.complete.json new file mode 100644 index 0000000..e981779 --- /dev/null +++ b/examples/container-image.test.complete.json @@ -0,0 +1,46 @@ +{ + "ci": { + "name": "C3I Jenkins", + "team": "DevOps", + "url": "https://example.com", + "docs": "https://example.com/user-documentation", + "irc": "#pnt-devops-dev", + "email": "pnt-devops-dev@example.com", + "environment": "production" + }, + "run": { + "url": "https://somewhere.com/job/ci-openstack/4794", + "log": "https://somewhere.com/job/ci-openstack/4794/console", + "debug": "https://somewhere.com/job/ci-openstack/4794/artifacts/debug.txt", + "rebuild": "https://somewhere.com/job/ci-openstack/4794/rebuild/parametrized" + }, + "artifact": { + "type": "container-image", + "repository": "fedora", + "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433", + "nvr": "fedora:28", + "issuer": "yuxzhu", + "scratch": true, + "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a" + }, + "system": + [{ + "os": "rhel-7.4-server-x86_64-updated", + "provider": "openstack", + "architecture": "x86_64", + "variant": "Server", + "label": "master" + }], + "type": "tier1", + "category": "functional", + "status": "failed", + "xunit": "https://somewhere.com/job/ci-openstack/4794/artifacts/results.xml", + "recipients": [ "ovasik", "mvadkert" ], + "thread_id": "ac11dcddf99a", + "namespace": "baseos-qe.baseos-ci", + "label": "fast", + "web_url": "https://dashboard.com/job/4794/", + "note": "Some notes.", + "generated_at": "2018-05-10 08:58:31.222602", + "version": "0.1.0" +} diff --git a/examples/container-image.test.error.json b/examples/container-image.test.error.json new file mode 100644 index 0000000..16d52ce --- /dev/null +++ b/examples/container-image.test.error.json @@ -0,0 +1,37 @@ +{ + "ci": { + "name": "C3I Jenkins", + "team": "DevOps", + "url": "https://example.com", + "docs": "https://example.com/user-documentation", + "irc": "#pnt-devops-dev", + "email": "pnt-devops-dev@example.com", + "environment": "production" + }, + "run": { + "url": "https://somewhere.com/job/ci-openstack/4794", + "log": "https://somewhere.com/job/ci-openstack/4794/console", + "debug": "https://somewhere.com/job/ci-openstack/4794/artifacts/debug.txt", + "rebuild": "https://somewhere.com/job/ci-openstack/4794/rebuild/parametrized" + }, + "artifact": { + "type": "container-image", + "repository": "fedora", + "digest": "sha256:017eb7de7927da933a04a6c1ff59da0c41dcea194aaa6b5dd7148df286b92433", + "nvr": "fedora:28", + "issuer": "yuxzhu", + "scratch": true, + "source": "git+https://src.fedoraproject.org/rpms/setup.git?#5e0ae23a" + }, + "type": "tier1", + "category": "functional", + "label": "slow", + "reason": "CI pipeline aborted", + "issue_url": "http://sentry.somewhere.com/baseos/production/issues/1149/", + "recipients": [ "ovasik" ,"mvadkert" ], + "thread_id": "fac11dcddf99a", + "note": "Operation team was notified about the issue, follow the Sentry issue link", + "namespace": "baseos-qe.baseos-ci", + "generated_at": "2018-05-10 08:58:31.222602", + "version": "0.1.0" +} diff --git a/schemas/container-image.test.complete.yaml b/schemas/container-image.test.complete.yaml new file mode 100644 index 0000000..21362f3 --- /dev/null +++ b/schemas/container-image.test.complete.yaml @@ -0,0 +1,55 @@ +$id: https://pagure.io/fedora-ci/messages/container-image.test.complete +$schema: http://json-schema.org/draft-07/schema# + +description: + Testing of the container image has been completed. + This is a mandatory message. + +properties: + ci: + $ref: contact.json + run: + $ref: run.json + artifact: + $ref: container-image.json + system: + type: array + items: + $ref: system.json + category: + $ref: common.json#properties/category + type: + $ref: common.json#properties/type + label: + $ref: common.json#properties/label + status: + $ref: common.json#properties/status + web_url: + $ref: common.json#properties/web_url + xunit: + $ref: common.json#properties/xunit + recipients: + $ref: common.json#properties/recipients + thread_id: + $ref: common.json#properties/thread_id + namespace: + $ref: common.json#properties/namespace + note: + $ref: common.json#properties/note + generated_at: + $ref: common.json#properties/generated_at + version: + $ref: common.json#properties/version + +required: + - ci + - run + - artifact + - type + - category + - status + - namespace + - generated_at + - version + +type: object diff --git a/schemas/container-image.test.error.yaml b/schemas/container-image.test.error.yaml new file mode 100644 index 0000000..db52ba3 --- /dev/null +++ b/schemas/container-image.test.error.yaml @@ -0,0 +1,51 @@ +$id: https://pagure.io/fedora-ci/messages/container-image.test.error +$schema: http://json-schema.org/draft-07/schema# + +description: + Testing has aborted, it was not finished, e.g. because of infrastructure + error, CI system error, etc. Note that a test failure is not an error. + Test failures should be exposed under the brew-build.test.error topic. + This is a mandatory message. + +properties: + ci: + $ref: contact.json + run: + $ref: run.json + artifact: + $ref: container-image.json + category: + $ref: common.json#properties/category + type: + $ref: common.json#properties/type + label: + $ref: common.json#properties/label + reason: + $ref: common.json#properties/reason + issue_url: + $ref: common.json#properties/issue_url + recipients: + $ref: common.json#properties/recipients + thread_id: + $ref: common.json#properties/thread_id + namespace: + $ref: common.json#properties/namespace + note: + $ref: common.json#properties/note + generated_at: + $ref: common.json#properties/generated_at + version: + $ref: common.json#properties/version + +required: + - ci + - run + - artifact + - type + - category + - namespace + - reason + - generated_at + - version + +type: object diff --git a/schemas/container-image.yaml b/schemas/container-image.yaml new file mode 100644 index 0000000..a6dc3b9 --- /dev/null +++ b/schemas/container-image.yaml @@ -0,0 +1,87 @@ +$id: https://pagure.io/fedora-ci/messages/container-image +$schema: http://json-schema.org/draft-07/schema# + +description: + Details about the container image being tested. + +properties: + type: + description: + Artifact type, in this case 'container-image'. + enum: + - container-image + type: string + repository: + description: + Name of the container image repository. + examples: + - fedora + - python3 + - mysql + type: string + digest: + description: + A digest that uniquely identifies the image within a repository. + examples: + - sha256:67dad89757a55bfdfabec8abd0e22f8c7c12a1856514726470228063ed86593b + type: string + format: + description: + Format of the container image. + enum: + - oci + - docker-v1 + - docker-v2 + type: string + pull_ref: + description: + A pull-spec that can be used to pull the image. + examples: + - docker://docker.io/fedora@sha256:67dad89757a55bfdfabec8abd0e22f8c7c12a1856514726470228063ed86593b + type: string + component: + description: + Name of the component tested. + examples: + - bash + - python + - firefox + type: string + issuer: + description: + Build issuer of the artifact. + examples: + - yuxzhu + type: string + scratch: + description: + Indication if the build is a scratch build. + examples: + - true + - false + type: boolean + nvr: + description: + Name-version-release of the artifact. + examples: + - setup-2.8.71-7.el7_4 + type: string + source: + description: + The first item in the request field from task details. This is + usually a link to git repository with a reference, delimited with + the '#' sign. In case of a scratch build or other build built via + uploading a src.rpm the build task source will look like the bash + scratch build. + examples: + - git+https://github.com/docker/rootfs.git#container:docker + type: string + +required: + - type + - repository + - digest + - issuer + - scratch + +type: object