From 87b06c811c3df36670b6c02e5e779c55e1e252e8 Mon Sep 17 00:00:00 2001 From: Bharat Kunwar Date: Tue, 12 Jun 2018 12:13:10 +0100 Subject: [PATCH] Remove fedora-atomic diskimage-builder element Since Fedora Atomic 27+ works out of the box, this diskimage-builder element is no longer necessary to build custom images. Story: 2002532 Task: 22078 Change-Id: Ie6a8496c202ff0bf330dd0f434cff8777e5ef112 --- .../common/image/fedora-atomic/README.rst | 82 ------------------- .../common/image/fedora-atomic/element-deps | 4 - .../environment.d/50-fedora-atomic | 2 - .../fedora-atomic/finalise.d/80-fedora-atomic | 69 ---------------- .../fedora-atomic/install_imagebuild_deps.sh | 22 ----- .../image/fedora-atomic/package-installs.yaml | 2 - .../fedora-atomic/validate_atomic_image.sh | 29 ------- 7 files changed, 210 deletions(-) delete mode 100644 magnum/drivers/common/image/fedora-atomic/README.rst delete mode 100644 magnum/drivers/common/image/fedora-atomic/element-deps delete mode 100644 magnum/drivers/common/image/fedora-atomic/environment.d/50-fedora-atomic delete mode 100755 magnum/drivers/common/image/fedora-atomic/finalise.d/80-fedora-atomic delete mode 100755 magnum/drivers/common/image/fedora-atomic/install_imagebuild_deps.sh delete mode 100644 magnum/drivers/common/image/fedora-atomic/package-installs.yaml delete mode 100755 magnum/drivers/common/image/fedora-atomic/validate_atomic_image.sh diff --git a/magnum/drivers/common/image/fedora-atomic/README.rst b/magnum/drivers/common/image/fedora-atomic/README.rst deleted file mode 100644 index 48823b3729..0000000000 --- a/magnum/drivers/common/image/fedora-atomic/README.rst +++ /dev/null @@ -1,82 +0,0 @@ -============= -fedora-atomic -============= - -Generates a Fedora Atomic image based on a public deployed tree. This element has been tested under Debian, Ubuntu, CentOS and Fedora operating systems. - -Pre-requisites to run diskimage-builder ---------------------------------------- -For diskimage-builder to work, following packages need to be -present: - -* python-dev -* build-essential -* python-pip -* kpartx -* python-lzma -* qemu-utils -* yum -* yum-utils -* python-yaml -* curl - -For Debian/Ubuntu systems, use:: - - apt-get install python-dev build-essential python-pip kpartx python-lzma \ - qemu-utils yum yum-utils python-yaml git curl - -For CentOS and Fedora < 22, use:: - - yum install python-dev build-essential python-pip kpartx python-lzma qemu-utils yum yum-utils python-yaml curl - -For Fedora >= 22, use:: - - dnf install python-devel @development-tools python-pip kpartx python-backports-lzma @virtualization yum yum-utils python-yaml curl - -How to generate Fedora Atomic image ------------------------------------ -To generate an atomic image for Fedora 25 these commands can be -executed:: - - # Install diskimage-builder in virtual environment - virtualenv . - . bin/activate - pip install diskimage-builder - git clone https://git.openstack.org/openstack/magnum - git clone https://git.openstack.org/openstack/dib-utils.git - - export PATH="${PWD}/dib-utils/bin:$PATH" - - export ELEMENTS_PATH=$(python -c 'import os, diskimage_builder, pkg_resources;print(os.path.abspath(pkg_resources.resource_filename(diskimage_builder.__name__, "elements")))') - export ELEMENTS_PATH="${ELEMENTS_PATH}:${PWD}/magnum/magnum/drivers/common/image" - - export DIB_RELEASE=25 # this can be switched to the desired version - export DIB_IMAGE_SIZE=2.5 # we need to give a bit more space to loopback device - - disk-image-create fedora-atomic -o fedora-atomic - -This element can consume already published trees, but you can use it -to consume your own generated trees. Documentation about creating own trees -can be found at `http://developers.redhat.com/blog/2015/01/08/creating-custom-atomic-trees-images-and-installers-part-1/ `_ - -Environment Variables ---------------------- - -To properly reference the tree, the following env vars can be set: - -FEDORA_ATOMIC_TREE_URL - :Required: Yes - :Description: Url for the public fedora-atomic tree to use. It can - reference to own published trees. - :Default: ``https://kojipkgs.fedoraproject.org/atomic/${DIB_RELEASE}/`` - - -FEDORA_ATOMIC_TREE_REF - :Required: Yes - :Description: Reference of the tree to install. - :Default: ``$(curl ${FEDORA_ATOMIC_TREE_URL}/refs/heads/fedora-atomic/${DIB_RELEASE}/x86_64/docker-host)`` - -You can use the defaults or export your url and reference, like following:: - - export FEDORA_ATOMIC_TREE_URL="https://kojipkgs.fedoraproject.org/atomic/25/" - export FEDORA_ATOMIC_TREE_REF="$(curl https://kojipkgs.fedoraproject.org/atomic/25/refs/heads/fedora-atomic/25/x86_64/docker-host)" diff --git a/magnum/drivers/common/image/fedora-atomic/element-deps b/magnum/drivers/common/image/fedora-atomic/element-deps deleted file mode 100644 index 2e68953874..0000000000 --- a/magnum/drivers/common/image/fedora-atomic/element-deps +++ /dev/null @@ -1,4 +0,0 @@ -fedora-minimal -growroot -package-installs -vm diff --git a/magnum/drivers/common/image/fedora-atomic/environment.d/50-fedora-atomic b/magnum/drivers/common/image/fedora-atomic/environment.d/50-fedora-atomic deleted file mode 100644 index 5ed6f5fce6..0000000000 --- a/magnum/drivers/common/image/fedora-atomic/environment.d/50-fedora-atomic +++ /dev/null @@ -1,2 +0,0 @@ -export FEDORA_ATOMIC_TREE_URL=${FEDORA_ATOMIC_TREE_URL:-https://kojipkgs.fedoraproject.org/atomic/${DIB_RELEASE}/} -export FEDORA_ATOMIC_TREE_REF=${FEDORA_ATOMIC_TREE_REF:-$(curl ${FEDORA_ATOMIC_TREE_URL}/refs/heads/fedora-atomic/${DIB_RELEASE}/x86_64/docker-host)} diff --git a/magnum/drivers/common/image/fedora-atomic/finalise.d/80-fedora-atomic b/magnum/drivers/common/image/fedora-atomic/finalise.d/80-fedora-atomic deleted file mode 100755 index 6d70c42b1b..0000000000 --- a/magnum/drivers/common/image/fedora-atomic/finalise.d/80-fedora-atomic +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -# generate ostree in root -cd / -ostree admin os-init fedora-atomic -ostree remote add --set=gpg-verify=false fedora-atomic ${FEDORA_ATOMIC_TREE_URL} -ostree pull fedora-atomic ${FEDORA_ATOMIC_TREE_REF} -ostree remote delete fedora-atomic -ostree admin deploy --os=fedora-atomic ${FEDORA_ATOMIC_TREE_REF} --karg-proc-cmdline --karg=selinux=0 - -# copy /etc/fstab to the deployed directory -SYSROOT=/ostree/deploy/fedora-atomic/deploy/${FEDORA_ATOMIC_TREE_REF}.0 -cp /etc/fstab $SYSROOT/etc/ - -# need to find the generated images -DEPLOYED_DIRECTORY=$(find /boot/ostree -name fedora-atomic-* -type d) -DEPLOYED_ID=${DEPLOYED_DIRECTORY##*-} -INIT_IMAGE=$(find ${DEPLOYED_DIRECTORY} -name initramfs*.img) -VMLINUZ_IMAGE=$(find ${DEPLOYED_DIRECTORY} -name vmlinuz*) - -# generate ostree boot -cat > /etc/grub.d/15_ostree <