GRPC Test App - Bookstore

From Federal Burro of Information
Revision as of 00:08, 20 September 2023 by David (talk | contribs) (Created page with "<pre> #!/bin/bash curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get install -y docker tree mlocate vim lsof net-tools sudo apt install apt-transport-https ca-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
#!/bin/bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get install -y docker tree mlocate vim lsof net-tools

sudo apt install apt-transport-https ca-certificates curl software-properties-common

apt update
apt-cache policy docker-ce
apt install -y docker-ce
systemctl status docker

sudo docker network create --driver bridge esp_net
sudo docker run \
  --detach \
  --name=bookstore \
  --net=esp_net \
  gcr.io/endpointsv2/python-grpc-bookstore-server:1
sudo docker run \
  --detach \
  --name=esp \
  --publish=80:9000 \
  --net=esp_net \
  gcr.io/endpoints-release/endpoints-runtime:2 \
  --service=bookstore.endpoints.dthornton-test-20220714-001.cloud.goog \
  --rollout_strategy=managed \
  --listener_port=9000 \
  --healthz=/healthz \
  --backend=grpc://bookstore:8000

# Client testing"
# pip3 install virtualenv
# ~/.local/bin/virtualenv env
# source env/bin/activate
# python3 -m pip install -r requirements.txt
#
# PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \
# python bookstore_client.py --host 127.0.0.1 --port 80