get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/130209/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 130209,
    "url": "https://patches.dpdk.org/api/patches/130209/?format=api",
    "web_url": "https://patches.dpdk.org/project/ci/patch/20230811200018.5650-2-ahassick@iol.unh.edu/",
    "project": {
        "id": 5,
        "url": "https://patches.dpdk.org/api/projects/5/?format=api",
        "name": "CI",
        "link_name": "ci",
        "list_id": "ci.dpdk.org",
        "list_email": "ci@dpdk.org",
        "web_url": "",
        "scm_url": "git://dpdk.org/tools/dpdk-ci",
        "webscm_url": "https://git.dpdk.org/tools/dpdk-ci/",
        "list_archive_url": "https://inbox.dpdk.org/ci",
        "list_archive_url_format": "https://inbox.dpdk.org/ci/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230811200018.5650-2-ahassick@iol.unh.edu>",
    "list_archive_url": "https://inbox.dpdk.org/ci/20230811200018.5650-2-ahassick@iol.unh.edu",
    "date": "2023-08-11T20:00:13",
    "name": "[v9,1/6] containers/docs: Add container builder start",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "1640c9c5ffc8a7cf593e7985ac7724b13e37e73f",
    "submitter": {
        "id": 3127,
        "url": "https://patches.dpdk.org/api/people/3127/?format=api",
        "name": "Adam Hassick",
        "email": "ahassick@iol.unh.edu"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/ci/patch/20230811200018.5650-2-ahassick@iol.unh.edu/mbox/",
    "series": [
        {
            "id": 29199,
            "url": "https://patches.dpdk.org/api/series/29199/?format=api",
            "web_url": "https://patches.dpdk.org/project/ci/list/?series=29199",
            "date": "2023-08-11T20:00:12",
            "name": "Community Lab Containers and Builder Engine",
            "version": 9,
            "mbox": "https://patches.dpdk.org/series/29199/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/130209/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/130209/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ci-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 43A9043038;\n\tFri, 11 Aug 2023 22:03:03 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3D6F84323A;\n\tFri, 11 Aug 2023 22:03:03 +0200 (CEST)",
            "from mail-oi1-f196.google.com (mail-oi1-f196.google.com\n [209.85.167.196])\n by mails.dpdk.org (Postfix) with ESMTP id 3C35B4323A\n for <ci@dpdk.org>; Fri, 11 Aug 2023 22:03:02 +0200 (CEST)",
            "by mail-oi1-f196.google.com with SMTP id\n 5614622812f47-3a5ad4477a7so2060084b6e.1\n for <ci@dpdk.org>; Fri, 11 Aug 2023 13:03:02 -0700 (PDT)",
            "from pogmachine2.loudonlune.net ([216.212.51.182])\n by smtp.gmail.com with ESMTPSA id\n f19-20020ac84993000000b004053bcffe49sm1399874qtq.9.2023.08.11.13.03.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 11 Aug 2023 13:03:00 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=iol.unh.edu; s=unh-iol; t=1691784181; x=1692388981;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=X7Dvh9YWA28Zqpq3jIuHrAHBGWHfcns9Dki/yHkNrtM=;\n b=XAJ5UEzGxi7xw2isWwXSpwEw2npmI4swU3sN1pFWIyVDIJHS2Kmd9nNL1WxLTNOIx5\n xuqbjGVDCSo5nONKXQ9Qq/xnEh1FQtUBnkXDFq5v4har10PwSaitVZM1K6pSBrfdI9+E\n Vqr2aP5IkehKvOaTQPyf6L3TP6uZ2xRPdM8e0=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1691784181; x=1692388981;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=X7Dvh9YWA28Zqpq3jIuHrAHBGWHfcns9Dki/yHkNrtM=;\n b=UGFlvsY+2qfk8B9zP+lNFEmA+OmfnQLccscHgszaKrV2DCVs5dha2/5LPiuOCFw9m3\n NAM39JYgTNvitUYUSCLceqyU2oL0QdqBb8EGqL3Bcc+XsQWqBfazAcTqlpKM4k0jijRm\n B23bBr1uVTbXf7tHUcaFXnw40eb+Wdp+xYdH1FYCmep1gKdf3jBs7a2j3tmqeZJYA0dq\n 1POdgPr0uvydS9yfwW8pylbLNP/4u32J9zZUO7XFsXk5xHR7W9FZJoBJBzXk2y495/af\n gQqtkL83UPMQ2fL0qoDLz7Yqho1dt36fWwCLceCTA7Q3l+68Y5Yv5x5PLp2W5BDAfUJo\n /yDQ==",
        "X-Gm-Message-State": "AOJu0YyTYpsffKDLhXv2DKHnkAhgahdZcLO69fYyP/RtuKwW+F7oCZeB\n qNJwjtaW/dd5fwyUCQuenW6cGZnrMkR7TZLk1yRBKDivV6Af+fyyau44eLNM6IoRGCEFNk2Ze/J\n AG7FdHDDSFA28+tFNwEsFro0yXcgcOt6Tj7+v4wIIe1A6vlLE9jTrpv2oYa4hJd69t//BuQ==",
        "X-Google-Smtp-Source": "\n AGHT+IEhaT2JRhg4Kxp72FxDYg4O52wm6dIN4/6a9hjhtmIQFkbuqw/d07GsBTcQ/Z/sh9StIocU9Q==",
        "X-Received": "by 2002:a05:6358:71f:b0:134:dee2:8c18 with SMTP id\n e31-20020a056358071f00b00134dee28c18mr2822363rwj.27.1691784181057;\n Fri, 11 Aug 2023 13:03:01 -0700 (PDT)",
        "From": "Adam Hassick <ahassick@iol.unh.edu>",
        "To": "ci@dpdk.org",
        "Cc": "aconole@redhat.com, alialnu@nvidia.com,\n Owen Hilyard <ohilyard@iol.unh.edu>, Adam Hassick <ahassick@iol.unh.edu>",
        "Subject": "[PATCH v9 1/6] containers/docs: Add container builder start",
        "Date": "Fri, 11 Aug 2023 16:00:13 -0400",
        "Message-ID": "<20230811200018.5650-2-ahassick@iol.unh.edu>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<20230811200018.5650-1-ahassick@iol.unh.edu>",
        "References": "<20230811200018.5650-1-ahassick@iol.unh.edu>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "ci@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK CI discussions <ci.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/ci>,\n <mailto:ci-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/ci/>",
        "List-Post": "<mailto:ci@dpdk.org>",
        "List-Help": "<mailto:ci-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/ci>,\n <mailto:ci-request@dpdk.org?subject=subscribe>",
        "Errors-To": "ci-bounces@dpdk.org"
    },
    "content": "From: Owen Hilyard <ohilyard@iol.unh.edu>\n\n* Add README file for containers\n* Add pyproject file with required dependencies for building containers\n\nThis module allows anyone to build the containers used in DPDK CI, and\nallows the community to contribute container definitions back to DPDK\nCI. Please read the README for more information, since some\nfunctionality is opt-in due to resource requirements.\n\nSigned-off-by: Owen Hilyard <ohilyard@iol.unh.edu>\nSigned-off-by: Adam Hassick <ahassick@iol.unh.edu>\n---\n containers/README.md                      | 179 ++++++++++++++++++++++\n containers/template_engine/pyproject.toml |  21 +++\n 2 files changed, 200 insertions(+)\n create mode 100644 containers/README.md\n create mode 100644 containers/template_engine/pyproject.toml",
    "diff": "diff --git a/containers/README.md b/containers/README.md\nnew file mode 100644\nindex 0000000..f2e360f\n--- /dev/null\n+++ b/containers/README.md\n@@ -0,0 +1,179 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2023 University of New Hampshire\n+\n+DPDK CI Container Build System\n+==============================\n+\n+## Rational\n+\n+There are a few important factors for why a custom build system was created for\n+the containers instead of using an existing one. The first was that podman was\n+nearly mandatory for this task.\n+\n+### Why Podman\n+\n+1. Licensed RHEL containers need podman\n+\n+The build system MUST be able to handle creating properly licensed RHEL\n+containers, so that the RHEL CI testing is as accurate as possible.\n+\n+2. \"Developer Laptop Friendliness\"\n+\n+Another goal of the build system was to enable anyone to easily build the\n+containers. Not all developers are able to use Linux as the main OS on their\n+main development machine. Podman runs on MacOS via podman-machine and Windows\n+either by podman-machine or WSL.\n+\n+3. OCI Containers\n+\n+OCI containers are more portable than some other container solutions. Much of\n+the progress on getting containers running on top of FreeBSD jails targets OCI\n+containers specifically. The tracking issue for this is\n+[https://reviews.freebsd.org/D21570](https://reviews.freebsd.org/D21570).\n+Once upstream support happens, there should be a relatively simple path to\n+supporting containers in FreeBSD once podman/docker APIs are better supported.\n+At the moment, lack up upstream support means no support in this project for\n+FreeBSD.\n+\n+### Python and Makefiles instead of Buildah as a library\n+\n+The next question someone might have is why a combination of Python and\n+makefiles were used instead of using Buildah as a library. The largest\n+reason is that every DPDK developer is going to need to have some\n+level of familiarity with Python due to DTS. Buildah is only available\n+as a library via Go, and would tie DPDK to a particular container\n+implementation. Go, while not difficult to learn, is a compiled language,\n+meaning that the build system would require a build system.\n+\n+The other reason is that most of the logic that needs to be performed is very\n+simple, and python has a few libraries that do most of the work. If it weren't\n+for the desire to have an inventory file (inventory.yaml) with a schema\n+(inventory_schema.json), this probably could have been an AWK script. After the\n+container images are produced, it is very easy to use the same template\n+engine to produce a makefile that can be used to both build and push the\n+containers. This makefile can be run with multiple jobs for parallel building\n+of containers, something not supported by all compose implementations.\n+\n+Meson was considered instead of Makefiles, however, Meson does not handle new\n+Meson being generated during the build very well, and Meson wants most commands\n+to have an output file, which is not true of many of the commands. Meson is\n+also more difficult to generate using a templating library than Makefile\n+targets.\n+\n+## Building\n+\n+### Environment Variables\n+\n+All environment variables are namespaced to DPDK_CI_CONTAINERS to avoid any\n+issues.\n+\n+| Variable                   | Description                                     | Default | Valid Values |\n+| -------------------------- | ----------------------------------------------- | ------- | ------------ |\n+| DPDK_CI_CONTAINERS_ON_RHEL | Whether you are building on licensed RHEL. RHEL containers must be built on licensed RHEL, this can be used to forcibly enable/disable RHEL containers if automatic detection fails. | (grep -q 'Red Hat Enterprise Linux' /etc/redhat-release && echo 'Y') \\|\\| echo 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_FAIL_ON_UNBUILDABLE | Fail during dockerfile generation if any container in the inventory is not buildable. Currently will cause a failure if you are not on RHEL and try to build RHEL containers. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_ONLY_HOST_ARCH | If set to 'Y', only images for the local system architecture will be built. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_BUILDER_MODE | If set to 'Y', disables the manifest features, and only builds images for the local system architecture. Intended to be set when used within some orchestration setup. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_NINJA_WORKERS | The number of Ninja workers to use to build ABI images. Variable setting is benign if ABI is disabled. | unset | Any positive integer greater than zero.\n+DPDK_CI_CONTAINERS_BUILD_ABI | Whether to bake ABI images into the containers. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_NO_LATEST_TAG | Disables tagging the final manifests as \"latest\" in the local store and remote registry. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINERS_COVERITY | Enable building Coverity images. Setting this flag will make the Coverity binaries required. | 'N' | 'Y' or 'N'\n+DPDK_CI_CONTAINER_BUILDER_PROGRAM | What container builder program to use. | 'podman' | Any container builder that exposes the same interface and provides the same behavior as podman.\n+DPDK_CI_CONTAINERS_LIBABIGAIL_CLONE_URL | What URL to clone libabigail from, since some distributions need to compile it from source. | 'git://sourceware.org/git/libabigail.git' | A repository containing libabigail which shares history with the main repository.\n+DPDK_CI_CONTAINERS_DPDK_CLONE_URL | What URL to clone DPDK from. | 'https://dpdk.org/git/dpdk' | Any DPDK mirror.\n+DPDK_CI_CONTAINERS_DPDK_CI_CLONE_URL | What URL to clone the DPDK CI tools from. | 'https://dpdk.org/git/tools/dpdk-ci' | Any DPDK CI mirror.\n+DPDK_CI_CONTAINERS_DPDK_STABLE_CLONE_URL | What URL to clone DPDK stable from. | https://dpdk.org/git/dpdk-stable | Any DPDK stable mirror.\n+DPDK_CI_CONTAINERS_CONTAINER_BUILDER_TAG | What tag to give to the container which creates the dockerfiles. The default should be fine unless you have issues with collisions. | 'dpdk_ci_container_builder' | Any valid OCI container tag (A valid C function name will work)\n+DPDK_CI_CONTAINERS_EXTRA_PUSH_ARGS | Extra arguments to add to the push command, can be used for credentials if 'podman login' won't work. | '' | [https://docs.podman.io/en/latest/markdown/podman-push.1.html#options](https://docs.podman.io/en/latest/markdown/podman-push.1.html#options)\n+DPDK_CI_CONTAINERS_REGISTRY_HOSTNAME | The hostname of the registry to push to. | 'localhost' | The hostname of any system exposing an OCI container registry or localhost to push to local storage.\n+DPDK_CI_CONTAINERS_EXTRA_SCRIPTS_PATH | The path to a directory to copy into all of the containers at /scripts | unset | The path to any local file directory.\n+DPDK_CI_CONTAINERS_COVERITY_PATH | The path to Coverity Scan binaries. Only required if the Coverity flag is set. | unset | The path to any local file directory.\n+DPDK_CI_CONTAINERS_CONTEXT_DIRECTORY | Set the directory to build the containers in. All generated files will be placed in this directory or one of it's children | '$(CURDIR)/container_context' | Any absolute directory path\n+DPDK_CI_CONTAINERS_DATE_TAG_OVERRIDE | Uses a provided string instead of generating a new date tag. Intended for development use. | unset | Any string that is a valid OCI manifest tag.\n+\n+### Builder System Requirements\n+\n+#### Required Programs\n+\n+* GNU make (POSIX make may work, but is not supported)\n+* git\n+* find\n+* POSIX utilities (GNU coreutils will work)\n+* bash\n+* podman >= 4.0.0 (docker or other container builder programs may work, but are\n+unsupported)\n+    * podman 4.0.0 allows run mounts, which allow mounting a directory into the build context of a container. This is used to\n+    persist ccache directories for each container.\n+* qemu-$ARCH-static for any non-native architecture/revision you want to build\n+for.\n+\n+#### Hardware\n+\n+| Hardware Type | Requirement                   | Reason |\n+| ------------- | ----------------------------- | ----------------------------------- |\n+| Disk space    | 10 GB of disk space per image | Many of the final images are 4 GB at the moment, and as DPDK's API grows, so will the ABI references. Intermediate images generated by the builds will consume some additional space that is recoverable after the build.\n+Memory | Either 1.5x or 2x the memory needed to compile DPDK per makefile job | 1.5x is enough for the container overhead and caching when compiling natively, 2x is for builds under emulation (ARM container on x86, etc).\n+\n+\n+#### RHEL containers\n+\n+RHEL container images must be built on RHEL.\n+\n+### Build containers locally\n+\n+```bash\n+# Build using the default arguments\n+make build\n+```\n+\n+The resulting images will be tagged based on the date tag and platform.\n+Image generated tags follow this format: `image-{{ platform }}-{{ date_tag }}`\n+Where `platform` denotes the platform of the image, and `date_tag` is the\n+generated date tag or the override string provided through the environment\n+variable.\n+\n+They should appear in the local image store on your system.\n+\n+### Push containers to registry\n+\n+This will probably involve following prompts in your terminal, but if you have\n+other authentication set up, (LDAP, Kerberos, etc), it may not prompt you.\n+Logging into a registry is what allows you to upload containers to a remote\n+system for others to pull down.\n+\n+If you are working alone, you probably can ignore this and keep the containers\n+locally. If you are in an enterprise setting, ask your DevOps or Systems\n+Administration team where the preferred location for hosting containers is.\n+\n+Since these images take so long to build, it is recommended to use a container\n+registry and have any CI systems pull from that registry.\n+\n+Redhat guide to setting up a podman container registry:\n+[https://www.redhat.com/sysadmin/simple-container-registry](https://www.redhat.com/sysadmin/simple-container-registry)\n+\n+```bash\n+$DPDK_CI_CONTAINER_BUILDER_PROGRAM login $DPDK_CI_CONTAINERS_REGISTRY_HOSTNAME\n+# < Complete login process >\n+make push\n+```\n+\n+#### Manifests\n+\n+OCI manifests enable the grouping of images for different platforms under the\n+same tag in a repository on a registry. The use of OCI manifests over tagged\n+images reduces the amount of system platform related branching in CI scripting.\n+\n+The Makefile provides the option to push only the images, only the manifests,\n+or push the images and make manifests. The default \"push\" target will perform\n+the last case. If you choose to create the manifests, then these will be\n+created with the \"final\" tags like \"latest\" and the date timestamp.\n+\n+Manifest creation is known to not be compatible with Docker. This feature is\n+known to work when using Podman to post content to a Docker v2 registry.\n+\n+The manifests may be created on the registry independently of the image builds\n+using the `push_manifests` target in place of the `push` target. In contrast,\n+the `push_images` target will only push the images and not create the\n+manifests.\n+\n+If the `DPDK_CI_CONTAINERS_BUILDER_MODE` variable is set to 'Y', then the\n+`push_manifests` target will be disabled.\ndiff --git a/containers/template_engine/pyproject.toml b/containers/template_engine/pyproject.toml\nnew file mode 100644\nindex 0000000..0d228bc\n--- /dev/null\n+++ b/containers/template_engine/pyproject.toml\n@@ -0,0 +1,21 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright (c) 2023 University of New Hampshire\n+\n+[tool.poetry]\n+name = \"dpdk_ci_containers\"\n+version = \"0.1.0\"\n+description = \"\"\n+authors = [\"Owen Hilyard <ohilyard at iol.unh.edu>\"]\n+license = \"BSD-3-Clause\"\n+\n+[tool.poetry.dependencies]\n+python = \"^3.8\"\n+Jinja2 = \"^3.1.2\"\n+jsonschema = \"^4.10.0\"\n+PyYAML = \"^6.0\"\n+\n+[tool.poetry.dev-dependencies]\n+\n+[build-system]\n+requires = [\"poetry-core>=1.0.0\"]\n+build-backend = \"poetry.core.masonry.api\"\n",
    "prefixes": [
        "v9",
        "1/6"
    ]
}