Skip to content

Commit 7d40aa8

Browse files
chore: bring back ui to docker-compose - AAP-34942 (#1130)
Signed-off-by: Alex <aizquier@redhat.com>
1 parent 8f6f7b1 commit 7d40aa8

8 files changed

+39
-24
lines changed

docs/deployment.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ You can start all services with:
7272
docker-compose -p eda -f docker-compose-stage.yaml up
7373
```
7474

75-
Note: **You can use the environment variables `EDA_IMAGE_URL` and `EDA_UI_IMAGE_URL` to use a different image url. By default is the latest code from the main branch.**
75+
Note: **You can use the environment variables `EDA_IMAGE_URL` and `EDA_UI_IMAGE` to use a different image url. By default is the latest code from the main branch.**
7676

7777
## Deploy using Minikube and Taskfile
7878

@@ -124,3 +124,5 @@ Minikube is the recommended method for macOS users
124124

125125
You can now inspect the API documentation at <https://localhost:8443/api/eda/v1/docs>
126126
or navigate through the resources with the DRF browsable API at <https://localhost:8443/api/eda/v1/>
127+
128+
You can also access the standalone UI at <http://localhost:8443/> with the default credentials `admin`/`testpass`.

docs/development.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ environment variables:
247247
* `EDA_DB_NAME` – Database name (default: `eda`)
248248

249249
### TLS-enabled redis
250+
250251
If you wish to run a development environment requiring TLS connections to redis it is a simple
251252
process...
253+
252254
1. build your container images as described above
253255
2. start them using `docker-compose -f ./tools/docker/docker-compose-dev-redis-tls.yaml up`
254256

@@ -388,4 +390,5 @@ task format:isort
388390
task format:black
389391
```
390392

391-
You can now access the api at <https://localhost:8443/api/eda/v1/docs> with default login username and password(admin/testpass).
393+
You can now access the api at <https://localhost:8443/api/eda/v1/docs> with the default credentials `admin`/`testpass`.
394+
You can also access the standalone UI at <http://localhost:8443/>.

docs/mac_development.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Development with podman on Mac
22

3-
If you are developing on Mac with podman this document will guide you thru the steps you need to
3+
If you are developing on Mac with podman this document will guide you thru the steps you need to
4+
45
1. Successfully run the product using podman
56
2. Make development changes and run product using your local changes
67

78
# Pre Requisites
9+
810
1. podman: [Podman for Mac](https://podman.io/getting-started/installation#macos)
911
2. docker-compose: [Docker for Mac](https://www.docker.com/docker-mac)
1012

11-
12-
13-
1413
### One time setup
14+
1515
1. brew install podman
1616
2. podman machine init --cpus 2 --memory 2048 --disk-size 100 --now
1717
3. alias docker=podman
@@ -32,26 +32,32 @@ If the value of userid is not 501
3232
export EDA_HOST_PODMAN_SOCKET_URL=/run/user/{your_uid}/podman/podman.sock
3333

3434
### No docker installed
35+
3536
No addtional steps needed
3637

3738
### With docker installed
39+
3840
We need to create a SSH tunnel between the Mac and the podman vm created above, we need the following steps
41+
3942
1. podman system connection ls
43+
4044
```
4145
Name URI Identity Default
4246
4347
podman-machine-default ssh://core@localhost:49473/run/user/501/podman/podman.sock
4448
```
49+
4550
example use the uid 501 above and port 49473 from your enviornment in the next step
4651

47-
2. Create a secure tunnel, and forward the local socket to the remote socket
52+
2. Create a secure tunnel, and forward the local socket to the remote socket
53+
4854
```
4955
ssh -fnNT -L/tmp/podman.sock:/run/user/{uid}/podman/podman.sock -i ~/.ssh/podman-machine-default ssh://core@localhost:{port} -o StreamLocalBindUnlink=yes
5056
5157
ps aux | grep "ssh -fnNT" |grep -v color
5258
```
53-
3. export DOCKER_HOST=unix:///tmp/podman.sock
5459

60+
3. export DOCKER_HOST=unix:///tmp/podman.sock
5561

5662
## Start the app with available images in quay.io
5763

@@ -68,7 +74,9 @@ You can build an image with your changes and use that image in docker-compose
6874
2. export EDA_IMAGE=localhost/myserver:latest
6975
3. docker-compose -f ./tools/docker/docker-compose-mac.yml up
7076

71-
You can now access the api at <https://localhost:8443/api/eda/v1/docs/> with default login username and password(admin/testpass).
77+
You can now access the api at <https://localhost:8443/api/eda/v1/docs> with the default credentials `admin`/`testpass`.
78+
You can also access the standalone UI at <http://localhost:8443/>.
7279

7380
## Layout
81+
7482
![Alt_PodmanDeployment](./podman_deployment.png?raw=true)

tools/docker/docker-compose-dev-redis-tls.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ x-environment:
4444
- EDA_RESOURCE_SERVER__VALIDATE_HTTPS=${EDA_RESOURCE_SERVER__VALIDATE_HTTPS:-False}
4545
- EDA_RESOURCE_JWT_USER_ID=${EDA_RESOURCE_JWT_USER_ID:-'@none None'}
4646
- EDA_ANSIBLE_BASE_MANAGED_ROLE_REGISTRY=${EDA_ANSIBLE_BASE_MANAGED_ROLE_REGISTRY:-@json {}}
47-
- EDA_STATIC_URL=${EDA_STATIC_URL:-api/eda/static/}
47+
- EDA_STATIC_URL=${EDA_STATIC_URL:-api/eda/v1/static/}
4848
- SSL_CERTIFICATE=${SSL_CERTIFICATE:-/certs/wildcard.crt}
4949
- SSL_CERTIFICATE_KEY=${SSL_CERTIFICATE_KEY:-/certs/wildcard.key}
5050
- SSL_CLIENT_CERTIFICATE=${SSL_CLIENT_CERTIFICATE:-/certs/client.crt}
@@ -233,8 +233,8 @@ services:
233233
- '../../:/app/src:z'
234234
restart: always
235235

236-
eda-nginx:
237-
image: ${EDA_NGINX_IMAGE:-docker.io/nginx:alpine}
236+
eda-ui:
237+
image: ${EDA_UI_IMAGE:-quay.io/ansible/eda-ui:main}
238238
environment: *common-env
239239
command: nginx -g "daemon off;"
240240
ports:

tools/docker/docker-compose-dev.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ x-environment: &common-env
4848
EDA_EVENT_STREAM_MTLS_BASE_URL: ${EDA_EVENT_STREAM_MTLS_BASE_URL:-https://localhost:8443/mtls/edgecafe-beef-feed-fade-decadeedgecafe/}
4949
EDA_WEBHOOK_HOST: ${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
5050
EDA_WEBHOOK_SERVER: http://${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
51-
EDA_STATIC_URL: ${EDA_STATIC_URL:-api/eda/static/}
51+
EDA_STATIC_URL: ${EDA_STATIC_URL:-api/eda/v1/static/}
5252
SSL_CERTIFICATE: ${SSL_CERTIFICATE:-/certs/wildcard.crt}
5353
SSL_CERTIFICATE_KEY: ${SSL_CERTIFICATE_KEY:-/certs/wildcard.key}
5454
SSL_CLIENT_CERTIFICATE: ${SSL_CLIENT_CERTIFICATE:-/certs/client.crt}
@@ -258,10 +258,9 @@ services:
258258
ports:
259259
- '${EDA_PROXY_PORT:-3128}:3128'
260260

261-
eda-nginx:
262-
image: ${EDA_NGINX_IMAGE:-docker.io/nginx:alpine}
261+
eda-ui:
262+
image: ${EDA_UI_IMAGE:-quay.io/ansible/eda-ui:main}
263263
environment: *common-env
264-
command: nginx -g "daemon off;"
265264
ports:
266265
- '${EDA_UI_PORT:-8443}:443'
267266
volumes:

tools/docker/docker-compose-mac.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ x-environment:
4444
- EDA_EVENT_STREAM_MTLS_BASE_URL=${EDA_EVENT_STREAM_MTLS_BASE_URL:-https://localhost:8443/mtls/edgecafe-beef-feed-fade-decadeedgecafe/}
4545
- EDA_WEBHOOK_HOST=${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
4646
- EDA_WEBHOOK_SERVER=http://${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
47-
- EDA_STATIC_URL=${EDA_STATIC_URL:-api/eda/static/}
47+
- EDA_STATIC_URL=${EDA_STATIC_URL:-api/eda/v1/static/}
4848
- SSL_CERTIFICATE=${SSL_CERTIFICATE:-/certs/wildcard.crt}
4949
- SSL_CERTIFICATE_KEY=${SSL_CERTIFICATE_KEY:-/certs/wildcard.key}
5050
- SSL_CLIENT_CERTIFICATE=${SSL_CLIENT_CERTIFICATE:-/certs/client.crt}
@@ -210,10 +210,9 @@ services:
210210
ports:
211211
- '${EDA_PROXY_PORT:-3128}:3128'
212212

213-
eda-nginx:
214-
image: ${EDA_NGINX_IMAGE:-docker.io/nginx:alpine}
213+
eda-ui:
214+
image: ${EDA_UI_IMAGE:-quay.io/ansible/eda-ui:main}
215215
environment: *common-env
216-
command: nginx -g "daemon off;"
217216
ports:
218217
- '${EDA_UI_PORT:-8443}:443'
219218
volumes:

tools/docker/docker-compose-stage.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ x-environment:
4141
- EDA_EVENT_STREAM_MTLS_BASE_URL=${EDA_EVENT_STREAM_MTLS_BASE_URL:-https://localhost:8443/mtls/edgecafe-beef-feed-fade-decadeedgecafe/}
4242
- EDA_WEBHOOK_HOST=${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
4343
- EDA_WEBHOOK_SERVER=http://${EDA_WEBHOOK_HOST:-eda-webhook-api:8000}
44+
- EDA_STATIC_URL=${EDA_STATIC_URL:-api/eda/static/}
4445
- SSL_CERTIFICATE=${SSL_CERTIFICATE:-/certs/wildcard.crt}
4546
- SSL_CERTIFICATE_KEY=${SSL_CERTIFICATE_KEY:-/certs/wildcard.key}
4647
- SSL_CLIENT_CERTIFICATE=${SSL_CLIENT_CERTIFICATE:-/certs/client.crt}
@@ -207,8 +208,8 @@ services:
207208
ports:
208209
- '${EDA_PROXY_PORT:-3128}:3128'
209210

210-
eda-nginx:
211-
image: ${EDA_NGINX_IMAGE:-docker.io/nginx:alpine}
211+
eda-ui:
212+
image: ${EDA_UI_IMAGE:-quay.io/ansible/eda-ui:main}
212213
environment: *common-env
213214
command: nginx -g "daemon off;"
214215
ports:

tools/docker/nginx/default.conf.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ server {
5858
proxy_set_header Connection "Upgrade";
5959
}
6060

61-
location ^~ /static/ {
61+
location ^~ /api/eda/static/ {
6262
alias /staticfiles/;
6363
}
6464

6565
location / {
66-
return 301 https://$host/api/eda/v1/docs;
66+
autoindex off;
67+
expires off;
68+
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
69+
try_files $uri /index.html =404;
6770
}
6871
}

0 commit comments

Comments
 (0)