From 28fd5db1dff091e53ea07b93be831fd5619cffcf Mon Sep 17 00:00:00 2001 From: vinodk99 <109129753+vinodk99@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:56:16 +0530 Subject: [PATCH] Currency:Adding build-script ,build_info.json and Dockerfile for glance. (#3615) * Create glance_ubi_8.7.sh * Create build_info.json * Create Dockerfile * Create README.md * Update glance_ubi_8.7.sh * Update glance_ubi_8.7.sh * Update glance_ubi_8.7.sh * Update glance_ubi_8.7.sh * Update build_info.json * Update build_info.json --- g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile | 21 ++++++ g/glance/Dockerfiles/yogaeom_ubi8/README.md | 3 + g/glance/build_info.json | 21 ++++++ g/glance/glance_ubi_8.7.sh | 71 ++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile create mode 100644 g/glance/Dockerfiles/yogaeom_ubi8/README.md create mode 100644 g/glance/build_info.json create mode 100644 g/glance/glance_ubi_8.7.sh diff --git a/g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile b/g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile new file mode 100644 index 0000000000..01433dfd9f --- /dev/null +++ b/g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile @@ -0,0 +1,21 @@ +FROM registry.access.redhat.com/ubi8/ubi:8.7 + +MAINTAINER "Vinod K " + +ARG PACKAGE_VERSION=yoga-eom + +RUN yum install -y git wget gcc gcc-c++ python39 python39-pip python39-devel python39-psycopg2 libxslt libxslt-devel make libpq libpq-devel openssl-devel cmake xz libaio pixman pixman-devel + +RUN wget https://static.rust-lang.org/dist/rust-1.65.0-powerpc64le-unknown-linux-gnu.tar.gz &&\ + tar -xzf rust-1.65.0-powerpc64le-unknown-linux-gnu.tar.gz && \ + cd rust-1.65.0-powerpc64le-unknown-linux-gnu && \ + ./install.sh && \ + cd .. + +RUN git clone https://github.com/openstack/glance && \ + cd glance && \ + git checkout $PACKAGE_VERSION && \ + pip3 install "cython<3.0.0" wheel tox && pip3 install --no-build-isolation pyyaml==6.0 && \ + python3 -m pip install -r requirements.txt + +CMD ["/bin/bash"] diff --git a/g/glance/Dockerfiles/yogaeom_ubi8/README.md b/g/glance/Dockerfiles/yogaeom_ubi8/README.md new file mode 100644 index 0000000000..b7f2c4817c --- /dev/null +++ b/g/glance/Dockerfiles/yogaeom_ubi8/README.md @@ -0,0 +1,3 @@ +Docker build command : docker build -t glance . + +Docker run command : docker run -t glance diff --git a/g/glance/build_info.json b/g/glance/build_info.json new file mode 100644 index 0000000000..150234f912 --- /dev/null +++ b/g/glance/build_info.json @@ -0,0 +1,21 @@ +{ + "maintainer":"Vinod.K1@ibm.com", + "package_name" : "glance", + "github_url": "https://github.com/openstack/glance", + "version": "yoga-eom", + "default_branch": "master", + "docker_cmd": "docker build -t ${package_name}:$PACKAGE_VERSION ${dir}", + "package_dir": "g/glance", + "build_script": "glance_ubi_8.7.sh", + "validate_build_script": "true", + "use_non_root_user": "false", + "docker_build": "true", + "yoga-eom" : { + "dir": "yogaeom_ubi8", + "build_script": "glance_ubi_8.7.sh" + }, + "*.*.*" : { + "dir": "yogaeom_ubi8", + "build_script": "glance_ubi_8.7.sh" + } +} diff --git a/g/glance/glance_ubi_8.7.sh b/g/glance/glance_ubi_8.7.sh new file mode 100644 index 0000000000..11459fe6c1 --- /dev/null +++ b/g/glance/glance_ubi_8.7.sh @@ -0,0 +1,71 @@ +#!/bin/bash -e +# ----------------------------------------------------------------------------- +# +# Package : glance +# Version : yoga-eom +# Source repo : https://github.com/openstack/glance +# Tested on : UBI 8.7 +# Language : Python +# Travis-Check : True +# Script License: Apache License, Version 2 or later +# Maintainer : Vinod K +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# +# ---------------------------------------------------------------------------- +PACKAGE_NAME=glance +PACKAGE_VERSION=${1:-yoga-eom} +PACKAGE_URL=https://github.com/openstack/glance + +yum install -y yum-utils wget +yum update -y --allowerasing +yum-config-manager --add-repo http://mirror.centos.org/centos/8-stream/AppStream/ppc64le/os/ +yum-config-manager --add-repo http://mirror.centos.org/centos/8-stream/PowerTools/ppc64le/os/ +yum-config-manager --add-repo http://mirror.centos.org/centos/8-stream/BaseOS/ppc64le/os/ + +wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-Official +mv RPM-GPG-KEY-CentOS-Official /etc/pki/rpm-gpg/. +rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official + +yum install -y git wget gcc gcc-c++ python39 python39-pip python39-devel python39-psycopg2 libxslt libxslt-devel make libpq libpq-devel openssl-devel cmake xz libaio pixman pixman-devel ninja-build glib2 glib2-devel bzip2 +#Install qemu dependency for tests +wget https://download.qemu.org/qemu-6.2.0.tar.xz +tar xvJf qemu-6.2.0.tar.xz +cd qemu-6.2.0 +./configure --enable-vdi +make +make install +cd .. + +#Install rustc +curl https://sh.rustup.rs -sSf | sh -s -- -y +source ~/.cargo/env + +git clone $PACKAGE_URL +cd $PACKAGE_NAME +git checkout $PACKAGE_VERSION + +pip3 install "cython<3.0.0" wheel tox && pip3 install --no-build-isolation pyyaml==6.0 + +if ! python3 -m pip install -r requirements.txt ; then + echo "------------------$PACKAGE_NAME:Install_fails-------------------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_Fails" + exit 1 +fi +python3 -m pip install -r test-requirements.txt +if ! tox -e py39 ; then + echo "------------------$PACKAGE_NAME:Install_success_but_test_fails---------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Fail | Install_success_but_test_Fails" + exit 2 +else + echo "------------------$PACKAGE_NAME:Install_&_test_both_success-------------------------" + echo "$PACKAGE_URL $PACKAGE_NAME" + echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | GitHub | Pass | Both_Install_and_Test_Success" + exit 0 +fi