Skip to content

Commit

Permalink
Update installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
virgofx committed Oct 1, 2021
1 parent 7716e49 commit 61b3519
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 42 deletions.
52 changes: 44 additions & 8 deletions mcrouter/scripts/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,49 @@
N.B These scripts *only* support Amazon Linux 2
# Mcrouter Installation on Amazon Linux 2

1. Install compilers and system-provided libraries:
We need to do this for both x86_64 architecture and graviton. Repeat the following steps
for each architecture

./install_deps_amazon-linux-2.sh
1. Launch a temporary instance for each x86_64 and ARM instance type and use Session Manager to connect.
- Amazon Linux 2 AMI [ebs, hvm]
- x86: m5ad.2xlarge
- arm: m6gd.2xlarge

2. Compile mcrouter and dependencies
1. Switch to root for all subsequent commands
```shell
sudo su -
```

MY_INSTALL_DIR=path/to/install/dir
TARGET=mcrouter
./get_and_build_by_make.sh $MY_INSTALL_DIR mcrouter
1. Attach the EBS volume. Mcrouter needs a little more space than default 8GB volume.
```shell
file -s /dev/nvme1n1
mkfs -t xfs /dev/nvme1n1
mkdir /build
mount /dev/nvme1n1 /build
```

You can substitute individual dependencies as the value of TARGET in order to debug.
1. Clone the `useshortcut\mcrouter` repo.
```shell
yum -y update
yum -y install git
cd /build
git clone https://github.com/useshortcut/mcrouter.git
cd mcrouter
# Switch to branch if necessary
# git checkout <branch>
```

1. Install Pre-built Dependencies
```shell
cd /build/mcrouter/mcrouter/scripts
./install_deps_amazon-linux-2.sh
```

1. Compile additional dependencies, mcrouter and then archive
```shell
cd /build/mcrouter/mcrouter/scripts
INSTALL_DIR=/build/output
# Build dependencies and mcrouter
./get_and_build_by_make.sh $INSTALL_DIR all
# Now archive
./get_and_build_by_make.sh $INSTALL_DIR archive
```
55 changes: 21 additions & 34 deletions mcrouter/scripts/Makefile_amazon-linux-2
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
RECIPES_DIR := ./recipes
MCROUTER_ARCHIVE := mcrouter.$(shell git rev-parse --short=12 HEAD).$(shell uname -m).tar.gz

all: deps mcrouter

deps: .jemalloc-done .boost-done .zstd-done .fmt-done .gflags-done .folly-done .fizz-done .wangle-done .fbthrift-done
# .fbthrift-done .folly-done .fizz-done .wangle-done .fmt-done .zstd-done .glog-done .gflags-done
deps: .jemalloc-done .boost-done .zstd-done .gflags-done .glog-done .fmt-done .folly-done .fizz-done .wangle-done .fbthrift-done
touch $@

mcrouter:
${RECIPES_DIR}/mcrouter.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

$(MCROUTER_ARCHIVE): mcrouter
./slim-archive.sh $(INSTALL_DIR) $@
all: .jemalloc-done .boost-done .zstd-done .gflags-done .glog-done .fmt-done .folly-done .fizz-done .wangle-done .fbthrift-done mcrouter
touch $@

archive: $(MCROUTER_ARCHIVE)
archive:
./slim-archive.sh $(INSTALL_DIR) $(MCROUTER_ARCHIVE)

# jemalloc is available from the package repositories, but then we get this warning at mcrouter startup:
# <jemalloc>: Error in munmap(): Invalid argument which corresponds to https://github.com/jemalloc/jemalloc/issues/467
Expand All @@ -37,27 +35,32 @@ archive: $(MCROUTER_ARCHIVE)
${RECIPES_DIR}/boost.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.zstd-done: .jemalloc-done
.zstd-done: .jemalloc-done .boost-done
${RECIPES_DIR}/zstd.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

# The version of fmt from the package repositories is insufficient to satisfy the "folly" build.
.fmt-done: .boost-done .jemalloc-done
${RECIPES_DIR}/fmtlib.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

# The version of gflags in the repo is insufficient for compiling mcrouter
.gflags-done: .boost-done .jemalloc-done
.gflags-done: .boost-done .jemalloc-done .zstd-done
${RECIPES_DIR}/gflags.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.folly-done: .boost-done .jemalloc-done .fmt-done
### # .zstd-done .glog-done .gflags-done .fmt-done
# The version of glog in the repo is insufficient for compiling folly.
# Additionally, the most recent (HEAD / v0.5.0.rc2) revision from upstream is incompatible for compiling mcrouter.
# Fortunately, v0.4.0 works for both, so we just check out that revision.
.glog-done: .gflags-done .boost-done .jemalloc-done
${RECIPES_DIR}/glog.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

# The version of fmt from the package repositories is insufficient to satisfy the "folly" build.
.fmt-done: .jemalloc-done .boost-done .glog-done .gflags-done
${RECIPES_DIR}/fmtlib.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.folly-done: .jemalloc-done .boost-done .fmt-done .glog-done .gflags-done
${RECIPES_DIR}/folly.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

.fizz-done: .boost-done .jemalloc-done .folly-done .gflags-done
### .glog-done .gflags-done
.fizz-done: .boost-done .jemalloc-done .folly-done .glog-done .gflags-done
${RECIPES_DIR}/fizz.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@

Expand All @@ -69,19 +72,3 @@ archive: $(MCROUTER_ARCHIVE)
.fbthrift-done: .folly-done .fizz-done .wangle-done .fmt-done .glog-done .gflags-done .boost-done .jemalloc-done
${RECIPES_DIR}/fbthrift.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@




# The version of glog in the repo is insufficient for compiling folly.
# Additionally, the most recent (HEAD / v0.5.0.rc2) revision from upstream is incompatible for compiling mcrouter.
# Fortunately, v0.4.0 works for both, so we just check out that revision.
.glog-done: .gflags-done .boost-done .jemalloc-done
${RECIPES_DIR}/glog.sh $(PKG_DIR) $(INSTALL_DIR) $(INSTALL_AUX_DIR)
touch $@






0 comments on commit 61b3519

Please sign in to comment.