Skip to content

Commit ad1874b

Browse files
committed
wip12
1 parent ef007dc commit ad1874b

File tree

2 files changed

+128
-137
lines changed

2 files changed

+128
-137
lines changed

.github/ci-docker-compose.yml

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
version: "3.2"
2+
3+
services:
4+
db:
5+
restart: always
6+
image: mariadb:10.11
7+
container_name: cws-db
8+
ports:
9+
- "3306:3306"
10+
command: mysqld --max-connections=2000 --transaction-isolation=READ-COMMITTED
11+
environment:
12+
- MYSQL_DATABASE=cws
13+
- MYSQL_ROOT_PASSWORD=test
14+
- TZ=America/Los_Angeles
15+
healthcheck:
16+
test: '/usr/bin/mysql --user=root --password=test --execute "SHOW DATABASES;"'
17+
interval: 3s
18+
timeout: 1s
19+
retries: 5
20+
networks:
21+
- cws-network
22+
es:
23+
labels:
24+
com.example.service: "es"
25+
com.example.description: "For searching and indexing data"
26+
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
27+
container_name: cws-es
28+
ports:
29+
- "9200:9200"
30+
- "9300:9300"
31+
environment:
32+
- MAX_MAP_COUNT=262144
33+
- discovery.type=single-node
34+
- cluster.name=docker-cluster
35+
- xpack.security.enabled=false
36+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
37+
networks:
38+
- cws-network
39+
healthcheck:
40+
test:
41+
[
42+
"CMD-SHELL",
43+
"curl --silent --fail localhost:9200/_cluster/health || exit 1",
44+
]
45+
interval: 5s
46+
timeout: 2s
47+
retries: 12
48+
cws:
49+
container_name: cws-console
50+
labels:
51+
com.example.service: "cws-server"
52+
com.example.description: "Common Workflow Service"
53+
image: ${CWS_IMAGE_TAG}
54+
depends_on:
55+
- db
56+
- es
57+
- ldapsearch
58+
ports:
59+
- "38080:38080"
60+
- "38443:38443"
61+
- "31616:31616"
62+
hostname: cws-console
63+
environment:
64+
- DB_HOST=db
65+
- DB_USER=root
66+
- DB_PW=test
67+
- ES_PROTOCOL=http
68+
- ES_HOST=es
69+
- ES_PORT=9200
70+
healthcheck:
71+
test:
72+
[
73+
"CMD-SHELL",
74+
"curl -k --silent --fail https://localhost:38443/cws-ui/login || exit 1",
75+
]
76+
interval: 5s
77+
timeout: 2s
78+
retries: 12
79+
volumes:
80+
- ./config.properties:/home/cws_user/config.properties:ro
81+
- ~/.cws/creds:/root/.cws/creds:ro
82+
- console-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
83+
networks:
84+
- cws-network
85+
cws-worker:
86+
container_name: cws-worker1
87+
labels:
88+
com.example.service: "cws-worker1"
89+
com.example.description: "Common Workflow Service"
90+
image: ${CWS_IMAGE_TAG}
91+
depends_on:
92+
- db
93+
- es
94+
- cws
95+
- ldapsearch
96+
hostname: cws-worker1
97+
environment:
98+
- DB_HOST=db
99+
- DB_USER=root
100+
- DB_PW=test
101+
- ES_PROTOCOL=http
102+
- ES_HOST=es
103+
- ES_PORT=9200
104+
volumes:
105+
- ./worker-config.properties:/home/cws_user/config.properties:ro
106+
- ~/.cws/creds:/root/.cws/creds:ro
107+
- worker1-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
108+
networks:
109+
- cws-network
110+
ldapsearch:
111+
container_name: ldapsearch_container
112+
image: ghcr.io/nasa-ammos/common-workflow-service/openldap:v2.6
113+
ports:
114+
- 389:389
115+
networks:
116+
- cws-network
117+
118+
volumes:
119+
console-logs-volume:
120+
worker1-logs-volume:
121+
122+
networks:
123+
cws-network:

.github/workflows/docker-build.yml

+5-137
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ jobs:
104104
105105
- name: Set up Docker Compose environment
106106
run: |
107-
# Create a docker network
108-
docker network create cws-network
109-
110-
# Copy the docker-compose file
111-
cp install/docker/console-db-es-ls-kibana/docker-compose.yml docker-compose.test.yml
107+
# Export image tag as environment variable for docker-compose
108+
IMAGE_TAG="${{ needs.build.outputs.image_digest }}"
109+
echo "CWS_IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
112110
113111
# Copy config files from the repository
114112
cp .github/ci-console-config.properties config.properties
@@ -117,138 +115,8 @@ jobs:
117115
# Create creds directory if it doesn't exist
118116
mkdir -p ~/.cws/creds
119117
120-
# Edit the docker-compose.test.yml to use the built image
121-
IMAGE_TAG="${{ needs.build.outputs.image_digest }}"
122-
sed -i "s|nasa-ammos/common-workflow-service:2.6.0|${IMAGE_TAG}|g" docker-compose.test.yml
123-
124-
# Create a new Docker Compose file with the updated network configuration
125-
cat > docker-compose.test.yml << EOL
126-
version: "3.2"
127-
128-
services:
129-
db:
130-
restart: always
131-
image: mariadb:10.11
132-
container_name: cws-db
133-
ports:
134-
- "3306:3306"
135-
command: mysqld --max-connections=2000 --transaction-isolation=READ-COMMITTED
136-
environment:
137-
- MYSQL_DATABASE=cws
138-
- MYSQL_ROOT_PASSWORD=test
139-
- TZ=America/Los_Angeles
140-
healthcheck:
141-
test: '/usr/bin/mysql --user=root --password=test --execute "SHOW DATABASES;"'
142-
interval: 3s
143-
timeout: 1s
144-
retries: 5
145-
networks:
146-
- external-network
147-
es:
148-
labels:
149-
com.example.service: "es"
150-
com.example.description: "For searching and indexing data"
151-
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.0
152-
container_name: cws-es
153-
ports:
154-
- "9200:9200"
155-
- "9300:9300"
156-
environment:
157-
- MAX_MAP_COUNT=262144
158-
- discovery.type=single-node
159-
- cluster.name=docker-cluster
160-
- xpack.security.enabled=false
161-
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
162-
networks:
163-
- external-network
164-
healthcheck:
165-
test:
166-
[
167-
"CMD-SHELL",
168-
"curl --silent --fail localhost:9200/_cluster/health || exit 1",
169-
]
170-
interval: 5s
171-
timeout: 2s
172-
retries: 12
173-
cws:
174-
container_name: cws-console
175-
labels:
176-
com.example.service: "cws-server"
177-
com.example.description: "Common Workflow Service"
178-
image: ${IMAGE_TAG}
179-
depends_on:
180-
- db
181-
- es
182-
- ldapsearch
183-
ports:
184-
- "38080:38080"
185-
- "38443:38443"
186-
- "31616:31616"
187-
hostname: cws-console
188-
environment:
189-
- DB_HOST=db
190-
- DB_USER=root
191-
- DB_PW=test
192-
- ES_PROTOCOL=http
193-
- ES_HOST=es
194-
- ES_PORT=9200
195-
healthcheck:
196-
test:
197-
[
198-
"CMD-SHELL",
199-
"curl -k --silent --fail https://localhost:38443/cws-ui/login || exit 1",
200-
]
201-
interval: 5s
202-
timeout: 2s
203-
retries: 12
204-
volumes:
205-
- ./config.properties:/home/cws_user/config.properties:ro
206-
- ~/.cws/creds:/root/.cws/creds:ro
207-
- console-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
208-
networks:
209-
- external-network
210-
cws-worker:
211-
container_name: cws-worker1
212-
labels:
213-
com.example.service: "cws-worker1"
214-
com.example.description: "Common Workflow Service"
215-
image: ${IMAGE_TAG}
216-
depends_on:
217-
- db
218-
- es
219-
- cws
220-
- ldapsearch
221-
hostname: cws-worker1
222-
environment:
223-
- DB_HOST=db
224-
- DB_USER=root
225-
- DB_PW=test
226-
- ES_PROTOCOL=http
227-
- ES_HOST=es
228-
- ES_PORT=9200
229-
volumes:
230-
- ./worker-config.properties:/home/cws_user/config.properties:ro
231-
- ~/.cws/creds:/root/.cws/creds:ro
232-
- worker1-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
233-
networks:
234-
- external-network
235-
ldapsearch:
236-
container_name: ldapsearch_container
237-
image: ghcr.io/nasa-ammos/common-workflow-service/openldap:v2.6
238-
ports:
239-
- 389:389
240-
networks:
241-
- external-network
242-
243-
volumes:
244-
console-logs-volume:
245-
worker1-logs-volume:
246-
247-
networks:
248-
external-network:
249-
name: cws-network
250-
external: true
251-
EOL
118+
# Copy the pre-configured docker-compose file for CI
119+
cp .github/ci-docker-compose.yml docker-compose.test.yml
252120
253121
- name: Start containers with Docker Compose
254122
run: |

0 commit comments

Comments
 (0)