Design, photography and ramblings

Month: May 2021

Instructions to get a NextJs app running in CloudApps in three easy commands

The campus CloudApps (RedHat Openshift platform) is great for hosting things such as custom NextJs (web) app.Β  Here I will show you how to install the app using a few simple commands.

“Commands? I have to type?” you say. Yes, I am using the command line and not the web console. I will explain why after giving you the commands to push you first example NextJs app to CloudApps. If you are new to the oc CLI, here is a good cheat sheet of commands. (This tutorial assumes you have the OpenShift oc CLI installed on your Windows computer, know how to log into it, and you have a default project already selected by default in the CLI)

Step 1 – Open you command line tool like DOS and log into CloudApps (for this I do actually prefer using the CloudApps web console to copy the login command and paste it into the command line)

Step 2 – Load the example NextJs app into CloudApps using the following command (where ‘ncc’ is simply the name I am telling CloudApps to use for this example app). The code to build the app is hosted at https://github.com/kuhlaid/next-learn-starter/tree/master/learn-starter. The ‘–context-dir’ flag is the way we install code from a subdirectory of GitHub.

oc new-app https://github.com/kuhlaid/next-learn-starter.git –context-dir=learn-starter –name ncc

Step 3 – Now, wait a few minutes. You can run oc logs -f buildconfig/ncc if you want to get the status of the app being built, or check the CloudApps web console if you want to make the web console feel useful.

Step 4 – Once our ‘ncc’ app is installed in CloudApps we need to create a URL (route) to make it accessible in a web browser. To do this we simply use the command:

oc create route edge –service=ncc –insecure-policy=Redirect

If you run the command oc get routes then you should see a URL that begins with ‘ncc’. Copy that URL into a browser and you should see something like:

You did it. You installed your first NextJs app on CloudApps.

If you want to delete/remove the app and all the resources created for this app in CloudApps, and start over or make edits to the app before reinstalling it in CloudApps, simply use the command:

oc delete all –selector app=ncc

Why the oc CLI?

Hopefully it is now obvious why the command line interface is better suited than the web console when installing apps (unless you are really against installing the oc CLI software on your computer). “But I have to type commands” you say. My solution is to copy and paste my commands from a text file or OneNote. Also oc commands can be easily explained in a GitHub repository when you want to make it simple for your users to duplicate your build experience. Spending loads of time trying to grab screenshots of the web console to try and explain which buttons to push and where to find hidden menus takes a lot of time. Then when the web console interface changes after you have created all of those complicated instructions, your instructions no longer apply to the new web interface.

It is easier to explain how to build an app using oc CLI commands because there are no changing interface designs to navigate and you can actually save your commands to a text file that can be backed up and archived along with your GitHub repository code.

As a disclaimer, I’m a web interface guy. I would rather click buttons in most cases, but the OpenShift web console is way too complicated for normal everyday users. WAY TOO COMPLICATED and not user friendly. I found when I was trying to use the web console I was writing pages of instructions on how to duplicate an app build, and I still couldn’t keep it straight.

If you are still not convinced the CLI is beter, after you install this example app try to go into the web console andΒ  delete all of the app resources of this example in one click. Then reinstall this app using only the web console. I bet you can’t do it. Go ahead, I’ll wait.

 

2021 Promise Land 50k+ Trail Run

Preface

Let me start by saying thank you to David Horton, Isa, and the crew that put this run together. You handled the Covid-19 situation well, I felt safe running with others in the woods, and the communication of the ever changing Covid guidelines from the race crew was timely and well executed. As a newbie to the race, I must say that it was most beautiful and well planned 50k course that I could imagine running on the east coast. I now echo all of the accolades your race has received by fellow runners I have talked to on the trail during other races. Congrats on 20 years of Promise Land!

Pre-race

I was nervous. Not about running the race, but nervous that the race might be cancelled for another year in a row due to Covid-19. I had signed up to run Promise Land and Massanutten Mountain Trails 100 Mile Run in 2020. A recent notice that the Massanutten Mountain Trails 100 Mile Run had been postponed for the second year in a row meant that my race entry would be deferred until 2022. I was also nervous that the second dose of Covid-19 vaccine I had received days before the race would not run it’s course before the race, and leave me with a DNF before I had finished the Promise Land course.

The race was on. At the race ‘camp’ site on Friday, fellow TrailHeads Skrapple and Dropkick setup their camper to the right of my truck. Jacob Curley, another Chapel Hill area runner happened to be camping to the left of my truck. My Carrboro Farmer’s Market t-shirt caught the eye of Josh West, who was also camping next to us, and we swapped stories from the Chapel Hill area.

Upon arriving to the camp site I began hydrating. I was reluctant to drink too much water on the drive to camp, lest I would need to find unplanned spots to relieve myself along the way. Pizza was served after 6pm and many carbs were consumed. I kept nursing my water bottle to ensure I was well hydrated for Saturday, and to dilute the many grams of sodium I probably ingested through the pizza. I made many trips to the urinal the rest of the night.

The race

4:30 am and morning air was perfectly cool, and thankfully dry. The dark was pierced by car headlights throughout the camp. Cars remained idle while runners warmed themselves inside as long as they could. A vapor of car exhaust hung in the otherwise clear mountain air.

I walked hither and thither between the urinals and my truck to do a mental run through of my gear, my anti-chaffing rituals, and take stock in the state of my body. Was my short yoga routine and jumping jacks enough? Did I remember to wear my gaters? Should I really wear these shoes? All of the seeming trivial things we fret about prior to a race that can mean the difference between a great race and possibly a DNF. Simply forgetting to ‘butter’ your sensitive areas can add extra pain to your journey and lead to poor running form and annoyances that can quickly demoralize and bring a strong runner to their knees.

“Wave 5 on deck!” Oh crap. I’m still in the urinal. I need to speed this up. But not forced-hernia kind of sped up. Apparently time was moving faster than I was anticipating so I dashed out and over to the start. I turned on my headlamp, turned waist lamp (who wears a headlamp on their head?) and hoped that I was in wave 5. I heard my name called and saw a few friends towards the back where I was standing. Everyone wore smiles.

At 5:45am we started and I jogged out to the dark road. The pavement was nice and flattish but with every step the road seemed to slowly increase in grade. The day before when I had driven to camp I passed a recently cut logging road next to camp that went straight up the mountain and was covered with large fist sized rock. This road, I thought, was the road David would have us running up coming out of camp. It was something a masochistic race director would do, and I had seen as much at Grindstone 100 only years earlier on a fire road so rough that even a 4×4 vehicle would struggle to climb. Alas, the rocky fire road I had seen was not part of the course, but by mile 3 of the race the running had all but stopped and replaced with slow hiking up another steep rock covered road.

First ascent – rocky road

 

The view of the sun rising over the valley below after our first major ascent was beautiful, and worth the early morning hike. The grassy roadway that ran along the ridgeline of the mountain allowed one to catch their breath after the steep ascent, only to have their breath taken away again by the views. I paused several times to simply look across the valley.

Ridgeline run

I passed familiar faces along the way, and they returned the favor. I tried to give the runners around me as much space as I could allow with Covid and all. I pulled off the trail when I heard faster foot falls growing closer from behind, and they did the same for me. Everyone seemed to have the utmost courtesy.

Through the entire course, I only noticed one piece of trash on the ground. A cup of pickles someone must have grabbed at an aid station. I had packed a plastic grocery bag so I grabbed the pickle cup and carried it along with me the rest of the race. I find that trail runs rarely have any litter dropped by runners (or anyone for that matter). The litter that is dropped is likely by accident, as opposed to a road run where littering is almost expected.

Midway through the course you reach Apple Orchard Falls. This section stopped me in my tracks more times than I could count. I simply could not keep running without taking in the beauty. The sound of the water, the large mossy rocks that flanked the sides of the creek bed, and of course the water crossing that invited you into the cold water.

The falls

This course has a little for everyone, whether you like big climbs or serious descents, or you like grassy rolling hills or cruising down hard packed gravel roads. The weather this year was probably 40 at the start, warmed up slightly halfway through (but not sweaty warm), and then cooled of in the afternoon as the breeze picked up and ran began to fall starting around 2pm. Luckily the rain began in earnest after I had crossed the finish line and the temperature seemed to drop faster at that point, driving me from the race site sooner than I was thinking it would.

My gear

I ran in Altra Olympus 4 shoes. I hesitated at first going with these for the race as they have a stiffer sole but with more cushion, than my Altra Superiors (which are my go-to shoe). The Olympus seems to have better grip with the Vibram sole, however I find my foot does not wrap around objects very easily in these shoes which can lead to more rolling of the ankle when hitting rocks or roots with a sharp profile. These shoes also felt heavier when wet than my Superior shoes. Anyway, take that with a grain of salt.

For foot protection I also wore Altra gaters because I hate to having rocks and twigs building up in my shoes. If I can avoid clearing my shoes even once during a run then the gaters are worth it to me. Just one less thing I have to think about.

For hydration I wore a Nathan Vaporkrar hydration vest. This is not only for hydration but also chaffing control since it acts as a man-bra. It keeps my shirt from chaffing me and is almost as important to me as my shoes, so I wear it almost all the time even if I’m only carrying my car keys in them.

For shirt and shorts I wear Patagonia almost exclusively. It is just plain comfortable and super soft. I have the Nine Trail shorts with pockets. Worth every penny.

Socks, I wear SmartWool, almost always. Even in the summer. They keep my feet warm when it is cold and are airy even when wet. No blisters with these socks. Highly recommend.

The end.