Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/opensearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: OpenSearch
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'docs:') }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install sitespeed.io
run: npm ci
- name: Install Chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
google-chrome --version
- name: Install local HTTP server
run: npm install serve -g
- name: Start local HTTP server
run: (serve test/data/html/ -l 3001&)
- name: Start OpenSearch
run: docker compose -f test/docker/docker-compose.opensearch.yml up -d
- name: Wait for OpenSearch
run: |
timeout 90 bash -c \
'until curl -sf http://localhost:9200/_cluster/health | grep -q "\"status\":\"green\"\|\"status\":\"yellow\""; do
echo "Waiting for OpenSearch..."; sleep 3
done'
- name: Apply OpenSearch index templates
run: docker/opensearch/setup.sh http://localhost:9200
- name: Run test with OpenSearch
run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --opensearch.host 127.0.0.1 --xvfb
- name: Run test with OpenSearch including runs
run: bin/sitespeed.js http://127.0.0.1:3001/simple/ -n 1 --opensearch.host 127.0.0.1 --opensearch.includeRuns --xvfb
41 changes: 38 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: '3'
services:
grafana:
image: grafana/grafana:12.2.0
hostname: grafana
depends_on:
- graphite
- opensearch
links:
- graphite
ports:
Expand All @@ -16,7 +16,7 @@ services:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_USERS_ALLOW_SIGN_UP=false
- GF_USERS_ALLOW_ORG_CREATE=false
- GF_INSTALL_PLUGINS=grafana-piechart-panel,marcusolsson-json-datasource,marcusolsson-dynamictext-panel
- GF_INSTALL_PLUGINS=grafana-piechart-panel,marcusolsson-json-datasource,marcusolsson-dynamictext-panel,grafana-opensearch-datasource
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/var/lib/grafana/dashboards/Welcome.json
volumes:
- grafana:/var/lib/grafana
Expand All @@ -38,12 +38,47 @@ services:
- whisper:/opt/graphite/storage/whisper
# Download an empty graphite.db from https://github.com/sitespeedio/sitespeed.io/tree/main/docker/graphite
# - /absolute/path/to/graphite/graphite.db:/opt/graphite/storage/graphite.db
#
#
# And put the configuration files on your server, configure them as you need
# Download from https://github.com/sitespeedio/docker-graphite-statsd/tree/main/conf/graphite
# - /absolute/path/to/graphite/conf/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf
# - /absolute/path/to/graphite/conf/storage-aggregation.conf:/opt/graphite/conf/storage-aggregation.conf
# - /absolute/path/to/graphite/conf/carbon.conf:/opt/graphite/conf/carbon.conf
opensearch:
image: opensearchproject/opensearch:2
hostname: opensearch
environment:
- discovery.type=single-node
- DISABLE_SECURITY_PLUGIN=true
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m
ports:
- "9200:9200"
volumes:
- opensearch:/usr/share/opensearch/data
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:9200/_cluster/health"]
interval: 10s
timeout: 5s
retries: 20
restart: always
opensearch-setup:
image: curlimages/curl:latest
depends_on:
opensearch:
condition: service_healthy
volumes:
- ../docker/opensearch:/setup:ro
entrypoint: /bin/sh
command:
- -c
- |
for t in pagesummary run pagexray compare coach; do
curl -sf -X PUT "http://opensearch:9200/_index_template/sitespeed-$$t" \
-H 'Content-Type: application/json' \
-d "@/setup/index-template-$$t.json" && echo "Applied index template: sitespeed-$$t"
done
restart: "no"
volumes:
grafana:
whisper:
opensearch:
Loading
Loading