Skip to content

Commit 9c4b839

Browse files
authored
Updated inv-app docs (#262)
* Updated inv-app docs Signed-off-by: Noé Samaille <[email protected]> * Fix spellchecks Signed-off-by: Noé Samaille <[email protected]> Signed-off-by: Noé Samaille <[email protected]>
1 parent c80286d commit 9c4b839

File tree

5 files changed

+163
-213
lines changed

5 files changed

+163
-213
lines changed

docs/developer-advanced-1/inventory-cd/index.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ To create a project, do the following:
106106
### Configure the GitOps repo for Inventory Management service
107107
108108
- Clone the GitOps repository you created earlier, copy the folder `templates/app-helm` to the root of the repository and give it a name that matches the Inventory Management service component
109-
(e.g. `inventory-management-svc-{initials}`)
109+
(e.g. `inv-svc-{initials}`)
110110
111-
- Update `inventory-management-svc-{initials}/Chart.yaml` and update the name to match the directory name
111+
- Update `inv-svc-{initials}/Chart.yaml` and update the name to match the directory name
112112
113-
- Update `inventory-management-svc-{initials}/requirements.yaml` with the following values:
113+
- Update `inv-svc-{initials}/requirements.yaml` with the following values:
114114
115115
- `name` - the name of helm chart/image. This should match the folder name
116116
- `version` - the version number of the helm chart
@@ -119,7 +119,7 @@ To create a project, do the following:
119119
- here is an example
120120
```yaml
121121
dependencies:
122-
- name: inventory-management-svc-mjp
122+
- name: inv-svc-mjp
123123
version: 1.0.0-1
124124
repository: http://artifactory.mooc-one-rhos-cluster.us-east.containers.appdomain.cloud/artifactory/generic-local/mooc-team-one/
125125
```
@@ -132,13 +132,13 @@ To create a project, do the following:
132132
- Run `kubectl get configmap/ibmcloud-config -n tools -o yaml` to print the configuration information
133133
for the cluster
134134
135-
- In `inventory-management-svc-{initials}/values.yaml` replace `<app-chart-name>` with the directory name. Replace `ingressSubdomain` with the value from the previous step. Update `tlsSecretName` with the value from the previous step. The result should look something like the following
136-
```yaml title="inventory-management-svc-{initials}/values.yaml"
135+
- In `inv-svc-{initials}/values.yaml` replace `<app-chart-name>` with the directory name. Replace `ingressSubdomain` with the value from the previous step. Update `tlsSecretName` with the value from the previous step. The result should look something like the following
136+
```yaml title="inv-svc-{initials}/values.yaml"
137137
global:
138138
ingressSubdomain: sms-test.us-south.containers.appdomain.cloud
139139
tlsSecretName: sms-test-cluster
140140
141-
inventory-management-svc-{initials}:
141+
inv-svc-{initials}:
142142
replicaCount: 1
143143
144144
ingress:
@@ -149,7 +149,7 @@ for the cluster
149149
- Commit and push the changes
150150
```bash
151151
git add .
152-
git commit -m "Adds inventory-management-svc config"
152+
git commit -m "Adds inv-svc config"
153153
git push
154154
```
155155
@@ -162,12 +162,12 @@ connecting the config within the Git repo to the cluster and namespace.
162162
163163
- Click `New Application` and provide the following values:
164164
165-
- `application name` - `test-inventory-management-svc`
165+
- `application name` - `test-inv-svc`
166166
- `project` - `inventory-management`
167167
- `sync-policy` - `Automatic`
168168
- `repository url` - The url of the GitOps repository you created earlier
169169
- `revision` - `test`
170-
- `path` - `inventory-management-svc-{initials}`
170+
- `path` - `inv-svc-{initials}`
171171
- `destination cluster` - The cluster url for the deployment
172172
- `destination namespace` - `test-{initials}`
173173
- `values file` - `values.yaml`
@@ -189,13 +189,13 @@ watch ArgoCD apply the change.
189189
git checkout test
190190
```
191191
192-
- Update `inventory-management-svc-{initials}/values.yaml` to increase the replica count
193-
```yaml title="inventory-management-svc-{initials}/values.yaml"
192+
- Update `inv-svc-{initials}/values.yaml` to increase the replica count
193+
```yaml title="inv-svc-{initials}/values.yaml"
194194
global:
195195
ingressSubdomain: sms-test.us-south.containers.appdomain.cloud
196196
tlsSecretName: sms-test-cluster
197197
198-
inventory-management-svc-{initials}:
198+
inv-svc-{initials}:
199199
replicaCount: 3
200200
201201
ingress:

docs/developer-intermediate/inventory-bff/index.md

Lines changed: 63 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--- cSpell:ignore templatized ICPA openshiftconsole Theia userid toolset crwexposeservice gradlew bluemix ocinstall Mico crwopenlink crwopenapp swaggerui gitpat gituser buildconfig yourproject wireframe devenvsetup viewapp crwopenlink atemplatized rtifactoryurlsetup Kata Koda configmap Katacoda checksetup cndp katacoda checksetup Linespace igccli regcred REPLACEME Tavis pipelinerun openshiftcluster invokecloudshell cloudnative sampleapp bwoolf hotspots multicloud pipelinerun Sricharan taskrun Vadapalli Rossel REPLACEME cloudnativesampleapp artifactoryuntar untar Hotspot devtoolsservices Piyum Zonooz Farr Kamal Arora Laszewski Roadmap roadmap Istio Packt buildpacks automatable ksonnet jsonnet targetport podsiks SIGTERM SIGKILL minikube apiserver multitenant kubelet multizone Burstable checksetup handson stockbffnode codepatterns devenvsetup newwindow preconfigured cloudantcredentials apikey Indexyaml classname errorcondition tektonpipeline gradlew gitsecret viewapp cloudantgitpodscreen crwopenlink cdply crwopenapp -->
1+
<!--- cSpell:ignore templatized ICPA openshiftconsole Theia userid toolset crwexposeservice gradlew bluemix ocinstall Mico crwopenlink crwopenapp swaggerui gitpat gituser buildconfig yourproject wireframe devenvsetup viewapp crwopenlink atemplatized rtifactoryurlsetup Kata Koda configmap Katacoda checksetup cndp katacoda checksetup Linespace igccli regcred REPLACEME Tavis pipelinerun openshiftcluster invokecloudshell cloudnative sampleapp bwoolf hotspots multicloud pipelinerun Sricharan taskrun Vadapalli Rossel REPLACEME cloudnativesampleapp artifactoryuntar untar Hotspot devtoolsservices Piyum Zonooz Farr Kamal Arora Laszewski Roadmap roadmap Istio Packt buildpacks automatable ksonnet jsonnet targetport podsiks SIGTERM SIGKILL minikube apiserver multitenant kubelet multizone Burstable checksetup handson stockbffnode codepatterns devenvsetup newwindow preconfigured cloudantcredentials apikey Indexyaml classname errorcondition tektonpipeline gradlew gitsecret viewapp cloudantgitpodscreen crwopenlink cdply crwopenapp desktoplaptop -->
22
**Develop and deploy the BFF component of the inventory application**
33

44
The Inventory BFF's role in the architecture is to act as an orchestrator between the core business services and the specific digital channel it is focused on supporting. This class article will give you more detail about the [Backend For Frontend architectural pattern](https://samnewman.io/patterns/architectural/bff/) and the benefits.
@@ -11,116 +11,93 @@ The Inventory solution will use [GraphQL](https://graphql.org/) for its BFF laye
1111

1212
## Setup
1313

14-
### [Optional]: Access cloud shell
14+
### Create your OpenShift project and register the pipeline
1515

16-
If you don't plan to use your workstation to run this lab, you can use IBM Cloud Shell:
16+
- Create a new repository from the [Typescript GraphQL template](https://github.com/IBM/template-graphql-typescript/generate).
1717

18-
- Open the IBM Cloud console (cloud.ibm.com) in your browser and log in if needed.
18+
!!! warning
19+
If you are developing on a shared education cluster, place the repository in the **Git Organization** listed in your notification email and remember to add your initials as a suffix to the app name.
20+
- In order to prevent naming collisions, name the repository `inv-bff-{your initials}` replacing `{your initials}` with your actual initials.
1921

20-
- Invoke Cloud Shell by clicking on the button at the top, right-hand corner of the browser window.
22+
- Deploy this application with Tekton pipelines :
2123

22-
![Invoke Cloud Shell](../../images/common/invokecloudshell.png)
24+
=== "Using OpenShift web terminal"
25+
- In the OpenShift web console, head up to **Topology** menu on the left on the **Developer** perspective and click **Create a new project**.
2326

24-
### Setup your shell environment
27+
- Give a name to your project, call it `dev-{your initials}`, the other fields are optional.
2528

26-
We have provided a simplified installer that will install tools and configure the shell environment. The
27-
installer will first check if the required tool is available in the path. If not, the missing tool(s) will be
28-
installed into the `bin/` folder of the current user's home directory and the `PATH` variable will be updated in the
29-
`.bashrc` or `.zshrc` file to include that directory.
29+
- Initialize a web terminal using the `>_` button on the top bar next to your name on the cluster. You should have a terminal with all the necessary development tools.
3030

31-
The following tools are included in the shell installer:
31+
=== "Using your local terminal"
32+
!!! note
33+
You should have the `oc` and `igc` command line tools installed. If not, refer to the [developers tools setup page](/getting-started/devenvsetup/#tools-installation-on-desktoplaptop).
34+
35+
- In the OpenShift web console, click on email address top right, click on **Copy login command** and get the OpenShift login command, which includes a token.
36+
37+
- Click on **Display Token**, copy the Login with the token. oc login command will log you in. Run the login command in the cloud shell terminal:
38+
39+
```bash
40+
$ oc login --token=qvARHflZDlOYfjJZRJUEs53Yfy4F8aa6_L3ezoagQFM --server=https://c103-e.us-south.containers.cloud.ibm.com:30979
41+
Logged into "https://c103-e.us-south.containers.cloud.ibm.com:30979" as "IAM#email@company" using the token provided.
42+
43+
You have access to 71 projects, the list has been suppressed. You can list all projects with 'oc projects'
44+
```
3245

33-
- IBM Cloud cli (ibmcloud)
34-
- ArgoCD cli (argocd)
35-
- Tekton cli (tkn)
36-
- IBM Cloud fast switching (icc)
37-
- kube-ps1 prompt
38-
- OpenShift cli (oc)
39-
- Kubernetes cli (kubectl)
40-
- JSON cli (jq)
41-
- IBM Garage Cloud CLI (igc)
46+
- Clone the repository you created earlier
4247

43-
1. Set up the shell environment by running:
44-
```shell
45-
curl -sL shell.cloudnativetoolkit.dev | sh -
4648
```
47-
- **Note**: If successful, you should see something like the following:
48-
```shell
49-
Downloading scripts: https://github.com/cloud-native-toolkit/cloud-shell-commands/releases/download/0.6.1/assets.tar.gz
50-
** Installing argocd cli
51-
** Installing tkn cli
52-
** Installing kube-ps1
53-
** Installing icc
54-
** Installing Cloud-Native Toolkit cli
55-
```
56-
2. The installer updates PATH in the `.zshrc` or `.bashrc` file. You will need to source the file to apply the update to the current shell environment:
57-
```shell
58-
if [[ "${SHELL}" =~ zsh ]]; then
59-
source ~/.zshrc
60-
else
61-
source ~/.bashrc
62-
fi
49+
git clone https://github.com/cnw-team-{team}/inv-bff-{your initials}.git
6350
```
64-
3. You can check the shell was installed correctly by checking the `oc` version:
65-
```shell
66-
oc sync --version
67-
```
6851

69-
### Log in to OpenShift Cluster
52+
- Run the command
7053

71-
- Log in to OpenShift Cluster from the cloud console. Go to Resource listStockItems and click on the cluster:
72-
73-
![OpenShift](../../images/common/openshiftcluster.png)
74-
75-
- Access the OpenShift console from within that console by clicking on the button.
76-
77-
![OpenShift Console](../../images/common/openshiftconsole.png)
78-
79-
- In OpenShift Console, click on email address top right, Click on Copy Login Command and get the OpenShift login command, which includes a token.
80-
81-
![OpenShift Login](../../images/common/LoginCommand.png)
54+
```
55+
oc sync dev-{your initials}
56+
```
8257

83-
- click on **_Display Token_**, copy the Login with the token. `oc login` command will log you in. Run the login command in the cloud shell terminal:
84-
```bash
85-
$ oc login --token=qvARHflZDlOYfjJZRJUEs53Yfy4F8aa6_L3ezoagQFM --server=https://c103-e.us-south.containers.cloud.ibm.com:30979
86-
Logged into "https://c103-e.us-south.containers.cloud.ibm.com:30979" as "IAM#email@company" using the token provided.
58+
- Go to the directory of the repository your cloned and [Register the pipeline](/developer-intermediate/deploy-app#5-register-the-application-in-a-openshift-pipeline)
8759

88-
You have access to 71 projects, the list has been suppressed. You can list all projects with 'oc projects'
60+
```
61+
oc pipeline --tekton
62+
```
8963

90-
Using project "dev-ab".
91-
```
64+
- Give git credentials if prompted, and master as the git branch to use. When prompted for the pipeline, select `ibm-nodejs`
9265

93-
### Setup code base
66+
```bash
67+
$ oc pipeline --tekton
68+
...
9469

95-
To get the initial BFF project created and registered with a pipeline for automated builds follow these steps.
70+
Pipeline run started: inv-bff-ns-181f77c24a4
71+
```
9672

97-
- Create a new repository from the [Typescript GraphQL template](https://github.com/IBM/template-graphql-typescript/generate).
73+
- [Open the pipeline](/developer-intermediate/deploy-app/#5-register-the-application-in-a-openshift-pipeline) to see it running
9874

99-
!!! warning
100-
If you are developing on a shared education cluster, place the repository in the **Git Organization** listed in your notification email and remember to add your initials as a suffix to the app name.
101-
- In order to prevent naming collisions, name the repository `inventory-management-bff-{your initials}` replacing `{your initials}` with your actual initials.
75+
- When the pipeline is completed, run `oc endpoints -n dev-{your initials}`. You should see an entry for the app we just pushed. Select the entry and hit `Enter` to launch the browser.
10276

103-
- Clone the new repository to your machine.
77+
### Choose your development environment
10478

105-
- Run `npm install` to install all the package dependencies.
79+
=== "Gitpod"
80+
- Head over to [gitpod.io](https://gitpod.io), login with your github account by clicking **Continue with GitHub**.
81+
82+
- Grant access to gitpod to your GitHub organization by going to account settings on the top right corner, navigate to **Integrations**, go to GitHub and click **Manage on GitHub**.
83+
84+
- On GitHub, search the organization you have used to create the repository and click **grant** to allow gitpod to access repositories in that organization.
85+
86+
- Back to [gitpod.io](https://gitpod.io/workspaces), navigate to workspaces and click **New Workspace** to create a new workspace, give it your newly create repository URL.
87+
88+
- If it is your first gitpod workspace, it will ask you for your preferred editor, pick the in browser Visual Studio Code, and the workspace will be created automatically for your.
89+
90+
You are now ready to modify the application!
10691

107-
- Go into the repository directory cloned and execute the following:
92+
=== "Locally"
93+
Clone the project and open it using your favorite text editor or IDE (Visual Studio Code, Atom...).
10894

109-
```
110-
oc sync dev-{your initials}
111-
```
95+
```sh
11296

113-
- Register the pipeline:
114-
```
115-
oc pipeline --tekton
97+
git clone https://github.com/cnw-team-{team}/inv-bff-{your initials}.git
98+
cd inv-bff-{your initials}
99+
code .
116100
```
117-
- replacing `{your initials}` with your actual initials
118-
- Give git credentials if prompted, and master as the git branch to use. When prompted for the pipeline, select `igc-nodejs-<VERSION>`.
119-
120-
- Open the pipeline to see it running, using the link provided in the command output.
121-
122-
- When the pipeline is completed, run `oc endpoints -n dev-{your initials}`. You should see an entry for the app we just pushed. Select the entry and hit `Enter` to launch the browser, if you are working on your desktop/laptop. Otherwise copy the url and paste it in a new browser tab.
123-
124101
## Create the REST interface
125102

126103
The controller provides the REST interface for our BFF. The template uses the `typescript-rest`
@@ -655,7 +632,7 @@ The config class separates how the config is loaded from how it is used. In this
655632
```yaml title="chart/base/values.yaml"
656633
...
657634
658-
connectsTo: inventory-management-svc-{your initials}
635+
connectsTo: inv-svc-{your initials}
659636
660637
...
661638
```

docs/developer-intermediate/inventory-prebuilt-solution/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ In some cases with self pace hands on labs you may not get everything working. C
1313
### Inventory Service
1414

1515
- Create a new project from the [Inventory Management Service solution template](https://github.com/ibm-ecosystem-lab/inventory-management-svc-intermediate/generate)
16-
named `inv-man-svc-sol-{initials}`
17-
- Replacing `{initials}` with your actual initials
16+
named `inv-svc-solution-{initials}`
17+
- replacing `{initials}` with your actual initials
1818

1919
- Clone the repository to your local machine
2020

@@ -37,8 +37,8 @@ named `inv-man-svc-sol-{initials}`
3737
### Inventory BFF
3838
3939
- Create a new project from the [Inventory Management BFF solution template](https://github.com/ibm-ecosystem-lab/inventory-bff-prebuild/generate)
40-
named `inventory-management-bff-solution-{initials}`
41-
- Replacing `{initials}` with your actual initials
40+
named `inv-bff-solution-{initials}`
41+
- replacing `{initials}` with your actual initials
4242
4343
- Go into the cloned repository directory and execute the following, if you have not executed it previously:
4444
@@ -56,7 +56,7 @@ named `inventory-management-bff-solution-{initials}`
5656
5757
- Open the [pipeline to see it running](/developer-intermediate/deploy-app/#6-view-your-application-pipeline)
5858
59-
- Get the backend service name this value by executing the command `oc get svc -n dev-{initials}.
59+
- Get the backend service name this value by executing the command `oc get svc -n dev-{initials}`.
6060
```
6161
$ oc get svc -n dev-ar
6262
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
@@ -78,8 +78,8 @@ service of the microservice: `connectsTo: inventory-svc-ar`
7878
### Inventory UI
7979
8080
- Create a new project from the [Inventory Management UI solution template](https://github.com/ibm-ecosystem-lab/inventory-ui-prebuild/generate)
81-
named `inventory-management-ui-solution-{initials}`
82-
- Replacing `{initials}` with your actual initials
81+
named `inv-ui-solution-{initials}`
82+
- replacing `{initials}` with your actual initials
8383
8484
- Clone the repository to your local machine
8585

0 commit comments

Comments
 (0)