ibm-cloud-architecture / Learning-Kabanero-101

Tutorials for Cloud Native with Cloud Pak for Applications
https://ibm-cloud-architecture.github.io/Learning-Kabanero-101
Other
3 stars 9 forks source link

Layout for Workflows Labs #5

Closed csantanapr closed 5 years ago

csantanapr commented 5 years ago

We intend to have end to end workflow on what a best practice developer would go thru setup the first time but also continuously deployment as they make updates.

Cloud Pak for Applications showcased in workflow:

Initial set of Kabanero Workflows:

Common Workflows Steps, should have short explanation and screenshots

  1. Start a new application with a Stack
  2. appsody repo add kabanero
  3. recommend to remove the other repos if possible
  4. appsody list kabanero
  5. appsody set-default kabanero
  6. appsody init kabanero/stack
  7. appsody build (to check that stack is stable and init correctly, from this point on no need to run build ever again)
  8. appsody run
  9. appsody test
    • Show how test runs for the app
  10. appsody debug
    • Show app running again, explain this is for local dev
    • Show the extra features app has in debug mode:
      • Live reload, make a change to code, see the reflected change in application endpoint
      • Embedded dashboards (ie appmetrics in express, spring?, microprofile?)
  11. Deploy app to the cloud on OpenShift for personal development
  12. Setup your project namespace
    • Create a new project/namespace with your name/id (ie carlos) oc new-project <yournamespace>
    • Switch to the target project using oc project <yournamespace>
    • Check that current context is your project space oc project -q
  13. appsody deploy
    • Show what just happened the following kubernetes resources:
      • Deployment oc get deployments oc get pods
      • Service oc get services
      • Route oc get route
  14. Show how to run the appsody tasks using VSCode Taskrun (ie CMD+Shift+P, Task Run)
  15. Install CodeWind extentions on VSCode (core, javascript profile, java profile)
  16. Use CodeWind for dev
    • Now that user understand appsody and it provides, how to use it, then using CodeWind doesn't fill like magic
    • Import Appsody app into codewind (some tricks here on directory location)
    • Show how to use including screenshot most the menu actions (right click on app)alt text
      • Open App
      • Open Project Overview
      • Open Container Shell (exec)
      • Show and Hide all Logs
      • Restart in Run Mode (same as appsody run)
      • Restart in Debug Mode (same as appsody debug)
  17. Use CodeWind for performance (show and screenshots)
    • Open Application Monitor
    • Open Performance Dashboard
    • Run perf tests, show how the app performances in both dashboards
    • Using the Codewind extentions (java perf, javascropt per) hover over the code and show the performance stats
  18. Deploy app to the cloud on OpenShift for team development
  19. Setup team project namespace
    • Create a new project/namespace with your name/id (ie carlos) oc new-project dev
  20. Extract the app deployment manifest appsody deploy --generate-only this extracts a file app-deploy.yaml
  21. Create a git repo, intialize it and push the code to the git repo.
  22. Create an access token to configure Tekton WebHook
  23. Open Tekton Dashboard
  24. Create Tekton WebHook for the git repo
  25. Select Pipeline to run build-deploy for the stack
  26. Push a change to the git repo to trigger the Tekton pipeline run
  27. Show the pipeline running
  28. Show the app running in the team namespace dev
    • Show what just happened the following kubernetes resources:
      • Deployment oc get deployments
      • Pods oc get pods
      • Service oc get services
      • Route oc get route
      • AppsodyApplication oc get appsodyapplications
  29. Show how to update the Application to leverage Serverless Autoscaling (ie Knative)
    • Edit the file app-deploy.yaml the file contains a defintion of an AppsodyApplication the user guide is here https://github.com/appsody/appsody-operator/blob/master/doc/user-guide.md
    • Add the line createKnativeService: true to the spec object for example
      apiVersion: appsody.dev/v1beta1
      kind: AppsodyApplication
      metadata:
        name: my-appsody-app
      spec:
        stack: java-microprofile
        createKnativeService: true
    • Git push the change, tekton pipeline runs, show the app again running and inspect extra resource associated with Kantive
      • Knative Service oc get ksvc
      • Knative Configurations oc get configurations
      • Knative Revisions oc get revisions
csantanapr commented 5 years ago

We tried today to use appsody deploy using the same remote openshift cluster, and it looks is not possible or intended for deploy command to be against a remote cluster, the command is intended for local cluster like minishift or minikube.

We will leave appsody deploy from e2e workflow.

csantanapr commented 5 years ago

We have the e2e guides