Coder Social home page Coder Social logo

ibm-cloud-architecture / learning-kabanero-101 Goto Github PK

View Code? Open in Web Editor NEW
3.0 8.0 9.0 44.01 MB

Tutorials for Cloud Native with Cloud Pak for Applications

Home Page: https://ibm-cloud-architecture.github.io/Learning-Kabanero-101

License: Other

JavaScript 83.71% HTML 16.29%

learning-kabanero-101's Introduction

CP4Apps Accelerators for Teams 101

CircleCI

Learning Journey

Access the tutorials https://cp4apps.cloudnative101.dev

Accelerators for Teams is part of IBM Cloud Pak for Applications

Accelerators for Teams offers open source technologies in a microservices-based framework that simplifies development, build, and deployment of applications on OpenShift.

This learning journey provides a set of workflows integrating the following tools:

Contributing

Please refer to the how to contribute? on how you can contribute to the learning documentation.

learning-kabanero-101's People

Contributors

bkribbs15 avatar carnsds-ibm avatar csantanapr avatar deboer-tim avatar hemankita avatar timroster avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learning-kabanero-101's Issues

Task: External Container Registry

Create a new Task that shows the user what are the different configurations and steps to work with an external container registry.

Assume CP4A is deployed into IBM Cloud public managed OpenShift.

  • copy the container credentials for the ibm cr registry per region from the default namespace to the target namespace, this credentials should have only read access to pull the image
  • configure tekton with a token with write access to push the image in the deploy task

update navbar menu items

For now let's add menu items and have place holders for initial set of topics

  • Overview
  • Java Spring Boot
  • Java Microprofile
  • Node.js Express
  • Create Tekton Pipeline
  • Create Appsody Stack

appsody deploy script example has sed portability issue

MacOS and GNU sed differ in syntax for in-place editing of files. The most reliable way to get sed to work for both is to specify a backup extension and then delete the backup file. Something like:

sed -i'.bak' -e 's/foo/bar/' myfile && rm myfile.bak

Layout for Workflows Labs

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:

  • OpenShift
  • Appsody
  • CodeWind
  • TekTon
  • Knative

Initial set of Kabanero Workflows:

  • Spring Boot (Java)
  • Microprofile (Java)
  • Express.js (Node.js)

Common Workflows Steps, should have short explanation and screenshots

  1. Start a new application with a Stack
  2. appsody repo add kabanero <collection_url>
  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

Task: Github Credentials

When using a private repo on public github, or using any type of repo on Github Enterprise tekton needs a git token with repo_public to be able to git clone the source for for the pipeline.

Generate a token with the minimal permissions for tekton to git clone
Configure in the tekton dashboard the git token

Customize Tekton Pipeline (ie add testing task)

Show how to create a customize Tekton Pipeline.

For example, the spring-build-deploy pipeline is compose of

  1. build task
  2. deploy task

Let's create a new pipeline spring-test-build-deploy compose of

  1. test task (add a step to run mvn tests)
  2. build task (re-used task)
  3. deploy task (re-used task)

rename top level banner

Rename to Learning Cloud Pak for Applications (CP4Apps) - ”Accelerator for Teams” - Cloud Native 101

image

make the test pipelines available for install

we should have in the test task guide, a single command that user can deploy the new tasks and pipelines with a single commad

we need to host the file in the repo

for example

oc apply -n kabanero -f https://raw.githubusercontent.com/ibm-cloud-architecture/Learning-Kabanero-101/master/pipelines/test-tasks-pipelines.yaml

update readme, license, contrib

  • README
    You have circleci badge, link to website, and point to contribute file

  • LICENSE
    Add license apache 2

  • CONTRIBUTING.md
    Add info on running npm run dev

Revert back github name to Learning-Kabanero-101

Some users are reporting errors 404 for the old urls like https://ibm-cloud-architecture.github.io/Learning-Kabanero-101/web/1.0.0/kabanero-overview.html

Need to revert back, and setup a domain name like cp4apps.cloudnative101.dev

Customize Appsody Stack

Take one of the provided stacks as based and modify something, for example added tracing with jaeger.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.