-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the YugabyteDB Docker build infrastructure
- Loading branch information
Showing
6 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# YugabyteDB build steps from: | ||
# https://docs.yugabyte.com/latest/contribute/core-database/build-from-src-centos/ | ||
# | ||
FROM centos:7.9.2009 | ||
|
||
ARG GCC_VERSION=7.3.0 | ||
|
||
COPY usr/local/bin/yb-first-pass-build.sh /usr/local/bin/yb-first-pass-build.sh | ||
COPY usr/local/bin/yb-rebuild.sh /usr/local/bin/yb-rebuild.sh | ||
RUN chmod +x /usr/local/bin/yb-first-pass-build.sh \ | ||
&& chmod +x /usr/local/bin/yb-rebuild.sh \ | ||
&& echo 'YugabyteDB build tooling' \ | ||
&& yum -y update \ | ||
&& yum -y groupinstall 'Development Tools' \ | ||
&& yum install -y ruby perl-Digest epel-release ccache git python2-pip python-devel python3 python3-pip python3-devel which \ | ||
&& yum install -y cmake3 ctest3 ninja-build \ | ||
&& yum install -y git \ | ||
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \ | ||
&& ln -s /usr/bin/cmake3 /usr/local/bin/cmake \ | ||
&& ln -s /usr/bin/ctest3 /usr/local/bin/ctest \ | ||
&& echo 'Updated GCC for building extensions later on' \ | ||
&& yum install -y wget bzip2 \ | ||
&& cd /tmp \ | ||
&& wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \ | ||
&& tar zxf gcc-${GCC_VERSION}.tar.gz \ | ||
&& cd gcc-${GCC_VERSION} \ | ||
&& ./contrib/download_prerequisites \ | ||
&& ./configure --disable-multilib --enable-languages=c,c++ \ | ||
&& make \ | ||
&& make install \ | ||
&& echo 'Cleanup' \ | ||
&& yum clean all -y \ | ||
&& rm -rf /tmp/gcc-${GCC_VERSION} | ||
|
||
VOLUME /root/.m2 | ||
VOLUME /opt/yb-build | ||
VOLUME /yb-source |
42 changes: 42 additions & 0 deletions
42
.docker/yugabytedb-build-infrastructure/usr/local/bin/yb-first-pass-build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
REPOSITORY=${REPOSITORY:-"https://github.com/yugabyte/yugabyte-db.git"} | ||
YB_VERSION=${YB_VERSION:-"v2.7.2"} | ||
|
||
cd /yb-source | ||
if [ ! -d "./.git" ]; then | ||
echo "Checking out '${REPOSITORY}'..." | ||
git clone "${REPOSITORY}" . | ||
else | ||
echo "'${REPOSITORY}' already checked out..." | ||
fi | ||
|
||
# reset the Makefile of the third-party extensions | ||
git checkout -- src/postgres/third-party-extensions/Makefile | ||
|
||
git checkout "${YB_VERSION}" | ||
|
||
extra_extensions="" | ||
count=$(find /extensions/ -maxdepth 1 -type d | grep -v '^/extensions/$' | wc -l) | ||
if [ $count -ne 0 ]; then | ||
for d in /extensions/*/ ; do | ||
ext_name=$(basename "$d") | ||
echo "Discovered an extension to add: '${ext_name}'" | ||
extra_extensions="$extra_extensions $ext_name" | ||
rm -rf "src/postgres/third-party-extensions/${ext_name}" | ||
cp -v -r "$d" src/postgres/third-party-extensions/ | ||
done | ||
fi | ||
|
||
if [ -z "${extra_extensions}" ]; then | ||
echo "There were no extra extensions to compile with..." | ||
else | ||
echo "Appending '${extra_extensions}' to src/postgres/third-party-extensions/Makefile" | ||
sed -i "1{s/$/${extra_extensions}/}" src/postgres/third-party-extensions/Makefile | ||
fi | ||
|
||
./yb_build.sh release | ||
yes | ./yb_release | ||
mv /yb-source/build/yugabyte-${YB_VERSION}*.tar.gz /yb-source/build/yugabyte-${YB_VERSION}.tar.gz | ||
|
||
echo "Your build is available in /yb-source/build/yugabyte-${YB_VERSION}.tar.gz" |
36 changes: 36 additions & 0 deletions
36
.docker/yugabytedb-build-infrastructure/usr/local/bin/yb-rebuild.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
YB_VERSION=${YB_VERSION:-"v2.7.2"} | ||
|
||
# reset the Makefile of the third-party extensions | ||
git checkout -- src/postgres/third-party-extensions/Makefile | ||
|
||
git checkout "${YB_VERSION}" | ||
|
||
extra_extensions="" | ||
count=$(find /extensions/ -maxdepth 1 -type d | grep -v '^/extensions/$' | wc -l) | ||
if [ $count -ne 0 ]; then | ||
for d in /extensions/*/ ; do | ||
ext_name=$(basename "$d") | ||
echo "Discovered an extension to add: '${ext_name}'" | ||
extra_extensions="$extra_extensions $ext_name" | ||
rm -rf "src/postgres/third-party-extensions/${ext_name}" | ||
cp -v -r "$d" src/postgres/third-party-extensions/ | ||
done | ||
fi | ||
|
||
if [ -z "${extra_extensions}" ]; then | ||
echo "There were no extra extensions to compile with..." | ||
else | ||
echo "Appending '${extra_extensions}' to src/postgres/third-party-extensions/Makefile" | ||
sed -i "1{s/$/${extra_extensions}/}" src/postgres/third-party-extensions/Makefile | ||
fi | ||
|
||
./yb_build.sh release | ||
yes | ./yb_release | ||
|
||
# remove old build, if exists... | ||
rm -rf /yb-source/build/yugabyte-${YB_VERSION}.tar.gz | ||
mv /yb-source/build/yugabyte-${YB_VERSION}*.tar.gz /yb-source/build/yugabyte-${YB_VERSION}.tar.gz | ||
|
||
echo "Your build is available in /yb-source/build/yugabyte-${YB_VERSION}.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ regression.diffs | |
regression.out | ||
.docker/yugabytedb-with-extensions/extensions | ||
.deps/ | ||
.tmp/* | ||
!.tmp/.gitkeep |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters