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

Porting Bitnami Containers: “mcrouter”

Requirements:

  • Build bitnami/memcached image for arm64 and push to Docker Hub
  • Build bitnami/memcached-exporter image for arm64 and push to Docker Hub
  • Write Dockerfile and build a mcrouter docker image for arm64 and push to Docker Hub

Step 1: Build memcached image from bitnami for arm64

  • Clone the bitnami containers repository from GitHub: Let’s build from here and open Dockerfile for editing.
git clone https://github.com/bitnami/containers.git cd containers/bitnami/memcached/1/debian-11 vim Dockerfile
  • Update the Dockerfile:

    • Update Line 14: OS_ARCH="${TARGETARCH:-amd64}" \ -> OS_ARCH="${TARGETARCH:-arm64}" \
    • Update: "Bitnami ” -> “https://anuphal.s3.amazonaws.com/${COMPONENT}.tar.gz”
    • Delete Line 30: curl -SsLf "Bitnami " -O ; \
    • Delete Line 32: sha256sum -c "${COMPONENT}.tar.gz.sha256" && \
    • Update Line 34: rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \ -> rm -rf "${COMPONENT}".tar.gz; \
  • Build Dockerfile (Refer Appendix B)

  • Push to Dockerhub (Refer Appendix B)


Step 2: Build memcached-exporter image from bitnami for arm64

  • Clone the bitnami containers repository from GitHub: Let’s build from here and open Dockerfile for editing.

    • git clone “https://github.com/bitnami/containers.git” - Connect your Github account
    • cd containers/bitnami/memcached-exporter/0/debian-11
    • vim Dockerfile
  • Update the Dockerfile:

    • Update Line 14: OS_ARCH="${TARGETARCH:-amd64}" \ -> OS_ARCH="${TARGETARCH:-arm64}" \
    • Update: "Bitnami ” -> “https://anuphal.s3.amazonaws.com/${COMPONENT}.tar.gz”
    • Delete Line 29: curl -SsLf "Bitnami " -O ; \
    • Delete Line 31: sha256sum -c "${COMPONENT}.tar.gz.sha256" && \
    • Update Line 33: rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \ -> rm -rf "${COMPONENT}".tar.gz; \
  • Build from Dockerfile and push image to Docker Hub (Refer Appendix B)


Step 3: (Build kubectl container from bitnami/containers

  • Clone the bitnami containers repository from GitHub: Let’s build from here and open “containers/bitnami/kubectl/1.25/Debian-11/Dockerfile” for editing.

    • git clone “https://github.com/bitnami/containers.git” - Connect your Github account
    • cd containers/bitnami/kubectl/1.25/debian-11
    • vim Dockerfile
  • Update the Dockerfile:

    • Update Line 14: OS_ARCH="${TARGETARCH:-amd64}" \ -> OS_ARCH="${TARGETARCH:-arm64}" \
    • Update: "Bitnami ” -> “https://anuphal.s3.amazonaws.com/${COMPONENT}.tar.gz”
    • Delete Line 29: curl -SsLf "Bitnami " -O ; \
    • Delete Line 31: sha256sum -c "${COMPONENT}.tar.gz.sha256" && \
    • Update Line 33: rm -rf "${COMPONENT}".tar.gz{,.sha256} ; \ -> rm -rf "${COMPONENT}".tar.gz; \
  • Build from Dockerfile and push image to Docker Hub (Refer Appendix B)


Step 4: Build mcrouter container from facebook/mcrouter

  • Write a Dockerfile to build mcrouter (Refer Appendix B)
  • Build Dockerfile (Refer Appendix B)
  • Push to Dockerhub (Refer Appendix B)

Step 5: Make changes to mcrouter charts

cd DeathStarBench/socialNetwork/helm-chart/socialnetwork/charts/ tar xf mcrouter-0.3.0.tgz vim mcrouter/values.yaml

  • Update Line 2:

    • Search for “bitnami” and replace with “anuphal” or your dockerhub or repository username
    • Update tag after colon ‘:’ to latest
  • Search and replace v1beta1 with v1 in the mcrouter folder. v1beta1 is deprecated since v1.16

    • “grep -inr v1beta1” will throw multiple occurrences of v1beta1 in different files
    • Replace “v1beta1” with “v1” in all related files
  • Modify configmap.yaml

    • Add Role and RoleBinding (Refer Appendix B)
vim mcrouter/templates/configmap.yaml

Step 6: Make changes to mcrouter chart

vim DeathStarBench/socialNetwork/helm-chart/socialnetwork/charts/mcrouter/charts/memcached/values.yaml
  • Clone the bitnami charts repository from GitHub

  • Open “charts/bitnami/memcached/values.yaml” for editing

    • Search for key “repository:” and replace its value from “bitnami” to “anuphal” or your dockerhub or repository username
    • Search for key “tag:” and replace its value to “latest”
  • Go back to “charts/bitnami”

cd charts/bitnami/ tar czvf mcrouter-0.3.0.tgz mcrouter/ cd DeathStarBench/socialNetwork/helm-chart/socialnetwork/charts/ rm -rf mcrouter-0.3.0.tgz file
  • Move mcrouter-0.3.0.tgz from charts/bitnami to above DeathStarBench path
mv charts/bitnami/mcrouter-0.3.0.tgz .

Step 7: Make changes to mcrouter hooks template

vim DeathStarBench/socialNetwork/helm-chart/socialnetwork/templates/hooks/mcrouter/post-install-hook.yaml
  • Update Line 11 (The line number may change as bitnami upgrades their code):
    • Search for “bitnami” and replace with “anuphal” or your dockerhub or repository username
    • Update tag after colon ‘:’ to latest
Next: Porting DeathStarBench Source Code
Previous: Porting Bitnami Containers: “redis-cluster”
Created At : May 10th 2023, 6:46:43 pm
Last Updated At : July 31st 2023, 4:56:30 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.