Skip to content

Commit 0aab6b5

Browse files
committed
buildah updates
1 parent 466a225 commit 0aab6b5

File tree

3 files changed

+65
-48
lines changed

3 files changed

+65
-48
lines changed

buildah/Dockerfile-buildah

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,39 @@
33
# docker build -f Dockerfile-buildah .
44
# docker tag b8bc8c47ce3f informaticsmatters/rdkit-buildah:latest
55

6-
FROM fedora:29
6+
FROM centos:8
77
LABEL maintainer="Tim Dudgeon<[email protected]>"
88

99

10-
RUN dnf -y update && dnf -y upgrade && dnf -y install\
11-
gcc-c++\
12-
python3-devel\
13-
boost-devel\
14-
boost-python3-devel\
15-
eigen3-devel\
16-
cmake\
17-
tk-devel\
18-
readline-devel\
19-
zlib-devel\
20-
bzip2-devel\
21-
sqlite-devel\
22-
@development-tools\
23-
swig\
24-
git\
25-
zip\
26-
wget\
27-
java-1.8.0-openjdk-devel\
28-
cairo-devel\
29-
buildah &&\
30-
dnf clean all &&\
31-
rm -rf /var/cache/dnf
10+
RUN yum -y update &&\
11+
sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo &&\
12+
yum install -y\
13+
--setopt=tsflags=nodocs\
14+
--setopt=override_install_langs=en_US.utf8\
15+
tk-devel\
16+
readline-devel\
17+
zlib-devel\
18+
bzip2-devel\
19+
sqlite-devel\
20+
@development\
21+
cmake3\
22+
python3-devel\
23+
python3-numpy\
24+
boost-devel\
25+
boost-python3-devel\
26+
eigen3-devel\
27+
java-11-openjdk-devel\
28+
swig\
29+
git\
30+
wget\
31+
zip\
32+
unzip\
33+
freetype-devel\
34+
cairo-devel\
35+
buildah &&\
36+
yum clean all &&\
37+
rm -rf /var/cache/yum
3238

33-
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
39+
40+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk
3441

buildah/buildah-python3-image.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
#!/bin/bash
2+
#
23
# Buildah build script for RDKit image with Python3.
34
# Also inlcudes numpy and pandas.
45
#
5-
# The RDKIT_BRANCH environment variable must be defined. This defines the RDKit branch to pull
6+
# The GIT_BRANCH environment variable must be defined. This defines the RDKit branch to pull
67
# and is used to define the tag for the image that is built.
78
#
89
# The result is a buildah image that can be pushed to the local docker registry like this:
910
# buildah push informaticsmatters/rdkit-python3-mini:latest docker-daemon:informaticsmatters/rdkit-python3-mini:$IMAGE_TAG
1011

1112
set -e
1213

14+
source ../params.sh
1315

14-
if [ ! -v RDKIT_BRANCH ]; then
15-
echo "RDKIT_BRANCH not defined"
16+
if [ ! -v GIT_BRANCH ]; then
17+
echo "GIT_BRANCH not defined"
1618
exit 1
17-
elif [ "$RDKIT_BRANCH" = "master" ]; then
19+
elif [ "$GIT_BRANCH" = "master" ]; then
1820
export IMAGE_TAG="latest"
1921
else
20-
export IMAGE_TAG=$RDKIT_BRANCH
22+
export IMAGE_TAG=$GIT_BRANCH
2123
fi
2224
echo "Using image tag $IMAGE_TAG"
2325

@@ -29,35 +31,37 @@ export scratchmnt=$(buildah mount $newcontainer)
2931
echo "Creating python3 container $newcontainer using $scratchmnt"
3032

3133
# install the required packages
32-
dnf -y install\
34+
yum -y install\
35+
--setopt override_install_langs=en_US.utf8\
36+
--setopt install_weak_deps=false\
37+
--setopt tsflags=nodocs\
38+
--installroot $scratchmnt --releasever 8\
3339
bash\
3440
coreutils\
3541
cairo\
3642
python3\
3743
python3-devel\
3844
python3-numpy\
39-
python3-pandas\
4045
boost\
4146
boost-python3\
4247
curl\
4348
zip\
4449
unzip\
45-
procps-ng\
46-
--installroot $scratchmnt --releasever 29\
47-
--setopt override_install_langs=en_US.utf8\
48-
--setopt install_weak_deps=false\
49-
--setopt tsflags=nodocs
50-
dnf -y clean all --installroot $scratchmnt --releasever 29
50+
procps-ng
51+
52+
yum -y clean all --installroot $scratchmnt --releasever 8
5153
rm -rf $scratchmnt/var/cache/dnf
5254

5355
# create a symlink that allows to run python3 as python
54-
cd $scratchmnt/usr/bin && ln -s python3 python
56+
#cd $scratchmnt/usr/bin && ln -s python3 python
5557

58+
# install RDKit
5659
cd /root/rdkit/build
57-
58-
# install RDKit into the python container
5960
make DESTDIR=$scratchmnt install
6061

62+
# create a symlink that allows to run python3 as python
63+
cd $scratchmnt/usr/bin && ln -s python3 python
64+
6165
# set some config info
6266
buildah config\
6367
--label name=rdkit-python-mini\

buildah/buildah-python3-rdkit.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
#!/bin/bash
2-
# Build script for RDKit with Python3.
3-
# Also inlcudes numpy and pandas.
2+
# Buildah build script for RDKit with Python3.
3+
# Inlcudes InChi, Avalon, Cairo and Swig support.
44
#
5-
# The RDKIT_BRANCH environment variable must be defined. This defines the RDKit branch to use.
65

76
set -e
87

8+
source ../params.sh
99

10-
if [ ! -v RDKIT_BRANCH ]; then
11-
echo "RDKIT_BRANCH not defined"
10+
11+
if [ ! -v GIT_BRANCH ]; then
12+
echo "GIT_BRANCH not defined"
1213
exit 1
1314
fi
14-
echo "Using RDKit branch $RDKIT_BRANCH"
15+
echo "Using RDKit branch $GIT_BRANCH"
1516

1617
# checkout RDKit source code
1718
cd /root
1819
RDBASE=/root/rdkit
1920
rm -rf $RDBASE
2021
echo "Checking out RDKit source code"
21-
git clone -b $RDKIT_BRANCH --single-branch https://github.com/rdkit/rdkit.git
22+
git clone -b $GIT_BRANCH --single-branch https://github.com/rdkit/rdkit.git
2223

2324

2425
mkdir $RDBASE/build
@@ -27,18 +28,23 @@ cd $RDBASE/build
2728
# build RDKit for python
2829
echo "Running cmake"
2930
cmake -Wno-dev\
31+
-DLIB_SUFFIX=64\
3032
-DRDK_INSTALL_INTREE=OFF\
3133
-DRDK_BUILD_INCHI_SUPPORT=ON\
3234
-DRDK_BUILD_AVALON_SUPPORT=ON\
3335
-DRDK_BUILD_CAIRO_SUPPORT=ON\
3436
-DRDK_BUILD_PYTHON_WRAPPERS=ON\
35-
-DRDK_BUILD_SWIG_WRAPPERS=OFF\
37+
-DRDK_BUILD_SWIG_WRAPPERS=ON\
3638
-DCMAKE_INSTALL_PREFIX=/usr\
39+
-DCPACK_PACKAGE_RELOCATABLE=OFF\
3740
..
3841

3942
echo "Building RDKit"
4043
nproc=$(getconf _NPROCESSORS_ONLN)
4144
make -j $(( nproc > 2 ? nproc - 2 : 1 ))
4245

46+
echo "Creating RPMs"
47+
cpack3 -G RPM
48+
4349
echo "RDKit build complete"
4450

0 commit comments

Comments
 (0)