Ampere Computing Logo
Contact Sales
Ampere Computing Logo
DSB Social Network - Transition and Tuning Guide
DSB Social Network - Transition and Tuning Guide

IntroductionAcquire and Navigate DeathStar Bench Source CodeUnderstanding Scope of Changes to the Source CodePorting Dependent Binaries: Replacing AMD64 Binaries with ARM64 binariesPorting Bitnami Containers: “mongodb-sharded”Porting Bitnami Containers: “redis-cluster”Porting Bitnami Containers: “mcrouter”Porting DeathStarBench Source CodeGenerating Docker Images from Social Network source codeSetting up Kubernetes Cluster on BareMetal ServersLaunch Social network module on BareMetal ServersRun Workload From Remote Client on ClusterAppendix
DSB Social Network - Transition and Tuning Guide

Generating Docker Images from Social Network source code

Commands to generate Image for "thrift-microservices-deps"

cd ~/DeathStarBench/socialNetwork/docker/thrift-microservice-deps/cpp sudo docker build -t <dockerhub-username>/thrift-microservice-deps .

DSB code example Status of on-going build for thrift-microservice-deps docker image


Verify the images after the build has finished successfully using the command shown below:

docker images

DSB code example 2 Docker image for thrift-microservice-deps


To push the image to Docker hub, type the following command :

docker push <dockerhub-username>/thrift-microservice-deps

DSB code example 3 Status of successful push of docker image to Dockerhub

Commands to generate Image for "openresty-thrift"

cd ~/DeathStarBench/socialNetwork/docker/openresty-thrift/xenial mv Dockerfile ../ cd .. sudo docker build -t <dockerhub-username>/openresty-thrift .

DSB code example 4. Status of on-going build for openresty-thrift docker image


Verify the image after the build is complete:

docker images

DSB code example 5 Docker image for openresty-thrift


To push the image to Docker hub, type the following command:

docker push <dockerhub-username>/openresty-thrift

DSB code example 6 Status of successful push of docker image to Dockerhub

Commands to generate Image for "media-frontend"

cd ~/DeathStarBench/socialNetwork/docker/media-frontend/xenial mv Dockerfile ../ cd .. sudo docker build -t <dockerhub-username>/media-frontend .

DSB code example 7 Status of build completion for media-frontend container image


Verify the images after build is completed successfully:

docker images

DSB code example 8. Docker image for media-frontend


To push the image to Docker hub, type the following commands:

docker push <dockerhub-username>/media-frontend

DSB code example 9 Status of successful push of docker image to Dockerhub

Commands to generate Image for "social-network-microservice"

cd ~/DeathStarBench/socialNetwork sudo docker build -t <dockerhub-username>/social-network-microservices .

DSB code example 10 Status of build completion for social-network-microservices container image


Verify the images after build is complete:

docker images

DSB code example 11 Docker image for social-network-microservices


To push the image to Docker hub, type the following command as given below,

docker push <dockerhub-username>/social-network-microservices

DSB code example 12 Status of successful push of docker image to Dockerhub

Commands to generate Image for "mcrouter"

The image for “mcrouter” does not get built directly in the same manner as above images from the folder “mcrouter”. So, we have to build this separately. Also, the build takes a long time. So, please be patient and wait till the build is completed. The Dockerfile for building “mcrouter” is given below for your reference.

# Dockerfile for McRouter FROM ubuntu:20.04 ENV DEBIAN_FRONTEND noninteractive RUN apt update && apt -y install build-essential libtool ragel libssl-dev pkg-config python3.8 git RUN ln -s /usr/bin/python3.8 /usr/bin/python && \ ln -s /usr/bin/python3.8 /usr/bin/python3 RUN git clone && cd libunwind && \ autoreconf --install && ./configure && make -j && make install RUN git clone && cd fbthrift && \ ./build/fbcode_builder/getdeps.py install-system-deps --recursive fbthrift && \ ./build/fbcode_builder/getdeps.py --allow-system-packages build fbthrift WORKDIR /tmp/fbcode_builder_getdeps-ZfbthriftZbuildZfbcode_builder-root/installed RUN cp -rf fbthrift/lib/*.a /usr/lib/ &&\ cp -rf folly/lib/*.a /usr/lib/ &&\ cp -rf fizz/lib/*.a /usr/lib/ &&\ cp -rf wangle/lib/*.a /usr/lib &&\ cp -rf fmt*/lib/*.a /usr/lib &&\ cp -rf python*/lib/fb-py-libs/python-six/six.py /usr/lib/python3.8/ &&\ cp -rf fbthrift/include/thrift /usr/include/ &&\ cp -rf folly/include/folly /usr/include/ &&\ cp -rf fizz/include/fizz /usr/include/ &&\ cp -rf wangle/include/wangle /usr/include/ &&\ cp -rf fmt*/include/fmt /usr/include/ &&\ cp -rf python*/lib/fb-py-libs/python-six/six.py /usr/lib/python3.8/ &&\ cp -rf fbthrift/include/thrift /usr/include/ &&\ cp -rf folly/include/folly /usr/include/ &&\ cp -rf fizz/include/fizz /usr/include/ &&\ cp -rf wangle/include/wangle /usr/include/ &&\ cp -rf fmt*/include/fmt /usr/include/ &&\ cp -rf fbthrift/bin/thrift1 /usr/bin/ ENV FBTHRIFT_BIN=/usr/bin/ RUN git clone && \ cd mcrouter/mcrouter && \ autoreconf --install && \ ./configure && \ make && make install ENV DEBIAN_FRONTEND newt

The command to build the above Dockerfile

sudo docker build -t <dockerhub-username>/mcrouter-docker .

DSB code example 13 Status of build completion for mcrouter container image


When the build has finished successfully, the image can be verified as below:

docker images

DSB code example 14.png Docker image for mcrouter

NOTE:The arm64 machine used above (arm64-client) is different from earlier (dsb-client) as the machine ran out of space when generating the build for mcrouter which is above 17GB in size. Optimizing the size is still a work in progress.


To push the image to Docker hub, type the following command as given below,

docker push <dockerhub-username>/mcrouter-docker

DSB code example 15 Status of successful push of docker image to Dockerhub

Next: Setting up Kubernetes Cluster on BareMetal Servers
Previous: Porting DeathStarBench Source Code
Created At : May 24th 2023, 5:15:46 pm
Last Updated At : July 31st 2023, 4:59:44 pm
Ampere Logo

Ampere Computing LLC

4655 Great America Parkway Suite 601

Santa Clara, CA 95054

image
image
image
image
image
 |  |  |  | 
© 2024 Ampere Computing LLC. All rights reserved. Ampere, Altra and the A and Ampere logos are registered trademarks or trademarks of Ampere Computing.
This site is running on Ampere Altra Processors.