3232 ports :
3333 - 9200:9200
3434
35- opensearch_2_12 :
36- image : opensearchproject/opensearch:2.12.0
35+ opensearch_2_11 :
36+ image : opensearchproject/opensearch:2.11.1
3737 env :
3838 cluster.name : stac-cluster
3939 node.name : os01
@@ -42,32 +42,12 @@ jobs:
4242 discovery.type : single-node
4343 http.port : 9202
4444 http.cors.enabled : true
45- plugins.security.disabled : ' false'
46- OPENSEARCH_INITIAL_ADMIN_PASSWORD : ' admin'
47- DISABLE_SECURITY_DEMO_CONFIG : ' true'
48- plugins.security.ssl.http.enabled : ' false'
49- plugins.security.ssl.transport.enabled : ' false'
50- plugins.security.authcz.admin_dn :
51- - " "
52- plugins.security.nodes_dn :
53- - " "
54- OPENSEARCH_JAVA_OPTS : >-
55- -Xms512m
56- -Xmx512m
57- -Dopensearch.transport.cname_in_publish_address=true
58- -Dopensearch.cgroups.hierarchy.override=/
59- -Djava.security.manager=allow
60- action.destructive_requires_name : ' false'
61- bootstrap.memory_lock : ' false'
45+ plugins.security.disabled : true
46+ plugins.security.ssl.http.enabled : true
47+ OPENSEARCH_JAVA_OPTS : -Xms512m -Xmx512m
48+ action.destructive_requires_name : false
6249 ports :
6350 - 9202:9202
64- options : >-
65- --health-cmd="curl -f http://localhost:9202/_cluster/health || exit 1"
66- --health-interval=10s
67- --health-timeout=5s
68- --health-retries=10
69- --ulimit nofile=65536:65536
70- --ulimit memlock=-1:-1
7151
7252 strategy :
7353 matrix :
@@ -118,85 +98,6 @@ jobs:
11898 run : |
11999 pip install pytest-timeout
120100
121- - name : Wait for Search Service to be ready
122- run : |
123- set -e
124- host="localhost"
125- port="${{ matrix.backend == 'elasticsearch8' && '9200' || '9202' }}"
126- url="http://$host:$port/_cluster/health"
127- echo "Waiting for ${{ matrix.backend }} at $url"
128-
129- # Add initial delay
130- echo "Waiting 10s for service to start..."
131- sleep 10
132-
133- for i in $(seq 1 10); do # 10 retries * 5s = 50s max wait
134- if curl -sS --fail --show-error --max-time 5 "$url" 2>/dev/null | grep -E '"status":"(yellow|green)"' >/dev/null; then
135- echo "${{ matrix.backend }} is ready"
136- curl -sS "http://$host:$port" || true
137- exit 0
138- fi
139- echo "${{ matrix.backend }} not ready yet ($((i*5))s/50s) - waiting 5s"
140- sleep 5
141- done
142-
143- echo "${{ matrix.backend }} failed to become ready within timeout"
144- curl -sS -v "http://$host:$port/_cluster/health" || true
145- echo "Container logs:"
146- docker ps -a
147- docker logs $(docker ps -q --filter "ancestor=${{ matrix.backend == 'elasticsearch8' && 'docker.elastic.co/elasticsearch/elasticsearch:8.19.5' || 'opensearchproject/opensearch:2.12.0' }}" | head -1) || true
148- exit 1
149-
150- - name : Debug OpenSearch/Elasticsearch status
151- if : always()
152- run : |
153- echo "=== System Information ==="
154- echo "Hostname: $(hostname)"
155- echo "IP Addresses: $(hostname -I || true)"
156- echo "Docker version: $(docker --version || true)"
157- echo "Docker info:"
158- docker info || true
159-
160- echo "\n=== Container Status ==="
161- docker ps -a || true
162-
163- echo "\n=== Network Information ==="
164- docker network inspect bridge || true
165-
166- echo "\n=== OpenSearch Container Logs ==="
167- OPENSEARCH_ID=$(docker ps -a --filter "ancestor=opensearchproject/opensearch:2.12.0" -q | head -1 || true)
168- if [ -n "$OPENSEARCH_ID" ]; then
169- echo "Container logs for $OPENSEARCH_ID:"
170- docker logs --tail 500 $OPENSEARCH_ID || true
171- echo "\nContainer inspect:"
172- docker inspect $OPENSEARCH_ID || true
173- echo "\nContainer environment:"
174- docker exec $OPENSEARCH_ID env || true
175- else
176- echo "No OpenSearch container found"
177- fi
178-
179- echo "\n=== Elasticsearch Container Logs ==="
180- ES_ID=$(docker ps -a --filter "ancestor=docker.elastic.co/elasticsearch/elasticsearch:8.19.5" -q | head -1 || true)
181- if [ -n "$ES_ID" ]; then
182- echo "Container logs for $ES_ID:"
183- docker logs --tail 500 $ES_ID || true
184- else
185- echo "No Elasticsearch container found"
186- fi
187-
188- echo "\n=== Port Check ==="
189- echo "Port 9200 (Elasticsearch): $(nc -zv localhost 9200 2>&1 || true)"
190- echo "Port 9202 (OpenSearch): $(nc -zv localhost 9202 2>&1 || true)"
191-
192- echo "\n=== Disk Space ==="
193- df -h || true
194-
195- echo "\n=== Memory Info ==="
196- free -h || true
197- env :
198- ES_PORT : ${{ matrix.backend == 'elasticsearch8' && '9200' || '9202' }}
199-
200101 - name : Run test suite
201102 run : |
202103 pipenv run pytest -svvv --timeout=300
@@ -207,7 +108,4 @@ jobs:
207108 ES_USE_SSL : false
208109 DATABASE_REFRESH : true
209110 ES_VERIFY_CERTS : false
210- BACKEND : ${{ matrix.backend == 'elasticsearch8' && 'elasticsearch' || 'opensearch' }}
211- OPENSEARCH_USER : admin
212- OPENSEARCH_PASSWORD : admin
213- OPENSEARCH_USE_SSL : ' false'
111+ BACKEND : ${{ matrix.backend == 'elasticsearch8' && 'elasticsearch' || 'opensearch' }}
0 commit comments