Skip to content
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ auth/*
.env/*
/secrets/generated/
/target

# streamx run delivery web service content repository
/repository
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The PureSight demo allows you to see each of these elements in action in real-ti
Start the mesh defined in `mesh.yaml`:

```bash
source env/local/.env.sh
streamx run -f mesh.yaml
```

Expand All @@ -48,19 +49,21 @@ Wait until the process completes.
Start PIM:

```bash
source env/local/.env.sh
sh scripts/run-pim.sh
```

### Run WebSight CMS

```bash
source env/local/.env.sh
sh scripts/run-websight.sh
```

### Run Proxy Server

```bash
sh scripts/run-proxy.sh
sh env/local/run-proxy.sh
```

### Verify the Setup
Expand Down Expand Up @@ -104,6 +107,7 @@ Visit: [http://pim.127.0.0.1.nip.io](http://pim.127.0.0.1.nip.io) and click the
You can change the price of any product by passing the product ID and the desired price:

```bash
source env/local/.env.sh
sh scripts/prices/publish-price.sh B071FMSYNH 994
```

Expand All @@ -114,6 +118,7 @@ sh scripts/prices/publish-price.sh B071FMSYNH 994
You can also add reviews for a product:

```bash
source env/local/.env.sh
sh scripts/reviews/publish.sh B071FMSYNH
```

Expand Down
94 changes: 90 additions & 4 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,111 @@
defaults:
global:
resources:
requests:
cpu: 400m
memory: 512Mi
probes: # TODO: Remove default kubernetes configs after default StreamX Operator defaults adjustment.
liveness:
httpGet:
path: /q/health/live
port: 8080
initialDelaySeconds: 0 # Default value
periodSeconds: 10 # Default value
timeoutSeconds: 1 # Default value
successThreshold: 1 # Default value
failureThreshold: 3 # Default value
readiness:
httpGet:
path: /q/health/ready
port: 8080
initialDelaySeconds: 0 # Default value
periodSeconds: 10 # Default value
timeoutSeconds: 1 # Default value
successThreshold: 1 # Default value
failureThreshold: 3 # Default value
startup:
httpGet:
path: /q/health/startup
port: 8080
initialDelaySeconds: 0 # Default value
periodSeconds: 10 # Default value
timeoutSeconds: 1 # Default value
successThreshold: 1 # Default value
failureThreshold: 3
delivery:
replicas: 3

ingestion:
rest-ingestion:
ingress:
enabled: true
ingressClassName: "nginx"
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "500m"
hosts:
- host: ingestion.127.0.0.1.nip.io
- host: host.docker.internal
- host: ingestion.${streamx-ingress-ip}.nip.io
delivery:
blueprint-web:
ingress:
enabled: true
ingressClassName: "nginx"
hosts:
- host: puresight.127.0.0.1.nip.io
- host: puresight.${streamx-ingress-ip}.nip.io
paths:
- servicePort: 80
tls:
- hosts:
- puresight.${streamx-ingress-ip}.nip.io
secretName: blueprint-web.crt
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-cert-cluster-issuer"
blueprint-search:
ingress:
enabled: true
ingressClassName: "nginx"
hosts:
- host: puresight.127.0.0.1.nip.io
- host: puresight.${streamx-ingress-ip}.nip.io
paths:
- path: /search
tls:
- hosts:
- puresight.${streamx-ingress-ip}.nip.io
secretName: blueprint-search.crt
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-cert-cluster-issuer"
probes:
liveness: { }
components:
opensearch:
sidecar: true
probes:
readiness:
httpGet:
path: /
port: 9200
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
liveness:
httpGet:
path: /
port: 9200
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
startup:
httpGet:
path: /
port: 9200
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3

8 changes: 8 additions & 0 deletions env/cloud/.env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Cloud kubeconfig path. If StreamX Platform Terraform script was applied on the same host as this script is launched it can be taken from its 'kubeconfig_path' output.
export KUBECONFIG=
# Cloud Load Balancer IP. Should be taken from StreamX Platform Terraform script 'loadbalancer_ip' output
export STREAMX_INGRESS_IP=
export STREAMX_TOKEN_PIM=$(kubectl get secrets sx-sec-auth-jwt-pim -o jsonpath -o jsonpath="{.data.jwt}" | base64 --decode)
export STREAMX_TOKEN_WS=$(kubectl get secrets sx-sec-auth-jwt-websight -o jsonpath -o jsonpath="{.data.jwt}" | base64 --decode)
export STREAMX_INGESTION_URL="http://ingestion.${STREAMX_INGRESS_IP}.nip.io"
export STREAMX_INTERNAL_INGESTION_URL="$STREAMX_INGESTION_URL"
5 changes: 5 additions & 0 deletions env/local/.env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export STREAMX_TOKEN_PIM=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local should be default from .env file, that is overridden by sh script for cloud deployment.
https://quarkus.io/guides/images/config-sources.png

export STREAMX_TOKEN_WS=
export STREAMX_INGRESS_IP="127.0.0.1"
export STREAMX_INGESTION_URL="http://ingestion.${STREAMX_INGRESS_IP}.nip.io"
export STREAMX_INTERNAL_INGESTION_URL="http://host.docker.internal"
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mesh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ processing:
topic: outboxes/web-resources
environment:
# local test domain, see readme
STREAMX_BLUEPRINTS_SITEMAP-GENERATOR-PROCESSING-SERVICE_BASE-URL: "http://puresight.127.0.0.1.nip.io"
STREAMX_BLUEPRINTS_SITEMAP-GENERATOR-PROCESSING-SERVICE_BASE-URL: "http://puresight.${STREAMX_INGRESS_IP}.nip.io"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could configure whole domains, so that many people can deploy on the single cluster in multiple namespaces?

STREAMX_BLUEPRINTS_SITEMAP-GENERATOR-PROCESSING-SERVICE_OUTPUT-KEY: "/sitemap.xml"

blueprint-indexable-resource-extractor:
Expand Down
4 changes: 2 additions & 2 deletions scripts/price/publish-price.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
INGESTION_URL="http://ingestion.127.0.0.1.nip.io"
PRODUCT_ID=${1:-B071FMSYNH}
PRICE=${2:-2559}

curl -o - -X POST "${INGESTION_URL}/ingestion/v1/channels/data/messages" \
curl -o - -X POST "${STREAMX_INGESTION_URL}/ingestion/v1/channels/data/messages" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${STREAMX_TOKEN_PIM}" \
-d '{
"key" : "price:'${PRODUCT_ID}'",
"action" : "publish",
Expand Down
9 changes: 4 additions & 5 deletions scripts/reviews/publish.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
INGESTION_URL="http://ingestion.127.0.0.1.nip.io"
PRODUCT_ID=${1:-B071FMSYNH}

curl -o - -X POST "${INGESTION_URL}/ingestion/v1/channels/data/messages" \
curl -o - -X POST "${STREAMX_INGESTION_URL}/ingestion/v1/channels/data/messages" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${TOKEN}" \
-H "Authorization: Bearer ${STREAMX_TOKEN_PIM}" \
-d '{
"key" : "review:'${PRODUCT_ID}':1",
"action" : "publish",
Expand All @@ -18,9 +17,9 @@ curl -o - -X POST "${INGESTION_URL}/ingestion/v1/channels/data/messages" \
}
}'

curl -o - -X POST "${INGESTION_URL}/ingestion/v1/channels/data/messages" \
curl -o - -X POST "${STREAMX_INGESTION_URL}/ingestion/v1/channels/data/messages" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${TOKEN}" \
-H "Authorization: Bearer ${STREAMX_TOKEN_PIM}" \
-d '{
"key" : "review:'${PRODUCT_ID}':2",
"action" : "publish",
Expand Down
13 changes: 0 additions & 13 deletions scripts/run-pim-k8s.sh

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/run-pim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ docker rm streamx-demo-sandbox-pim
docker run --name streamx-demo-sandbox-pim \
--add-host=host.docker.internal:host-gateway \
-p 9000:8080 \
-e STREAMX_URL=http://host.docker.internal \
-e STREAMX_URL="$STREAMX_INTERNAL_INGESTION_URL" \
-e STREAMX_TOKEN="$STREAMX_TOKEN_PIM" \
-e QUARKUS_HTTP_AUTH_FORM_TIMEOUT=PT1M \
${IMAGE}
15 changes: 0 additions & 15 deletions scripts/run-websight-k8s.sh

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/run-websight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ docker run --name streamx-demo-sandbox-websight-cms \
-p 5009:5009 \
-e JAVA_DEBUG_PORT=5009 \
-e STREAMX_PUBLICATION_ENABLE=true \
-e PURESIGHT_STREAMX_REST_INGESTION_HOST=http://host.docker.internal \
-e PURESIGHT_STREAMX_REST_INGESTION_HOST="$STREAMX_INTERNAL_INGESTION_URL" \
-e PURESIGHT_STREAMX_REST_INGESTION_AUTH_TOKEN="$STREAMX_TOKEN_WS" \
${IMAGE}