File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed
Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 2525 pip install .[dev]
2626 pip list
2727
28+ - name : Start save-and-restore service
29+ run : |
30+ pushd container
31+ bash start-save-and-restore.sh
32+ popd
33+
2834 - name : Test with pytest
2935 run : |
3036 # pytest -k test_ip_kernel_func -vvv
Original file line number Diff line number Diff line change 1+ import socket
2+
3+ if __name__ == "__main__" :
4+ # Get the local IP address
5+ s = socket .socket (socket .AF_INET , socket .SOCK_DGRAM )
6+ s .connect (("8.8.8.8" , 80 ))
7+ ip = s .getsockname ()[0 ]
8+
9+ with open (".env" , "w" ) as f :
10+ f .write (f"HOST_EXTERNAL_IP_ADDRESS={ ip } " )
Original file line number Diff line number Diff line change 1+ # Running elasticsearch in docker
2+ # sudo docker compose -f save-and-restore.yml up -d
3+ # Test:
4+ # curl -X GET "http://localhost:9200/"
5+
6+ # .env file:
7+ #
8+ # HOST_EXTERNAL_IP_ADDRESS=192.168.50.49
9+
10+ services :
11+ saveandrestore :
12+ image : ghcr.io/controlsystemstudio/phoebus/service-save-and-restore:master
13+ ports :
14+ - " 8080:8080"
15+ depends_on :
16+ - elasticsearch
17+ environment :
18+ ELASTICSEARCH_NETWORK_HOST : ${HOST_EXTERNAL_IP_ADDRESS}
19+ EPICS_PVA_ADDR_LIST : ${HOST_EXTERNAL_IP_ADDRESS}
20+ EPICS_PVA_AUTO_ADDR_LIST : " NO"
21+ EPICS_PVA_ENABLE_IPV6 : " false"
22+ command : >
23+ /bin/bash -c "
24+ until curl --fail --silent http://${HOST_EXTERNAL_IP_ADDRESS}:9200/_cluster/health; do
25+ echo 'Waiting for Elasticsearch'
26+ sleep 1
27+ done
28+ java -DdefaultProtocol=pva -Dauthorization.permitall=false -Dauth.impl=demo -jar /saveandrestore/service-save-and-restore-*.jar"
29+ extra_hosts :
30+ - " host.docker.internal:host-gateway"
31+
32+ elasticsearch :
33+ image : docker.elastic.co/elasticsearch/elasticsearch:8.11.2
34+ ports :
35+ - " 9200:9200"
36+ environment :
37+ discovery.type : single-node
38+ bootstrap.memory_lock : " true"
39+ xpack.security.enabled : " false"
40+ volumes :
41+ - saveandrestore-es-data:/usr/share/elasticsearch/data
42+ extra_hosts :
43+ - " host.docker.internal:host-gateway"
44+
45+ volumes :
46+ saveandrestore-es-data :
47+ driver : local
Original file line number Diff line number Diff line change 1+ python create_env_file.py
2+ sudo docker compose -f save-and-restore.yml up -d
You can’t perform that action at this time.
0 commit comments