Skip to content

Instantly share code, notes, and snippets.

@jkeam
Last active August 25, 2022 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkeam/d852e1a2f76136b5b3d39b87aa6c3c00 to your computer and use it in GitHub Desktop.
Save jkeam/d852e1a2f76136b5b3d39b87aa6c3c00 to your computer and use it in GitHub Desktop.
ASP.NET Core 6 Blazor App Workshop - Instructor Prep Readme

ASP.NET Core 6 Blazor App Workshop - Instructor Prep Readme

These are the instructor notes for giving a hands-on workshop specifically for .NET developers doing cloud native development on OpenShift. OpenShift tends to have lots of enablement material around Java, Go, Python, and Ruby but not so much for .Net; even though it is a first class citizen on the platform. Microsoft has done a great job around making .Net Core 5 and after being cross platform and Linux friendly. The development experience using .NET with its live reloading makes it wonderful to use and being able to get that same experience even though the application is running on OpenShift and not a developer's local laptop is a critical part of cloud native development. Being able to utilize the resources of the cloud for development and for cloud deployment, but not sacrificing on the development experience is essential.

These notes are for an instructor that wants to prepare and run this workshop. This workshop gives developers first hand experience using OpenShift to do cloud native development. There is a laser focus only on the developer's inner loop - their day to day sitting down implementing new features and bug fixes. Once they commit their code and open a pull request, that falls into the developer's outer loop and is outside the scope of this workshop.

Prequisites

It is assumed you have access to an OpenShift 4.10 cluster large enough to run DevSpaces for each workshop attendee. Sample cluster resource requirements are listed here. Your mileage may vary as you scale up, these are simply the default requirements.

DevSpaces Operator

Cluster wide, you will find the following in the openshift-operators namespace.

  1. DevWorkspace Controller Manager: 1Gi
  2. DevWorkspace Operator Catalog: 50Mi
  3. DevWorkspace Webhook Server: 300Mi

For a total of 1.35Gi.

Operands

These are pods managed by the DevSpaces Operator. You can find these in the openshift-devspaces namespace.

  1. OCP DevSpaces Server: 1Gi
  2. OCP DevSpaces Gateway: 4Gi
  3. OCP DevSpaces Dashboard: 256Mi
  4. PostgreSQL: 1Gi
  5. Devfile Registry: 256Mi
  6. Plug-in Registry: 256Mi

For a total of 6.768Gi.

Workspace

Your workspace will most likely be different depending on how you configured it, for example, which UI you want to use for DevSpaces, as well as the size of your tooling for your language or application framework. But this is an example here:

  1. theia-ide: 512Mi
  2. machine-exec: 128Mi
  3. tooling: 4Gi
  4. che-gateway: 256Mi

This example is for a node app and requires ~5Gi of memory. My dotnet application I use for this will need about ~9Gi of memory due to the database and generally more resources required for .NET as compared to Node. Also 1Gi for storage for the SQLServer database.

Total

I'm going to do some rounding here to make the math easier. These are all ballpark numbers anyways, and I tend to err on the side of overprovisioning.

  1. Operator: 2Gi
  2. Operands: 7Gi
  3. Workspaces, 10Gi per participant

More rounding, let's say:

# 10Gi overhead + (10Gi per attendee, represented here by x)
10Gi + (10Gi * x)

And 1Gi of storage per attendee.

So for example, a workshop of 30 people will require 310Gi of memory and 30 Gi of storage.

Prep Work

Once you have the cluster, there are some things you need to do in order to setup for the workshop.

  1. Install DevSpaces (takes 6 min)
dsc server:deploy --platform openshift
# uninstall
# dsc server:delete
  1. Destroy any ResourceQuotas for your users that get created automatically on RHPDS clusters. You might have to log in as each user to trigger the ResourceQuota creation. Or you can edit the Template used for project creation:
oc edit templates/project-request -n openshift-config
  1. Change timeout for DevSpaces Workspaces
oc edit checluster/devspaces -n openshift-devspaces

and add the following:

spec:
  server:
    customCheProperties:
      CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT: "7200000"

The default is normally 1800000 (30 min), so here we are changing it to 7200000 (2 hrs), or -1 for never sleep.

You can do this in one command:

oc patch checluster/devspaces --patch "{\"spec\":{\"server\":{\"customCheProperties\": {\"CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT\": \"-1\"}}}}" --type=merge -n openshift-devspaces

Live Notes

Day of the workshop, follow the flow as noted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment