From e9ac08b30b6d4b4dc7658f595167ed1d10863f70 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Thu, 14 Dec 2023 21:15:27 -0500 Subject: [PATCH] remove playwright Signed-off-by: Pierre Tessier --- .env | 1 - CHANGELOG.md | 2 -- docker-compose.yml | 3 +-- kubernetes/opentelemetry-demo.yaml | 4 +--- src/loadgenerator/Dockerfile | 2 -- src/loadgenerator/locustfile.py | 32 ------------------------------ src/loadgenerator/requirements.txt | 3 +-- 7 files changed, 3 insertions(+), 44 deletions(-) diff --git a/.env b/.env index 7722d701b1..74ae9122e9 100644 --- a/.env +++ b/.env @@ -67,7 +67,6 @@ LOCUST_HOST=http://${FRONTEND_PROXY_ADDR} LOCUST_WEB_HOST=loadgenerator LOCUST_AUTOSTART=true LOCUST_HEADLESS=false -LOCUST_BROWSER_TRAFFIC_ENABLED=false # Payment Service PAYMENT_SERVICE_PORT=50051 diff --git a/CHANGELOG.md b/CHANGELOG.md index d24fb12ef6..909adf91fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,6 @@ release. ([#1265](https://github.com/open-telemetry/opentelemetry-demo/pull/1265)) * [cartservice] update .NET to .NET 8.0 ([#1272](https://github.com/open-telemetry/opentelemetry-demo/pull/1272)) -* enable browser traffic in loadgenerator using playwright - ([#1266](https://github.com/open-telemetry/opentelemetry-demo/pull/1266)) * update loadgenerator dependencies and the base image ([#1274](https://github.com/open-telemetry/opentelemetry-demo/pull/1274)) * [currencyservice]: update opentelemetry-cpp to 1.12.0 diff --git a/docker-compose.yml b/docker-compose.yml index 934da68c22..10b6c1182d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -369,7 +369,7 @@ services: deploy: resources: limits: - memory: 1G + memory: 120M restart: unless-stopped ports: - "${LOCUST_WEB_PORT}" @@ -379,7 +379,6 @@ services: - LOCUST_HOST - LOCUST_HEADLESS - LOCUST_AUTOSTART - - LOCUST_BROWSER_TRAFFIC_ENABLED - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES diff --git a/kubernetes/opentelemetry-demo.yaml b/kubernetes/opentelemetry-demo.yaml index 130594cf2c..dcc93781c5 100644 --- a/kubernetes/opentelemetry-demo.yaml +++ b/kubernetes/opentelemetry-demo.yaml @@ -9818,8 +9818,6 @@ spec: value: "false" - name: LOCUST_AUTOSTART value: "true" - - name: LOCUST_BROWSER_TRAFFIC_ENABLED - value: "false" - name: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION value: python - name: OTEL_EXPORTER_OTLP_ENDPOINT @@ -9828,7 +9826,7 @@ spec: value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo resources: limits: - memory: 1Gi + memory: 120Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 diff --git a/src/loadgenerator/Dockerfile b/src/loadgenerator/Dockerfile index 2c14005aea..473bf73772 100644 --- a/src/loadgenerator/Dockerfile +++ b/src/loadgenerator/Dockerfile @@ -17,6 +17,4 @@ WORKDIR /usr/src/app/ COPY --from=builder /reqs /usr/local COPY ./src/loadgenerator/locustfile.py . COPY ./src/loadgenerator/people.json . -ENV LOCUST_PLAYWRIGHT=1 -RUN playwright install --with-deps chromium ENTRYPOINT locust diff --git a/src/loadgenerator/locustfile.py b/src/loadgenerator/locustfile.py index c5aac08b2b..8065f07e9e 100644 --- a/src/loadgenerator/locustfile.py +++ b/src/loadgenerator/locustfile.py @@ -5,11 +5,9 @@ import json -import os import random import uuid from locust import HttpUser, task, between -from locust_plugins.users.playwright import PlaywrightUser, pw, PageWithRetry, event from opentelemetry import context, baggage, trace from opentelemetry.metrics import set_meter_provider @@ -132,33 +130,3 @@ def on_start(self): context.attach(ctx) self.index() - -browser_traffic_enabled = os.environ.get('LOCUST_BROWSER_TRAFFIC_ENABLED', False) - -if browser_traffic_enabled: - class WebsiteBrowserUser(PlaywrightUser): - headless = True # to use a headless browser, without a GUI - multiplier = 1 # run concurrent playwright sessions/browsers for each Locust user - wait_time = between(1, 10) - - @task - @pw - async def open_cart_browser_page(self, page: PageWithRetry): - try: - async with event(self, "Load up Cart Page"): - await page.goto("/cart") - except: - pass - - @task - @pw - async def open_home_browser_page(self, page: PageWithRetry): - try: - async with event(self, "Load up Astronomy Shop home page"): - await page.goto("/") - async with event(self, "Click on Go Shopping button"): - async with page.expect_navigation(wait_until="domcontentloaded"): - await page.click('button:has-text("Go Shopping")') - except: - pass - diff --git a/src/loadgenerator/requirements.txt b/src/loadgenerator/requirements.txt index f0e72bd6e4..0f7bb7552e 100644 --- a/src/loadgenerator/requirements.txt +++ b/src/loadgenerator/requirements.txt @@ -11,11 +11,10 @@ flask-cors==4.0.0 gevent==23.9.1 geventhttpclient==2.0.11 googleapis-common-protos==1.61.0 -greenlet==3.0.0 +greenlet==3.0.1 idna==3.4 itsdangerous==2.1.2 jinja2==3.1.2 -locust_plugins==3.4.0 locust==2.18.2 markupsafe==2.1.3 msgpack==1.0.7