Skip to content

Commit

Permalink
Add a new serverless application tour and few text changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitkrai03 committed Jul 31, 2020
1 parent d0781a4 commit 6a3606b
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ describe('QuickStartCatalog', () => {
);
const galleryItems = QuickStartCatalogWrapper.find(GalleryItem);
expect(galleryItems.exists()).toBeTruthy();
expect(galleryItems.length).toEqual(3);
expect(galleryItems.length).toEqual(getQuickStarts().length);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const explorePipelinesQuickStart = {
},
spec: {
version: 4.7,
displayName: `Explore Pipelines`,
displayName: `Getting started with Pipelines`,
duration: 10,
iconURL:
'/api/kubernetes/apis/packages.operators.coreos.com/v1/namespaces/openshift-marketplace/packagemanifests/openshift-pipelines-operator/icon?resourceVersion=openshift-pipelines-operator.dev-preview.openshift-pipelines-operator.v0.10.7',
Expand Down Expand Up @@ -43,7 +43,7 @@ Is the status Succeeded?`,
},
{
title: 'Explore your application in topology',
description: `#### To install the Pipelines Operator:
description: `### To install the Pipelines Operator:
1. In the Administrator perspective, go to the OperatorHub from the Operators section of the navigation.
2. Use the filter at the top of the page to search for the OpenShift® Pipelines Operator.
3. If the card has an Installed label on it, the Operator has already been installed. You won't be able to perform the following steps, and should cancel out of the Quick Start.
Expand All @@ -69,7 +69,7 @@ Is the status Succeeded?`,
},
{
title: `Explore your pipeline run`,
description: `#### To install the Pipelines Operator:
description: `### To install the Pipelines Operator:
1. In the Administrator perspective, go to the OperatorHub from the Operators section of the navigation.
2. Use the filter at the top of the page to search for the OpenShift® Pipelines Operator.
3. If the card has an Installed label on it, the Operator has already been installed. You won't be able to perform the following steps, and should cancel out of the Quick Start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const exploreServerlessQuickStart = {
},
spec: {
version: 4.7,
displayName: `Explore Serverless`,
displayName: `Getting started with Serverless`,
duration: 10,
iconURL:
'/api/kubernetes/apis/packages.operators.coreos.com/v1/namespaces/openshift-marketplace/packagemanifests/serverless-operator/icon?resourceVersion=serverless-operator.4.3.serverless-operator.v1.7.2',
Expand All @@ -21,7 +21,7 @@ Adding Serverless to your OpenShift cluster is quick and easy. This guided tour
tasks: [
{
title: `Install Serverless Operator`,
description: `#### To install the Serverless Operator:
description: `### To install the Serverless Operator:
1. Go to the OperatorHub from the Operators section of the navigation.
2. Use the filter at the top of the page to search for the **OpenShift Serverless Operator**.
3. Click on the tile to open the Operator details.
Expand All @@ -48,7 +48,7 @@ Adding Serverless to your OpenShift cluster is quick and easy. This guided tour
},
{
title: `Create the knative-serving and knative-eventing APIs`,
description: `#### To create the knative-serving and knative-eventing APIs:
description: `### To create the knative-serving and knative-eventing APIs:
1. Make sure you’re still on the Installed Operators page on the Details tab.
2. Click OpenShift Serverless Operator.
3. Click on the Knative Serving tile to create an instance of the API.
Expand All @@ -71,6 +71,6 @@ Adding Serverless to your OpenShift cluster is quick and easy. This guided tour
],
conclusion:
'Your Serverless Operator is ready! If you want to learn how to deploy a serverless application, take the Serverless Application tour.',
nextQuickStart: '',
nextQuickStart: 'serverless-application',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const installAssociatePipelineQuickStart = {
},
spec: {
version: 4.7,
displayName: `Install an application and associate a pipeline`,
displayName: `Import an application and associate a pipeline with it`,
duration: 10,
iconURL:
'/api/kubernetes/apis/packages.operators.coreos.com/v1/namespaces/openshift-marketplace/packagemanifests/openshift-pipelines-operator/icon?resourceVersion=openshift-pipelines-operator.dev-preview.openshift-pipelines-operator.v0.10.7',
Expand All @@ -20,7 +20,7 @@ export const installAssociatePipelineQuickStart = {
tasks: [
{
title: 'Create an application from Git',
description: `#### Follow these steps to create an application.
description: `### Follow these steps to create an application.
1. In the **</> Developer perspective**, go to the **+Add** page.
2. Create a new project.
3. Click Import from Git to create an application, specifying [https://github.com/sclorg/django-ex.git](https://github.com/sclorg/django-ex.git) as the Git Repo URL.
Expand All @@ -42,7 +42,7 @@ Is there an Application and Deployment name django-ex?`,
},
{
title: `Explore your application`,
description: `#### Let's explore your application in topology:
description: `### Let's explore your application in topology:
1. Click on the deployment to see associated details in the side panel.
2. Click on the Resources tab in the side panel to view related resources.`,
review: {
Expand All @@ -62,7 +62,7 @@ Is there a Pipeline named django-ex-git?`,
},
{
title: `Start and explore your pipeline run`,
description: `#### You’ve just explored the topology of your application and seen it’s related resources. Now let’s start your pipeline.
description: `### You’ve just explored the topology of your application and seen it’s related resources. Now let’s start your pipeline.
Notice the Pipeline Runs section of the Side Panel
1. The first row shows the Pipeline associated with the application and an action button to Start Last Run, which is disabled.
2. Click on the Pipeline link, which should bring you to the Pipeline Details page.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { exploreServerlessQuickStart } from './explore-serverless-quickstart';
import { explorePipelinesQuickStart } from './explore-pipeline-quickstart';
import { installAssociatePipelineQuickStart } from './install-associate-pipeline-quickstart';
import { serverlessApplicationQuickStart } from './serverless-application-quickstart';

export const allQuickStarts = [
exploreServerlessQuickStart,
serverlessApplicationQuickStart,
explorePipelinesQuickStart,
installAssociatePipelineQuickStart,
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
export const serverlessApplicationQuickStart = {
apiVersion: 'console.openshift.io/v1',
kind: 'QuickStarts',
metadata: {
name: 'serverless-application',
},
spec: {
version: 4.7,
displayName: `Creating a Serverless application`,
duration: 15,
iconURL:
'/api/kubernetes/apis/packages.operators.coreos.com/v1/namespaces/openshift-marketplace/packagemanifests/serverless-operator/icon?resourceVersion=serverless-operator.4.3.serverless-operator.v1.7.2',
description: 'Learn how to create a Serverless application.',
prerequisites: 'Install the OpenShift® Serverless Operator to start creating Serverless apps.',
introduction: `### OpenShift Serverless is flexible. With Serverless, you get:
**Scalability**
Your apps scale automatically, increasing containers to handle peak loads and rolling them back at lulls.
**Interoperability**
Serverless gives you access to a rich ecosystem of built-in and third-party event sources, like Kafka, GitHub, and other SaaS solutions.
**Iteration**
Deploying new versions of apps is simple with Serverless. Perform canary, A/B, and blue-green testing with confidence. By using app revisions, you can roll things back, or split traffic between revisions, as needed.
This guided tour shows you how to create a Serverless app that realizes these benefits.
In this tour, you perform five tasks:
1. Create a Serverless application
2. Demo scalability
3. Wire an event source to your Knative Service
4. Force a new revision & set traffic distribution
5. Delete your application`,
tasks: [
{
title: `Create a Serverless application`,
description: `### Follow these steps to create an Serverless application:
1. Using the perspective switcher at the top of the navigation, go to **</> Developer**.
2. Using the project dropdown, select the project you would like to create the demo application in. You can also create a new one if you’d like.
3. Once there, go to the **+Add** page in the navigation.
3. Click **From Git** to create an application.
4. In the field labeled **Git Repo URL**, copy and paste [https://github.com/sclorg/django-ex.git](https://github.com/sclorg/django-ex.git).
5. In the field labeled Application Name, add the name Sample Serverless App.
6. Under **Resources**, select **Knative Service**.
7. Scroll down and click **Create**.
The Topology view will load with your new Serverless application. The application is represented by the light grey area with the white border. The Knative Service is the darker grey area with the dotted border. The pod donut in the middle represents the revision.`,
review: {
instructions: `#### To verify the application was successfully created:
1. From Topology, look for your new application. While the build completes, it will say “No Revisions.”
2. Do you see your application?
Is the status Succeeded?`,
taskHelp: 'Try walking through the steps again',
},
recapitulation: {
success: `You've just created a Serverless app!`,
failed: 'Try the steps again.',
},
},
{
title: 'Demo scalability',
description: `### To see your application scale:
1. Wait for the build to complete. It may take a few minutes. You will see a green checkmark in the bottom left corner of the service.
2. From the **Display Options** dropdown at the top of the Topology view, select **Pod Count**.
3. Wait for the Pod Count to scale down to 0 pods. This may take a few minutes.
4. Click the route URL icon in the top right corner of the Knative Service. The application will open in a new tab.
5. Close the new browser tab and go back to the Topology view.
You should be able to see that your application scaled up to 1 Pod to accommodate the traffic request when you accessed the application. After a few minutes, you should see your application scale back down to 0 pods.`,
review: {
instructions: `#### To verify the application scaled down:
1. Click on the pod donut inside your service. The badge at the top of the side panel should be (REV).
2. Click on the **Details** tab in the side panel.
3. Is the pod donut autoscaled to 0?
Is the status Succeeded?`,
taskHelp: 'Try walking through the steps again',
},
recapitulation: {
success: "You've just scaled up your application to accomodate a traffic request!",
failed: 'Try the steps again.',
},
},
{
title: `Wire an event source to your Knative Service`,
description: `### To wire an event source to your Knative Service:
1. Hover over your service with your mouse. You should see a blue arrow.
2. Click the blue arrow, then drag and drop the **(+)** anywhere outside the service.
3. In the dropdown menu that appears, click **Event Source**.
4. Under the **Type** field, click **PingSource**.
5. In the field labeled **Data**, type “This message is from PingSource.” This is the message that gets posted when the service is called.
6. In the field labeled Schedule, type “* * * * *”. This means that every minute it will make a call.
7. In the Application field, select the application Sample Serverless App.
8. Click Create.`,
review: {
instructions: `#### To verify the PingSource was created:
1. Make sure you are still in Topology view.
2. Do you see a PingSource to the right of your application, connected by a grey sink connector line?
Is the status Succeeded?`,
taskHelp: 'Try walking through the steps again.',
},
recapitulation: {
success: "You've just wired an Event Source to your Knative Service!",
failed: 'Try the steps again.',
},
},

{
title: `Force a new revision & set traffic distribution`,
description: `### To force a new revision and set traffic distribution:
1. Click on the pod donut inside your service. The badge at the top of the side panel should be (REV).
1. In the side panel, click on the **Resources** tab.
1. Scroll down and click on the configuration associated with your service.
1. Go to the resource’s **YAML** tab.
1. Scroll all the way down until you see timeoutSeconds.
1. Change the value from 300 to 30 and click **Save**.
1. Go back to the **Topology** view.
1. Click on your service. The badge at the top of the side panel should be (KSVC).
1. In the side panel, click on the **Resources** tab.
1. Next to **Revisions**, click **Set Traffic Distribution**.
1. Click **Add Revision**.
1. In the **Revision** dropdown, select the new revision.
1. In the **Split** column, set both revisions to 50.
1. Click **Save**.
You should now be able to watch as the pod donuts for each revision scale up and down each time the application is pinged.`,
review: {
instructions: `#### To verify you forced a new revision and set traffic distribution:
1. Make sure you are still in Topology view.
2. Do you see two pod donuts in your Knative Service?
Is the status Succeeded?`,
taskHelp: 'Try walking through the steps again.',
},
recapitulation: {
success: "You've just set a traffic distribution for your Serverless app!",
failed: 'Try the steps again.',
},
},

{
title: `Delete your application`,
description: `### To delete the application you just created:
1. Click on your application. The badge at the top of the side panel should be (A).
2. At the top of the side panel, click on the Actions dropdown.
3. Click Delete Application.
4. Confirm deletion by typing the application name in the field and click Delete.
Deleting this application will remove the application and all related resources from your cluster.`,
review: {
instructions: `#### To verify you deleted your application: :
1. Make sure you are still in Topology view.
2. Has the Sample Serverless App been removed?
Is the status Succeeded?`,
taskHelp: 'Try walking through the steps again.',
},
recapitulation: {
success: "You've just deleted your Serverless app!",
failed: 'Try the steps again.',
},
},
],
conclusion:
'You now know how to use Serverless applications in your cluster! If you want to learn how to build more Serverless apps, take a look a our [Knative Cookbook](https://redhat-developer-demos.github.io/knative-tutorial/knative-tutorial/index.html).',

nextQuickStart: '',
},
};

0 comments on commit 6a3606b

Please sign in to comment.