Skip to content

Commit

Permalink
Enhance the build scripts to support compilation for the aarch64 arch…
Browse files Browse the repository at this point in the history
…itecture on CentOS and Ubuntu systems. (#704) (#705)

Co-authored-by: gaojianda <[email protected]>
(cherry picked from commit e5d79a5)

Co-authored-by: fire_checken <[email protected]>
  • Loading branch information
huaxiabuluo and gaoJava authored Dec 8, 2023
1 parent c0f9b03 commit 323e437
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scripts/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ cd $DIR
case $3 in
centos7)
bash $STUDIO/scripts/pack_CentOS.sh
bash $STUDIO/scripts/pack_CentOS_aarch64.sh
;;
ubuntu1604)
bash $STUDIO/scripts/pack_Ubuntu.sh
bash $STUDIO/scripts/pack_Ubuntu_arrch64.sh
;;
esac
2 changes: 1 addition & 1 deletion scripts/pack_CentOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RPM_TARGET=$DIR/package
mkdir -p $RPM_TARGET

cp -r $STUDIO/scripts/rpm $RPM_TARGET/scripts/
mv $RPM_TARGET/scripts/CMakeLists.txt $RPM_TARGET/
cp $RPM_TARGET/scripts/CMakeLists.txt $RPM_TARGET/

cp -r $SERVER/etc $RPM_TARGET/
cp -r $SERVER/server $RPM_TARGET/
Expand Down
43 changes: 43 additions & 0 deletions scripts/pack_CentOS_aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# package studio as one rpm and tar.gz

set -ex

DIR=`pwd`
STUDIO=$DIR/source/nebula-graph-studio
SERVER=$STUDIO/server/api/studio

cd $STUDIO
VERSION=`cat package.json | grep '"version":' | awk 'NR==1{print $2}' | awk -F'"' '{print $2}'`

# build rpm target dir
RPM_TARGET=$DIR/package
mkdir -p $RPM_TARGET

cp -r $STUDIO/scripts/rpm $RPM_TARGET/scripts/
cp $RPM_TARGET/scripts/CMakeLists.txt $RPM_TARGET/

cp -r $SERVER/etc $RPM_TARGET/
cp -r $SERVER/server $RPM_TARGET/

cd $RPM_TARGET
sed -i 's/x86_64/aarch64/g' CMakeLists.txt
mkdir -p tmp
cmake . -B ./tmp
cd ./tmp
cpack -G RPM
ls -a

# build target dir
TAR_TARGET=$DIR/nebula-graph-studio
mkdir -p $TAR_TARGET

cp -r $SERVER/etc $TAR_TARGET/
cp -r $SERVER/server $TAR_TARGET/

cd $DIR
tar -czf nebula-graph-studio-$VERSION.arrch64.tar.gz nebula-graph-studio

# build docker-compose dir
cd $DIR
tar -czf nebula-graph-studio-$VERSION.tar.gz -C $STUDIO/deployment/docker .
2 changes: 1 addition & 1 deletion scripts/pack_Ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PACKAGE=$DIR/package
mkdir -p $PACKAGE

cp -r $STUDIO/scripts/deb $PACKAGE/lib/
mv $PACKAGE/lib/CMakeLists.txt $PACKAGE/
cp $PACKAGE/lib/CMakeLists.txt $PACKAGE/

cp -r $SERVER/etc $PACKAGE/
cp -r $SERVER/server $PACKAGE/
Expand Down
25 changes: 25 additions & 0 deletions scripts/pack_Ubuntu_aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# package studio as one deb

set -ex

DIR=`pwd`
STUDIO=$DIR/source/nebula-graph-studio
SERVER=$STUDIO/server/api/studio

# build target dir
PACKAGE=$DIR/package
mkdir -p $PACKAGE

cp -r $STUDIO/scripts/deb $PACKAGE/lib/
cp $PACKAGE/lib/CMakeLists.txt $PACKAGE/

cp -r $SERVER/etc $PACKAGE/
cp -r $SERVER/server $PACKAGE/

cd $PACKAGE
sed -i 's/x86_64/aarch64/g' CMakeLists.txt
mkdir -p tmp
cmake . -B ./tmp
cd ./tmp
cpack -G DEB

0 comments on commit 323e437

Please sign in to comment.