Skip to content

Commit

Permalink
[CI/CD]add docker dev builder (#64)
Browse files Browse the repository at this point in the history
* add docker dev builder

* update read me

* add arm64 bazel pkg install

* show current os arch

* assign aarch64 to arm64

* fix typo

* install bazel script remove download resources

* add build instruction

* dash for title blank line
  • Loading branch information
ashione authored Apr 6, 2024
1 parent 5ca25e1 commit 23d3a91
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
14 changes: 13 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
:target: docs/assets/infinite.svg
:alt: mobius


------------


Mobius : Online Machine Learning.
============

`Mobius <https://tech.antfin.com/products/ARCMOBIUS>`_ is an AI infra platform including realtime computing and training.

.. image:: https://github.com/ray-project/mobius/workflows/ubuntu-building/badge.svg
Expand All @@ -12,7 +17,7 @@ Mobius : Online Machine Learning.
.. image:: https://github.com/ray-project/mobius/workflows/macos-building/badge.svg
:target: https://github.com/ray-project/mobius/actions/workflows/macos-building.yml

|


Ray Streaming
=============
Expand Down Expand Up @@ -156,6 +161,13 @@ Key Features
**Validation for continuous model delivery**. A validation mechanism to help our system keep delivering high-quality models and intercept all the abnormal models.


Build
----------------

Build from source code :
- Build a docker using docker/Dockerfile-env
- Execute `scripts/install.sh`


Getting Involved
----------------
Expand Down
10 changes: 10 additions & 0 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -yq software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq wget gcc g++ openjdk-8-jdk maven python3.8 zlib1g-dev zip git pip
RUN git clone https://github.com/ray-project/mobius.git
RUN sh -c "bash mobius/scripts/install-bazel.sh"
RUN python3 -m pip install virtualenv
RUN python3 -m virtualenv -p python3 py3
RUN pip install pytest "protobuf<4"
34 changes: 29 additions & 5 deletions scripts/install-bazel.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# Current github bazel version is 5.0.0
platform="unknown"
arm=`uname -a | grep -o -m 1 -e "arm" -e "aarch64" | head -n 1`

case "${OSTYPE}" in
msys)
Expand All @@ -22,13 +23,36 @@ case "${OSTYPE}" in
;;
esac
echo "platform is ${platform}"
echo "current arch is $arm"

if [ "${platform}" = "darwin" ]; then
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-installer-darwin-x86_64.sh" -O bazel-5.4.1-installer-darwin-x86_64.sh
sh bazel-5.4.1-installer-darwin-x86_64.sh
if [ "${arm}" = "aarch64" ]; then
arm="arm64"
fi

bazel_exe_file=""

if [ "${platform}" = "darwin" ] && [ "${arm}" != "arm64" ]; then
bazel_exe_file="bazel-5.4.1-installer-darwin-x86_64.sh"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-installer-darwin-x86_64.sh" -O $bazel_exe_file
sh $bazel_exe_file
elif [ "${platform}" = "darwin" ] && [ "${arm}" = "arm64" ]; then
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-darwin-arm64" -O bazel-5.4.1-darwin-arm64
chmod a+x bazel-5.4.1-darwin-arm64
cp bazel-5.4.1-darwin-arm64 /usr/bin/bazel
elif [ "${platform}" = "linux" ] && [ "${arm}" = "arm64" ]; then
bazel_exe_file="bazel_5.4.1-linux-arm64"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel-5.4.1-linux-arm64" -O $bazel_exe_file
chmod a+x $bazel_exe_file
cp $bazel_exe_file /usr/bin/bazel
else
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel_5.4.1-linux-x86_64.deb" -O bazel_5.4.1-linux-x86_64.deb
dpkg -i bazel_5.4.1-linux-x86_64.deb
bazel_exe_file="bazel_5.4.1-linux-x86_64.deb"
wget "https://github.com/bazelbuild/bazel/releases/download/5.4.1/bazel_5.4.1-linux-x86_64.deb" -O $bazel_exe_file
dpkg -i $bazel_exe_file
fi

if [ -e $bazel_exe_file ]; then
echo "Remove download file $bazel_exe_file"
rm $bazel_exe_file
fi

bazel --version

0 comments on commit 23d3a91

Please sign in to comment.