Skip to content

Commit

Permalink
Merge pull request #115 from SAP-samples/updates-november-2023
Browse files Browse the repository at this point in the history
Updates november 2023
  • Loading branch information
matthieupelatan committed Dec 8, 2023
2 parents 118f06e + a701492 commit 09a3c43
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:20
FROM --platform=linux/amd64 node:18
WORKDIR /app

COPY code/day2-operations/source/day2-approuter/package.json .
Expand Down
6 changes: 5 additions & 1 deletion code/day2-operations/deployment/docker/Dockerfile-day2-ui
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ WORKDIR /app
COPY code/day2-operations/source/day2-ui/package*.json ./
RUN npm install
COPY code/day2-operations/source/day2-ui/. .

# Set the environment variable for Node.js
ENV NODE_OPTIONS=--openssl-legacy-provider

RUN npm run build

# production stage
FROM nginx:stable-alpine as production-stage
FROM --platform=linux/amd64 nginx:stable-alpine as production-stage
COPY --from=build-stage /app/resources /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion code/day2-operations/source/day2-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="icon" href="<%= BASE_URL %>ui/favicon.ico">
<link href="https://unpkg.com/fiori-fundamentals@latest/dist/fiori-fundamentals.min.css" rel="stylesheet">
<title><%= htmlWebpackPlugin.options.title %></title>
<link href="header.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion code/easyfranchise/deployment/docker/Dockerfile-approuter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:20
FROM --platform=linux/amd64 node:18

WORKDIR /app

Expand Down
6 changes: 5 additions & 1 deletion code/easyfranchise/deployment/docker/Dockerfile-ui
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# build stage
FROM --platform=linux/amd64 node:14-alpine as build-stage
FROM --platform=linux/amd64 node:18-alpine as build-stage
WORKDIR /app
COPY code/easyfranchise/source/ui/package*.json ./
RUN npm install
COPY code/easyfranchise/source/ui/. .

# Set the environment variable for Node.js
ENV NODE_OPTIONS=--openssl-legacy-provider

RUN npm run build

# production stage
Expand Down
29 changes: 26 additions & 3 deletions code/setup/easyfranchise-deployment.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,20 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
echo '-----------------------------------'
cat ./../easyfranchise/deployment/k8s/db-secret.yaml | sed "s~<db-sqlendpoint>~$DB_SQLENDPOINT~g" | sed "s~<db-admin>~$DB_ADMIN~g" | sed "s~<db-admin-password>~$DB_ADMIN_PASSWORD~g" | echo "$(cat -)"
echo '-----------------------------------'
else
cat ./../easyfranchise/deployment/k8s/db-secret.yaml | sed "s~<db-sqlendpoint>~$DB_SQLENDPOINT~g" | sed "s~<db-admin>~$DB_ADMIN~g" | sed "s~<db-admin-password>~$DB_ADMIN_PASSWORD~g" | kubectl apply -f - || true
else
log 'Creating DB Secret...'

cat ./../easyfranchise/deployment/k8s/db-secret.yaml | \
sed "s~<db-sqlendpoint>~$DB_SQLENDPOINT~g" | \
sed "s~<db-admin>~$DB_ADMIN~g" | \
sed "s~<db-admin-password>~$DB_ADMIN_PASSWORD~g" | \
kubectl apply -f -

if [ $? -eq 0 ]; then
log "kubectl apply successful"
else
log "kubectl apply failed"
fi || true
fi
echo
log "Registry Secrets"
Expand All @@ -422,8 +434,19 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
if [ "$DRY_RUN" = true ]; then
log "Skipped for Dry Run"
else
log "Creating backend and integration ConfigMaps..."
kubectl apply -n backend -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml
kubectl apply -n integration -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml
if [ $? -eq 0 ]; then
log "Successfully applied backend-configmap.yaml in the backend namespace"
else
log "Failed to apply backend-configmap.yaml in the backend namespace"
fi
kubectl apply -n integration -f ./../easyfranchise/deployment/k8s/backend-configmap.yaml
if [ $? -eq 0 ]; then
log "Successfully applied backend-configmap.yaml in the integration namespace"
else
log "Failed to apply backend-configmap.yaml in the integration namespace"
fi
fi
echo

Expand Down
22 changes: 11 additions & 11 deletions documentation/meter/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ When we speak about **docker-repository**, we mean the combination of account an
4. If the deployment was successful, you should see the following output:

``` bash
Release "day2-service" has been upgraded. Happy Helming!
Release "day2-service" does not exist. Installing it now.
NAME: day2-service
LAST DEPLOYED: Mon May 9 15:50:59 2022
NAMESPACE: default
LAST DEPLOYED: Fri Dec 8 10:50:59 2023
NAMESPACE: day2-operations
STATUS: deployed
REVISION: 3
REVISION: 1
TEST SUITE: None
```

Expand All @@ -147,12 +147,12 @@ When we speak about **docker-repository**, we mean the combination of account an
4. If the deployment was successful, you should see the following output:

``` bash
Release "day2-approuter" has been upgraded. Happy Helming!
Release "day2-approuter" does not exist. Installing it now.
NAME: day2-approuter
LAST DEPLOYED: Mon May 9 15:49:58 2022
NAMESPACE: default
LAST DEPLOYED: Fri Dec 8 10:55:59 2023
NAMESPACE: day2-operations
STATUS: deployed
REVISION: 3
REVISION: 1
TEST SUITE: None
```

Expand All @@ -178,11 +178,11 @@ When we speak about **docker-repository**, we mean the combination of account an
4. If the deployment was successful, you should see the following output:

``` bash
Release "day2-ui" has been upgraded. Happy Helming!
Release "day2-ui" does not exist. Installing it now.
NAME: day2-ui
LAST DEPLOYED: Mon May 9 15:51:56 2022
LAST DEPLOYED: Fri Dec 8 10:58:59 2023
NAMESPACE: day2-operations
STATUS: deployed
REVISION: 3
REVISION: 1
TEST SUITE: None
```
17 changes: 13 additions & 4 deletions documentation/meter/run-apps-kyma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ This chapter explains how to check that the metering scenario was deployed corre
## Check that the Database is running

1. Open your **EasyFranchise-Day2** account in SAP BTP Cockpit.
1. Choose **Services** > **Instances And Subsections** in the left navigation tree.
1. Choose **Services** > **Instances and Subscriptions** in the left navigation tree.
1. Select your Database and expand the "..." and select **View Dashboard**
1. Check in the opened dashboard that the database status is **running**.

## Create Metering Data

If it's not already done, you have to create metering data by using the Easy Franchise UI now.

1. Open the **City Scooter** subaccount in the SAP BTP Cockpit and go to **Instances and Subscriptions**. ![Open City Scooter Account](./images/base_ui_open.png)
1. Open the **City Scooter** subaccount in the SAP BTP Cockpit and go to **Instances and Subscriptions**. ![Open City Scooter Account](./images/2023_base_ui_open.png)

1. You can open the base mission UI by clicking the application **Easy Franchise (easyfranchise-day2...)**, where you will need to login. Then the City Scooter UI **Franchises Overview** should be displayed. ![Base Mission UI](./images/ef_base_mission_ui.png)

Expand All @@ -23,9 +23,18 @@ Opening the Easy Franchise UI is enough to trigger new metering data in the data

To view the metering data you have to open the day2 UI that you deployed in the last chapter.

1. Return to the **EasyFranchise-Day2** subaccount in the SAP BTP Cockpit. Select the **Overview** to see the link to the **Kyma Dashboard** under **Kyma Environment**.
1. Return to the **EasyFranchise** subaccount in the SAP BTP Cockpit.

1. Open the **Kyma Dashboard** and select the namespace **day2-operations**. Then go to **API Rules** under **Discovery and Network** ![API Rules in Kyma Dashboard](./images/get_ui_url.png)
1. Go to **Security** > **Users**, select your name and choose **Assign Role Collection**.
![Add Role Collection](./images/2023-add-day2-operator-role.png)

1. Select the role **Easy Franchise Day 2 Operator** and choose**Assign Role Collection**.
![Role Day2 Operator](./images/2023_add_role.png)

1. Now navigate to the **Overview** section and open the Kyma dashboard.

1.Select the namespace **day2-operations** and go to **API Rules** under **Discovery and Network**.
![API Rules in Kyma Dashboard](./images/2023_get_ui_url.png)

1. Select the **Host URL** to open the Day2 UI to get the list of active users per tenant. All data is aggregated for the selected month. If you followed the previous steps, you should see at least one entry for the current month.
![Metering Dashboard](./images/meter_ui.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09a3c43

Please sign in to comment.