Skip to content

Commit febcf87

Browse files
committed
Updated yelb-ui startup.sh to expect http:<endpoint>:4567 as input for $YELB_APPSERVER_ENDPOINT - container image elevated to 0.11
1 parent 99634f2 commit febcf87

21 files changed

+29
-30
lines changed

deployments/localtest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ docker network create yelb-network
99
docker run --name redis-server -p 6379:6379 --network=yelb-network -d redis:4.0.2
1010
docker run --name yelb-db -p 5432:5432 --network=yelb-network -d mreferre/yelb-db:0.6
1111
docker run --name yelb-appserver --network=yelb-network -d -p 4567:4567 -e RACK_ENV=test mreferre/yelb-appserver:0.6
12-
docker run --name yelb-ui --network=yelb-network -d -p 8080:80 -e UI_ENV=test mreferre/yelb-ui:0.9
12+
docker run --name yelb-ui --network=yelb-network -d -p 8080:80 -e UI_ENV=test mreferre/yelb-ui:0.10
1313
```
1414
You should now be able to see the application running by connecting your browser to: http://localhost:8080
1515

deployments/localtest/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: "2.1"
33
services:
44
yelb-ui:
5-
image: mreferre/yelb-ui:0.9
5+
image: mreferre/yelb-ui:0.10
66
depends_on:
77
- yelb-appserver
88
ports:

deployments/platformdeployment/AWS/ECS/cdk/lib/yelb-ecs-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class YelbEcsStack extends cdk.Stack {
2727
});
2828

2929
const yelbuicontainer = yelbuitaskdef.addContainer("yelb-ui-container", {
30-
image: ecs.ContainerImage.fromRegistry("mreferre/yelb-ui:0.9"),
30+
image: ecs.ContainerImage.fromRegistry("mreferre/yelb-ui:0.10"),
3131
environment: {"SEARCH_DOMAIN": yelbnamespace.namespaceName}
3232
})
3333

deployments/platformdeployment/AWS/ECS/cfn/yelb-cloudformation-ECS-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Resources:
197197
ContainerDefinitions:
198198
- Name: yelb-ui
199199
Essential: true
200-
Image: mreferre/yelb-ui:0.9
200+
Image: mreferre/yelb-ui:0.10
201201
Environment:
202202
- Name: SEARCH_DOMAIN
203203
Value: !Ref 'Domain'

deployments/platformdeployment/Docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: "3.0"
33
services:
44
yelb-ui:
5-
image: mreferre/yelb-ui:0.9
5+
image: mreferre/yelb-ui:0.10
66
depends_on:
77
- yelb-appserver
88
ports:

deployments/platformdeployment/Docker/stack-deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
yelb-ui:
4-
image: 'mreferre/yelb-ui:0.9'
4+
image: 'mreferre/yelb-ui:0.10'
55
depends_on:
66
- yelb-appserver
77
ports:

deployments/platformdeployment/Kubernetes/cdk8s/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class YelbCdk8s extends Chart {
3434
containers: [
3535
{
3636
name: 'yelb-ui-container',
37-
image: 'mreferre/yelb-ui:0.9',
37+
image: 'mreferre/yelb-ui:0.10',
3838
ports: [ { containerPort: 80 } ]
3939
}
4040
]

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-ingress-alb-ip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ spec:
9393
spec:
9494
containers:
9595
- name: yelb-ui
96-
image: mreferre/yelb-ui:0.9
96+
image: mreferre/yelb-ui:0.10
9797
ports:
9898
- containerPort: 80
9999
---

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-ingress-alb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ spec:
9292
spec:
9393
containers:
9494
- name: yelb-ui
95-
image: mreferre/yelb-ui:0.9
95+
image: mreferre/yelb-ui:0.10
9696
ports:
9797
- containerPort: 80
9898
---

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-loadbalancer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
spec:
7676
containers:
7777
- name: yelb-ui
78-
image: mreferre/yelb-ui:0.9
78+
image: mreferre/yelb-ui:0.10
7979
ports:
8080
- containerPort: 80
8181
---

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-minikube-hostport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
spec:
6262
containers:
6363
- name: yelb-ui
64-
image: mreferre/yelb-ui:0.9
64+
image: mreferre/yelb-ui:0.10
6565
ports:
6666
- containerPort: 80
6767
hostPort: 32777 # depending on the minikube driver you use you may be able to even use 80. But something above 32000 seems safer

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-minikube-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
spec:
8888
containers:
8989
- name: yelb-ui
90-
image: mreferre/yelb-ui:0.9
90+
image: mreferre/yelb-ui:0.10
9191
ports:
9292
- containerPort: 80
9393
---

deployments/platformdeployment/Kubernetes/yaml/pre-k8s-1.16/yelb-k8s-minikube-nodeport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
spec:
7777
containers:
7878
- name: yelb-ui
79-
image: mreferre/yelb-ui:0.9
79+
image: mreferre/yelb-ui:0.10
8080
ports:
8181
- containerPort: 80
8282
---

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-ingress-alb-ip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797
spec:
9898
containers:
9999
- name: yelb-ui
100-
image: mreferre/yelb-ui:0.9
100+
image: mreferre/yelb-ui:0.10
101101
ports:
102102
- containerPort: 80
103103
---

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-ingress-alb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ spec:
9696
spec:
9797
containers:
9898
- name: yelb-ui
99-
image: mreferre/yelb-ui:0.9
99+
image: mreferre/yelb-ui:0.10
100100
ports:
101101
- containerPort: 80
102102
---

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-loadbalancer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ spec:
7979
spec:
8080
containers:
8181
- name: yelb-ui
82-
image: mreferre/yelb-ui:0.9
82+
image: mreferre/yelb-ui:0.10
8383
ports:
8484
- containerPort: 80
8585
---

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-minikube-hostport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
spec:
6666
containers:
6767
- name: yelb-ui
68-
image: mreferre/yelb-ui:0.9
68+
image: mreferre/yelb-ui:0.10
6969
ports:
7070
- containerPort: 80
7171
hostPort: 32777 # depending on the minikube driver you use you may be able to even use 80. But something above 32000 seems safer

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-minikube-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ spec:
9494
spec:
9595
containers:
9696
- name: yelb-ui
97-
image: mreferre/yelb-ui:0.9
97+
image: mreferre/yelb-ui:0.10
9898
ports:
9999
- containerPort: 80
100100
---

deployments/platformdeployment/Kubernetes/yaml/yelb-k8s-minikube-nodeport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ spec:
8080
spec:
8181
containers:
8282
- name: yelb-ui
83-
image: mreferre/yelb-ui:0.9
83+
image: mreferre/yelb-ui:0.10
8484
ports:
8585
- containerPort: 80
8686
---

yelb-ui/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ This is the user interface module. It's an Angular2 application that uses the VM
22

33
The way this works may be a bit cumbersome. I basically clone the Clarity seed, I check out a specific commit (one that I have tested) and then copy/replace the files that are in the directory `clarity-seed-newfiles`. These files are both code and configuration of my app. You can look at the mechanics of how this happens either in the `Dockerfile` in this directory or in the `yelb-ui.sh` script in the `deployments/platformdeployment/Linux` directory.
44

5-
Depending on the deployment model being used the compile of the Angular2 application happens at different times.
5+
Depending on the deployment model being used, the compiling of the Angular2 application happens at different times.
66

77
For the EC2 deployment model, the UI gets compiled at deployment time via running the setup via cloud-init scripts. This is why the app may take a while to become available even though the CFN stack says it's all green and good. The instance where the UI is deployed takes about 5 minutes (or more depending on the instance type) to compile everything and start vending the javascript code.
88

99
For the container deployment model, the UI gets compiled at container image build time. This actually uses a two phase build where the resulting javascript code is copied into a brand new image based off of the `nginx` official image. Check out the Dockerfile to see how that works.
1010

11-
For the serverless deployment model the UI gets compiled once and pushed to an S3 bucket. This (public) bucket is then used as a source for deploying a new bucket that vends the code to the browser that makes the request. This requires an additional tweak because by default the application is configured to use the IP/FQDN of the UI web server to make the application API calls. This works fine for the EC2 and container deployments because the nginx will act as a proxy but in this case the UI needs to be pre-configured with the end-point of the API Gateway that makes available the API calls (which in turns call the Lambdas). Check out the serverless deployment model for more details on how that tweak works.
11+
For the serverless Lambda deployment model the UI gets compiled once and pushed to an S3 bucket. This (public) bucket is then used as a source for deploying a new bucket that vends the code to the browser that makes the request. This requires an additional tweak because by default the application is configured to use the IP/FQDN of the UI web server to make the application API calls. This works fine for the EC2 and container deployments because the nginx will act as a proxy but in this case the UI needs to be pre-configured with the end-point of the API Gateway that makes available the API calls (which in turns call the Lambdas). Check out the serverless deployment model for more details on how that tweak works.
1212

yelb-ui/startup.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
NGINX_CONF=/etc/nginx/conf.d/default.conf
33
cd clarity-seed
44

5-
if [ -z "$YELB_APPSERVER_ENDPOINT" ]; then YELB_APPSERVER_ENDPOINT="yelb-appserver"; fi
5+
if [ -z "$YELB_APPSERVER_ENDPOINT" ]; then YELB_APPSERVER_ENDPOINT="http://yelb-appserver:4567"; fi
66

77
# when the variable is populated a search domain entry is added to resolv.conf at startup
88
# this is needed for the ECS service discovery given the app works by calling host names and not FQDNs
9-
# a search domain can't be added to the container when using the awsvpc mode
10-
# and the awsvpc mode is needed for A records (bridge only supports SRV records)
11-
if [ $SEARCH_DOMAIN ]; then echo "search ${SEARCH_DOMAIN}" >> /etc/resolv.conf; fi
9+
# a search domain can't be added to the container when using the awsvpc mode
10+
# and the awsvpc mode is needed for A records (bridge only supports SRV records)
11+
if [ $SEARCH_DOMAIN ]; then echo "search ${SEARCH_DOMAIN}" >> /etc/resolv.conf; fi
1212

1313
sed -i -- 's#/usr/share/nginx/html#/clarity-seed/'$UI_ENV'/dist#g' $NGINX_CONF
1414

15-
# this adds the reverse proxy configuration to nginx
16-
# everything that hits /api is proxied to the app server
15+
# this adds the reverse proxy configuration to nginx
16+
# everything that hits /api is proxied to the app server
1717
if ! grep -q "location /api" "$NGINX_CONF"; then
1818
eval "cat <<EOF
1919
location /api {
20-
proxy_pass http://"$YELB_APPSERVER_ENDPOINT":4567/api;
20+
proxy_pass "$YELB_APPSERVER_ENDPOINT"/api;
2121
proxy_http_version 1.1;
2222
}
2323
gzip on;
@@ -29,6 +29,5 @@ EOF
2929
sed --in-place '/server_name localhost;/ r /proxycfg.txt' $NGINX_CONF
3030
fi
3131

32-
nginx -g "daemon off;"
33-
32+
nginx -g "daemon off;"
3433

0 commit comments

Comments
 (0)