Skip to content

Commit

Permalink
Fix build scripts for Ubuntu and update build guide
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrafam committed Feb 13, 2024
1 parent 6d16a1a commit b8a49f9
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 14 deletions.
69 changes: 67 additions & 2 deletions docs/building.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,64 @@
# Building Serenade
Serenade is built using the [Gradle](https://gradle.org) build system. We also have a few scripts useful for running
various Serenade services.

Serenade is built using the [Gradle](https://gradle.org) build system. We also have a few scripts useful for running various Serenade services.
## Setting up your development host
Building Serenade is supported on Linux and Mac. The first thing you need to do is to
download the source code:

```shell
git clone https://github.com/serenadeai/serenade.git
```

For Linux:

- Use Ubuntu Jammy (22.04)
- Run the scripts to install the Ubuntu prerequisites:

```shell
cd serenade/
./scripts/setup/setup-ubuntu.sh
# If prompted for anything during the installation just press OK and continue.
# As requested by the script, add the export lines to your ~/.bashrc~/ or .zshrc file and reload the
# configs
```

Note: If you run into to dependency problems, trying to run the scripts from inside a fresh
Ubuntu Jammy container.

```shell


For MacOS:

- Run the scripts to install the MacOS prerequisites:

```shell
cd serenade/
./scripts/setup/setup-mac.sh
```

## Client

```shell
cd client
npm install npm-run-all
npm ci
# To build the client:
npm run build:main
npm run build:renderer
npm run package:dist
# To run the client locally:
npm run dev
# To generate the app image:
npm run package
```

Extra steps:
npm run-script build:main build:renderer
npm install --save-dev webpack@latest webpack-cli@latest

To run the Serenade app, simply run:

cd client
Expand All @@ -15,6 +70,16 @@ If you'd instead like the client to connect to a specific endpoint (e.g., a loca

ENDPOINT=http://localhost:17200 ./bin/dev.py


## Other Dependencies

Now run the common dependency builder and installer:

```shell
./scripts/setup/build-dependencies.sh
# Sit back and relax, this will take a while to finish
```

## Service Setup

### Docker
Expand Down
1 change: 1 addition & 0 deletions scripts/setup/build-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ if [[ "$minimal" == "true" ]] ; then
find kaldi -type f -name "*.so*" -delete
find kaldi -type f -name "*.o" -delete
fi

31 changes: 19 additions & 12 deletions scripts/setup/setup-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash

set -e
#!/bin/bash -ex

HERE=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
. $HERE/paths.sh
Expand Down Expand Up @@ -28,22 +26,29 @@ sudo-non-docker apt-get install --upgrade -y \
apt-transport-https \
curl \
gnupg2 \
wget
wget \
ca-certificates

if [[ "$gpu" == "true" ]] ; then
sudo-non-docker apt-get install --upgrade -y ubuntu-drivers-common
sudo-non-docker ubuntu-drivers autoinstall
fi

curl -sL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | sudo-non-docker apt-key add -
curl -sL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo-non-docker gpg --dearmor -o /etc/apt/trusted.gpg.d/intel-mkl.gpg
echo "deb https://apt.repos.intel.com/mkl all main" | sudo-non-docker tee /etc/apt/sources.list.d/intel-mkl.list

NODE_MAJOR=18
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo-non-docker gpg --dearmor -o /etc/apt/trusted.gpg.d/nodesource.gpg
echo "deb [arch=amd64] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo-non-docker tee /etc/apt/sources.list.d/nodesource.list
sudo-non-docker apt-get update
sudo-non-docker apt-get install nodejs -y

sudo-non-docker apt-get install --upgrade -y \
autoconf \
automake \
build-essential \
ca-certificates \
clang-format-9 \
clang-format \
cmake \
ffmpeg \
fonts-liberation \
Expand All @@ -53,16 +58,14 @@ sudo-non-docker apt-get install --upgrade -y \
gfortran \
git \
groff \
intel-mkl-64bit-2020.2-108 \
intel-mkl \
libasound2 \
libc++-dev \
libssl-dev \
libpq-dev \
libtool \
logrotate \
lsb-release \
nodejs \
npm \
$([[ "$gpu" == "true" ]] && echo "nvidia-cuda-toolkit") \
postgresql-client \
psmisc \
Expand All @@ -79,15 +82,19 @@ sudo-non-docker apt-get install --upgrade -y \
vim \
xdg-utils \
yarn \
zlib1g-dev
zlib1g-dev \
pkg-config \
libx11-dev \
uglifyjs \
libxtst-dev

curl https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-14.0.1_linux-x64_bin.tar.gz -Lso jdk.tar.gz
tar xf jdk.tar.gz
rm jdk.tar.gz

echo ""
echo "" && echo "" && echo ""
echo "Install complete!"
echo "Now, run build-dependencies.sh and add the following to your ~/.zshrc or ~/.bashrc:"
echo "Now, run ./scripts/setup/build-dependencies.sh and add the following to your ~/.zshrc or ~/.bashrc:"
echo "export PATH=\"$SERENADE_LIBRARY_ROOT/jdk-14.0.1/bin:$SERENADE_LIBRARY_ROOT/gradle-7.4.2/bin:\$PATH\""
echo "export JAVA_HOME=\"$SERENADE_LIBRARY_ROOT/jdk-14.0.1\""

Expand Down

0 comments on commit b8a49f9

Please sign in to comment.