This readme explains the steps to build and run the pet-store cells by your own. Follow the instruction given below to,
- Clone the wso2-cellery/samples repository
- Navigate to the pet-store Sample.
cd <SAMPLES_ROOT>/cells/pet-store
- Build the pet-be cell by executing
cellery build
command as shown below.
$ cd pet-be
$ cellery build pet-be.bal wso2cellery/pet-be-cell:latest
Warning: Value is empty for environment variable "ORDER_HOST"
Warning: Value is empty for environment variable "CATALOG_HOST"
Warning: Value is empty for environment variable "CUSTOMER_HOST"
true
✔ Building image wso2cellery/pet-be-cell:latest
✔ Removing old Image
✔ Saving new Image to the Local Repository
✔ Successfully built cell image: wso2cellery/pet-be-cell:latest
What's next?
--------------------------------------------------------
Execute the following command to run the image:
$ cellery run wso2cellery/pet-be-cell:latest
--------------------------------------------------------
-
View the cell information by executing
cellery view
command. This will open up a new tab in the browser and shows the component and dependency details of the cell.$ cellery view wso2cellery/pet-be-cell:latest
-
Execute
cellery list ingress
to see the list ingress supported by the pet-be cell, and you can see onlycontroller
component is exposing the API.$ cellery list ingress wso2cellery/pet-be-cell:latest COMPONENT INGRESS TYPE INGRESS CONTEXT INGRESS PORT GLOBALLY EXPOSED ------------ -------------- ----------------- -------------- ------------------ controller HTTP controller 80 False
-
Build the pet-fe cell by executing the
cellery build
command.$ cd pet-fe $ cellery build pet-fe.bal wso2cellery/pet-fe-cell:latest Warning: Value is empty for environment variable "PET_STORE_CELL_URL" true ✔ Building image wso2cellery/pet-fe-cell:latest ✔ Removing old Image ✔ Saving new Image to the Local Repository ✔ Successfully built cell image: wso2cellery/pet-fe-cell:latest What's next? -------------------------------------------------------- Execute the following command to run the image: $ cellery run wso2cellery/pet-fe-cell:latest --------------------------------------------------------
-
View the inner components and cell dependency of cell wso2cellery/pet-fe-cell:latest.
$ cellery view wso2cellery/pet-fe-cell:latest
-
Run the pet-fe cell with instance name
pet-fe
, and provide the dependent pet-be cell instance aspet-be
. As we haven't started the pet-be cell instance, we'll pass-d
or--start-dependencies
flag with run command to start dependent cell instance if it is not available in the runtime.$ cellery run wso2cellery/pet-fe-cell:latest -n pet-fe -l petStoreBackend:pet-be -d ✔ Extracting Cell Image wso2cellery/pet-fe-cell:latest Main Instance: pet-fe ✔ Reading Cell Image wso2cellery/pet-fe-cell:latest ✔ Validating dependency links ✔ Generating dependency tree ✔ Validating dependency tree Instances to be Used: INSTANCE NAME CELL IMAGE USED INSTANCE SHARED --------------- ------------------------------- --------------- -------- pet-be wso2cellery/pet-be-cell:latest To be Created - pet-fe wso2cellery/pet-fe-cell:latest To be Created - Dependency Tree to be Used: pet-fe └── petStoreBackend: pet-be ? Do you wish to continue with starting above Cell instances (Y/n)? ✔ Starting instance pet-be ✔ Starting dependencies ✔ Starting main instance pet-fe ✔ Successfully deployed cell image: wso2cellery/pet-fe-cell:latest What's next? -------------------------------------------------------- Execute the following command to list running cells: $ cellery list instances --------------------------------------------------------
-
Optionally check the status of the running cell pet-fe.
$ cellery status pet-fe CREATED STATUS --------------------- -------- 5 minutes 3 seconds Ready -COMPONENTS- NAME STATUS --------- ----------------------------- gateway Up for 4 minutes 52 seconds portal Up for 4 minutes 49 seconds sts Up for 4 minutes 55 seconds
As both pet-fe and pet-be cells are up and running, now you can view the actual pet-store application by following the instructions here
- Cell Test - perform pet-be cell test and shows the results in the log file.
- Observe the pet-store - this shows how you can observe and understand the runtime operations to the pet-store application.
- Update pet-be cell - provides the steps to update the components of the pet-be cell.
- Advanced deployments with pet-be cell - perform advanced deployments with pet-be cell.
- Scale pet-be cell - walks through the steps to scale pet-be cell with horizontal pod autoscaler, and zero scaling with Knative.
- Pet store sample - provides the instructions to work with pet-store sample.