-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '300_release' into 'master'
300 release See merge request oceanbase/ob-deploy!267
- Loading branch information
Showing
641 changed files
with
23,720 additions
and
34,100 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,54 @@ | ||
FROM registry.openanolis.cn/openanolis/anolisos:8.9 | ||
ENV PATH="/opt/miniconda/bin:$PATH" | ||
ENV TZ=UTC-8 | ||
ENV CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 | ||
|
||
ADD Docker/ob_build /usr/bin/ | ||
ADD Docker/python-env-activate.sh /usr/bin/py-env-activate | ||
|
||
RUN yum install -y wget \ | ||
&& wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo \ | ||
&& yum -y install libffi-devel bzip2-devel readline readline-devel jq which bison ncurses-devel libaio autoconf automake libtool perl-CPAN gettext-devel perl-devel openssl-devel zlib-devel curl-devel xz-devel \ | ||
expat-devel asciidoc xmlto rpm-build cmake make gcc gcc-c++ python2-devel python3-devel sudo git mysql-devel \ | ||
&& yum clean all | ||
|
||
RUN wget https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-x86_64.sh --no-check-certificate\ | ||
&& bash Miniconda2-py27_4.8.3-Linux-x86_64.sh -p /opt/miniconda -b \ | ||
&& rm -rf Miniconda2-py27_4.8.3-Linux-x86_64.sh \ | ||
&& conda clean --all -y | ||
|
||
COPY requirements3.txt /workspaces/obd/requirements3.txt | ||
COPY service/service-requirements.txt workspaces/obd/service-requirements.txt | ||
|
||
RUN conda create -n py27 -y python=2.7 \ | ||
&& source /opt/miniconda/bin/activate base \ | ||
&& pip config set global.index-url https://mirrors.aliyun.com/pypi/simple \ | ||
&& pip config set global.trusted-host mirrors.aliyun.com \ | ||
&& pip install pyinstaller==3.6 \ | ||
&& rm -rf ~/.cache/pip \ | ||
&& conda clean -a -y | ||
|
||
RUN conda create -n py38 -y python=3.8 \ | ||
&& source /opt/miniconda/bin/activate py38 \ | ||
&& pip config set global.index-url https://mirrors.aliyun.com/pypi/simple \ | ||
&& pip config set global.trusted-host mirrors.aliyun.com \ | ||
&& pip install -r /workspaces/obd/requirements3.txt \ | ||
&& pip install -r /workspaces/obd/service-requirements.txt \ | ||
&& pip install pyinstaller==3.6 \ | ||
&& pip cache purge \ | ||
&& echo "source /opt/miniconda/bin/activate py38" >> ~/.bashrc \ | ||
&& /opt/miniconda/bin/conda clean -a -y \ | ||
&& rm -rf /workspaces/obd | ||
|
||
# install nodejs and yarn | ||
RUN wget https://rpm.nodesource.com/setup_16.x \ | ||
&& touch /etc/redhat-release \ | ||
&& bash setup_16.x \ | ||
&& rm -f /etc/redhat-release \ | ||
&& yum install -y nodejs \ | ||
&& yum clean all | ||
|
||
RUN npm install -g yarn \ | ||
&& yarn config delete registry --global \ | ||
&& yarn config set registry https://registry.npmmirror.com/ --global \ | ||
&& npm cache clean --force |
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,76 @@ | ||
#!/bin/bash | ||
set -x | ||
set -e | ||
|
||
if [ $# -lt 4 ]; then | ||
echo "no enough parameters. Please provide project_name, version and release." | ||
exit 1 | ||
fi | ||
|
||
# Get system release | ||
os_release=$(grep -Po '(?<=^ID=")[^"]*' /etc/os-release || true) | ||
|
||
if [ -z "$os_release" ]; then | ||
os_release=$(grep -Po '^ID=\K[^ ]+' /etc/os-release) | ||
fi | ||
|
||
set +e | ||
source /etc/profile | ||
set -e | ||
|
||
project_dir=$1 | ||
project_name=$2 | ||
version=$3 | ||
release=$4 | ||
rpm_work_dir=${5:-rpm} | ||
ob_build_script=${project_name}-build.sh | ||
ob_build_spec=${project_name}.spec | ||
ob_build_deps=${project_name}.deps | ||
cur_dir=`pwd` | ||
echo "cur dir: $cur_dir" | ||
# check rpm work dir | ||
if [ ! -d "${cur_dir}/${rpm_work_dir}" ]; then | ||
echo "rpm work dir (${rpm_work_dir}) missing! Please create ${rpm_work_dir} in source code dir and place the packaging related files in the ${rpm_work_dir} dir." | ||
exit 1 | ||
fi | ||
|
||
# trigger building | ||
echo "trigger building, current dir: " | ||
pwd | ||
cd $rpm_work_dir | ||
ABS_PATH=`pwd` | ||
|
||
if [[ x"$os_release" == x"alios" && x"$AONE_COMPATIBLE_AUTO_DEP_CREATE" == x"on" ]]; then | ||
if [ -e "$ob_build_deps" ]; then | ||
echo "execute dep_create for alios" | ||
dep_create $ob_build_deps | ||
echo "execute sw for alios" | ||
sw | ||
fi | ||
fi | ||
|
||
if [ -e "$ob_build_script" ]; then | ||
bash $ob_build_script $project_dir $project_name $version $release | ||
elif [ -e "$ob_build_spec" ]; then | ||
if [[ x"$os_release" == x"alios" ]]; then | ||
rpm_create $ob_build_spec -v $version -r $release | ||
else | ||
TOP_DIR=".rpm_create" | ||
RPM_MACROS=$HOME/.rpmmacros | ||
if [ -e $RPM_MACROS ]; then | ||
mv -f $RPM_MACROS $RPM_MACROS.bak | ||
fi | ||
|
||
# prepare rpm build dirs | ||
mkdir -p $TOP_DIR/BUILD | ||
mkdir -p $TOP_DIR/RPMS | ||
mkdir -p $TOP_DIR/SRPMS | ||
|
||
echo "%_topdir $ABS_PATH/$TOP_DIR" > $RPM_MACROS | ||
rpmbuild -bb $ob_build_spec | ||
find $TOP_DIR/ -name "*.rpm" -exec mv {} . 2>/dev/null \; | ||
fi | ||
else | ||
echo "packaging files missing! Please provide $ob_build_script or $ob_build_spec" | ||
exit 1 | ||
fi |
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,6 @@ | ||
eval "$(conda shell.bash hook)" | ||
if [[ -z $1 ]]; then | ||
echo "Please input proper python env" | ||
exit 1 | ||
fi | ||
conda activate $1 |
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
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
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
Oops, something went wrong.