GRPC Test App - Bookstore: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
(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-...") |
No edit summary |
||
Line 1: | Line 1: | ||
#!/bin/bash | #!/bin/bash | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
Line 6: | Line 5: | ||
apt-get install -y docker tree mlocate vim lsof net-tools | apt-get install -y docker tree mlocate vim lsof net-tools | ||
apt-get install -y apt-transport-https ca-certificates curl software-properties-common | |||
apt update | apt update | ||
Line 31: | Line 30: | ||
--backend=grpc://bookstore:8000 | --backend=grpc://bookstore:8000 | ||
# Client testing | # Client testing | ||
# pip3 install virtualenv | # pip3 install virtualenv | ||
# ~/.local/bin/virtualenv env | # ~/.local/bin/virtualenv env | ||
Line 39: | Line 38: | ||
# PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \ | # PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python \ | ||
# python bookstore_client.py --host 127.0.0.1 --port 80 | # python bookstore_client.py --host 127.0.0.1 --port 80 | ||
Revision as of 00:47, 20 September 2023
- !/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
apt-get install -y 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