Skip to content

Commit

Permalink
Currency:Adding build-script ,build_info.json and Dockerfile for glan…
Browse files Browse the repository at this point in the history
…ce. (ppc64le#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
  • Loading branch information
vinodk99 authored Mar 7, 2024
1 parent 0592aae commit 28fd5db
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
21 changes: 21 additions & 0 deletions g/glance/Dockerfiles/yogaeom_ubi8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM registry.access.redhat.com/ubi8/ubi:8.7

MAINTAINER "Vinod K <[email protected]>"

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"]
3 changes: 3 additions & 0 deletions g/glance/Dockerfiles/yogaeom_ubi8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Docker build command : docker build -t glance .

Docker run command : docker run -t glance
21 changes: 21 additions & 0 deletions g/glance/build_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"maintainer":"[email protected]",
"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"
}
}
71 changes: 71 additions & 0 deletions g/glance/glance_ubi_8.7.sh
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
#
# 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

0 comments on commit 28fd5db

Please sign in to comment.