Friday, September 15, 2017

Lids for the Oui by Yoplait Glass Jars

<speedrack>
Blossom canning jar caps for small jars are the bomb.  This is not an affiliate link.
</speedrack>

Like most people who first saw the new Oui by Yoplait yogurt, the first thing I thought was "I need that glass jar... I don't know what for yet, but I need it!"  I didn't even know how the yogurt even tasted.  I thought that I could use the jar to store my custom spice mixes, small amounts of crafting material I can't let go, or meta-ly my own homemade yogurt.

Sidebar: Oui is creamy, so good texture, but I've gotten so used to plain yogurt, it was too sweet for me.

Of course, they're not as useful without lids, or at least in many of the ways I was envisioning as I bought my 3-for-$4-I-make-my-own-yogurt-this-is-slightly-ridiculous-to-be-buying jars. After much Googling, I found a lot of reviews of the yogurt itself and how the jars are cute, but not a lot of direct info on liddage.  Wading through some comments; however led to some better results.  The jars are very similar to the small German Weck canning jars, including the ever important opening measurement.  They are not a perfect match, so some of the lids, especially the ones that use the sealing ring with traditional clamps might not fit.  So I wanted a tight fit that either sealed by "going into" the jar, or a silicone cap that fit over top of the jar which could be stretched

Some Amazon searching later led me to Blossom canning jar caps for small jars.  (NOT AN AFFILIATE LINK!)  I figured I'd give them a try and see, most importantly, if they'd leak.  So far, I've got to report, these caps are champs.  They fit tight, and I've even put liquid in the jar and it hasn't leaked.  I'm pretty satisfied with the lids so far.  Now, to go forth and eat more yogurt!

</sidebar>

Friday, November 18, 2016

All Things Open 2016: Additional Jenkins Comments (Part 1)

At the end of October, I gave a talk about my day job at a little conference called All Things Open. I LOVE sharing what I do, especially since I can now.  Not like I ever couldn't in the 3 letter agency way of "I work with computers". The 3 letter company I previously worked for was commercial. Not everyone gets excited about autoconfiguring rack architecture. Except maybe the Open Stack people.

Jenkins, the open source automation application, is amazing. The community is incredibly active, and it seems as if I'm constantly learning some new plugin or trick to make my pipelines go. Because the best thoughts/suggestions/witty retorts are always the ones you have while you're attending the next session in the conference, I wanted to share some of them with whoever happens to come across this space. Because I have several thoughts, I'm spreading out the love over a few posts.

First things first: repo + slides are available up on GitHub. That app is so basic... It also made me realize the Javascript/Node world is pretty much Professor Farnsworth's nanobot world. 99% guarantee it's using the embers of the old hotness.

The sample project is great for demonstrating the function of MultiBranch Pipeline, the final form of pipeline management. Sidebar: The ultimate form, automated management of an entire organization of multibranch pipelines, can only be reached by GitHub Organizations and BitBucket Teams. If you're starting from "I just want to lay down some test groovy", start with the "Pipeline" job.  A field of possibilities awaits you there


There are effectively no limits to what you can do with your Pipeline jobs. In my personal development, I use the inline script to test out ideas and quickly get going. I'll use the "from a file in your repository" option as my more permanent pipeline. I like versioning my pipeline, and have it update right after I push new code without having the extra step of logging into Jenkins to update the job.
From this...

...to this


Working on SCM managed code is, I would argue, necessary when there are many people going in and out of a common job. In release, we not only develop Jenkins but we're heavy users too. We've been using pipelines since they came to be, and we manage the various scripts through essentially a library. The pipeline jobs in Jenkins look similar, just they use a different "flow" for actions.  This gives us all a chance to see exactly what's happening in each of our flows, do code reviews, handle versioning, backup for all the things, preventing wild wild west job modification, and pretty much any other benefits from using scm.

Some repos require digging through the layers of Troy: different mix of pipeline abilities in older scripts. We're already starting to convert to using Jenkinsfiles for running our jobs, translating the extremely common, yet subtlety customized, code flow into individual repos. This also keeps the associated helper scripts and additional tweaks with the job. The common scripts are now put in a library accessible from the individual jobs.

Of course, not everyone wants or should know the details of what happens in your jobs. That's probably the main driving force for the question above In that case, then this works too.  The peeps with teh powa admins can control whatever they need to in their repository, and jobs can chug along without others having to see how the sausage (or more appropriately for the Sidebar: beer) gets made.  Sidebar: beer pairs well with pipelines.

This longer ramble answers one question that came up during the Q&A: can I set up one repo with a common build script and use it with a combination of helper scripts to manage several different similar tasks. Yes, yes you can. We're doing it today. There are a few suggestions I'd like to make if you go that route, especially since there are so many features that didn't exist before:

  • You potentially lose the benefits of managing that common job within your scm. Changes must be applied within Jenkins itself to all your jobs. And that's a pain. </understatement>
  • CloudBees offers a Templates Plugin that really solves this problem. Check within your company to see if you have a CloudBees subscription as that will really shorten your configuration time.
  • You could possibly get around your helper script by using variables that just tell your main job which helper script to load. Make sure you have good security set up before going down this route.
I'll be experimenting with some more of these suggestions as part of just further Jenkins discovery, and will share what I find! Feel free to ask questions, and share how you've used Jenkins pipeline. I'll do some other posts with additional thoughts and reflections so stay tuned.

</sidebar>

<sidebar>
I'm trying to consciously only add 1 space between typed sentences because along that front the Manual of Style put up another "W" for Chicago (no pressure Bears). It's so hard after living double spaced 4-lyfe. I think it looks cramped as if everything is one run on sentence in a poem that never found its way. But hey, the people who get passionate about typography say 1 space. However, you'll pry semicolons out of my cold, dead hands.
</sidebar>

Friday, October 7, 2016

Converting from HudsonTestCase to JenkinsRule

<speedrack alt_text="Getting your plugins up to speed">
</speedrack>

Let's be real: testing is usually not the first thing on software developer's minds when creating a new system. I may or may not have been involved in a project or 2 like that in my day.  And the "test driven development" that we tried to learn in the early days of programming didn't really prove much other than driving home certain coding styles.  Curse you WebCat.... Not putting in a good word for your fellow felines.

However; as we get older, we learn from our mistakes.  Namely the ones found in debugging.  If you're reading this, you've already gotten to the wiser part, and jumped headfirst/feetfirst/behindfirst/bellyfloped into Jenkins, throwing some abandon in when taking up custom plugin development.  You've also decided to go feet first since you're looking to test what you use for tests.  Bonus points for keeping your plugin up to date.  The way not to let the defect tide crash over your head is to get that core version up.  My fellow crew, change your dependency to the plugin parent pom, and get ready for overall plugin improvements.

The tide of progress hides some interesting sandbars, and the first one you hit while paddling out of the shallows is Junit4.  While I'm about ready to keep rolling in the deep with this ocean metaphor, I'm going to stay on shore and just let the cruse control of the new @Rule handle things for me.

Hot: JenkinsRule
Not: HudsonTestCase

Using the amazing powers of JenkinsRule, we are able to replace a lot of things one to one.  I've included a good list of changes in the following gist.  Check out the official Jenkins docs for extra unit test tips and tricks.

Along those lines, I found a few other snags that might need some extra explaining.  Since the tests aren't a subclass of HudsonTestCase, you won't have the benefits of being a RootAction.  But it's not an issue since JenkinsRule throws in this functionality too.  Simply create a subclass of JenkinsRule, and customize away.  Don't forget to move your resource into a subfolder for your custom JenkinsRule; check out this.  Ex: /test/resources/com/example/UnitTest/hello.jelly -> /test/resources/com/example/UnitTest/CustomRule/hello.jelly

So while we definitely are out there running tests, acting all carefree, looking at the green checkmarks in GitHub, there's one last struggle you might hit in your tests: using a security realm.  MockAuthorizationStrategy combined with setting JenkinsRule.jenkins.setAuthorizationStrategy(), you can easily throw together a whole system of permission for users.  One of the best examples of this is cloudbees-folder-plugin/FolderTest.

Hopefully this helps with potential snags that you might run into when writing tests for your test framework.  See you on the friendly IRC/Google Groups/GitHub PRs!

</sidebar>

Friday, June 17, 2016

Cherries & Cheerwine - Three Ways

<speedrack alt_text="Cherries + Cheerwine = endless deliciousness">

</speedrack>

Cherry season seems to blow by.  One minute they appear in the front of the grocery store ripe and busting with possibility.  The next, they've been replaced by grapes.  Grapes.  They're good and all, but not cherries.
The cherry baking struggle is real.
As you might have noticed in the picture (there will be a quiz at the end of this article), these cherries brought along a friend!  North Carolina is home to a particular cherry-flavored soft drink called Cheerwine.  While not wine our good friends grapes provide, which is enough to forgive them for showing up in the cherry bin at the grocery store, Cheerwine is quite a North Carolinian staple.  And the variety out the glass bottle is the best.  Just sayin.  It also has become a fresh ingredient in a lot of dishes!  Many times pared with it's BFF cherries.
Reunited and it tastes so good!
Steve Gordon, the food blogger for Our State, the magazine covering all things North Carolina, blended Cheerwine and cherries in a simple and intuitively delicious dessert: Cheerwine Cherry Cobbler.  By reducing cherries in Cheerwine (sidebar: the glass bottled stuff), one of the best cobbler fillings is created and North Carolina bats 3 for 3 for the title of "best state ever".  I definitely lean towards 1lb cherries (unpitted) to 1 bottle of Cheerwine.
About 10 minutes away from reduced heaven
However!  This delicious mixture can be used in a variety of different ways simply by separating the reduced Cheerwine Cherry Syrup from the Cherrwine Cherries. Aka: strain the cherries and get a-baking!  Of course the first thing I made with both is bundt cake.
Now saying you ate a whole cake by yourself is slightly less impressive
I was inspired by this Cheerwine Bundt Cake at A Spicy Southern Kitchen. This cake defeated me the first time we met, but I knew we were headed in a positive direction.  The main problem boiled down, or rather over-onto-my-oven-floor, to carbonation in the Cheerwine.  The Cheerwine Cherry syrup had no carbonation, plus deeper flavor and color from the cherries.  A win all around!  This, topped with a vanilla, almond, or chocolate glaze, ice cream, or nothing at all is the Cheerwine Cherry Bundt Cake of your dreams.
Notice how one didn't even make it into the picture-taking experience

Cheerwine Cherry Bundt Cake substitutions:
Red food coloring = slightly more Cheerwine Cherry syrup (we're talking like a 1/4-1/3 tsp) to make up the liquid ratio
1 cup Cheerwine = 1 cup Cheerwine Cherry Sauce
1/2 shortening = 1/2 butter; this sub can be made, and I sometimes prefer it so the outside doesn't darken as much.  Let the beautiful red out!


This left me with the "problem" of the Cheerwine Cherries.  After some thinking during my first solution (read: eating with a spoon), I decided to throw them into my favorite berry bundt cake recipe: Strawberry Yogurt Cake from Tide and Thyme.  I stumbled into this cake while trying to find something to do with a leftover raspberry reduction.  I find it's a great lighter vehicle for any fruit or fruit reduction.
Why yes those are the cherries going in the next batch.
Strawberry Yogurt Cake substitutions
12 oz strawberries = 1 heaping cup of Cheerwine Cherries.  I added cherries until it looked good for me personally; just mind the volume increase

Of course this is only the beginning for this delicious mixture.  I've also used the Cheerwine Cherry Syrup in a frosting recipe (results: delicious), and the Cheerwine Cherries as a topping for mini white chocolate pudding cups (results: indeterminate due to "mysteriously vanishing" pudding.  Oh darn, going to have to make it again...).  I'm doing further experimentation with these 2 wonderful ingredients which hopefully you'll read about right here.  Stay tuned, and go forth to experiment yourself!
Easiest photo setup ever.


</sidebar>

Friday, June 10, 2016

Starting a Jenkins Agent on the Same Machine As the Master

During long-run testing, I found that I wanted to make sure my Jenkins instance was properly executing jobs on an agent and not deadlocking.  Which would be all sorts of bad.  I also didn't have a lot of resources to try this out, and determined the easiest way to test this would be to launch an agent on the same machine as my master.  You might want to do this if you're trying to separate out jobs based on named agents, or just (as I was) trying to check if you're going to run into deadlocks!

For this tutorial, I'm using the brand new Jenkins 2.0 on Fedora.  There are so many other great things it can do, including pipelines.  Also, set up a directory with full read-write permissions for the agent's workspace.

On your Jenkins master, go to "Manage Jenkins" > "Manage Nodes" > "New Node"

Choose to create a "new node" with a name like "test_agent".  "secret_agent" also works.

Choose to run the node through JavaWebStart.  Download the agent.jar and place into the agent's home directory.

On that same page, you should have a command to run from the agent's directory. Log into your machine, move to the agent home directory, and run the given start command.  Your agent should connect and be ready to run workloads.

Have fun exploring the new features of Jenkins, and running your workloads on your new "agent".

Some helpful references:
Distributed Builds from the Jenkins website (now at jenkins.io)

Friday, June 3, 2016

NC BBQ Dim Sum: Potlikker Soup with Collard Greens Wontons

<speed rack alt_text=A Few Extra Steps for Something Transcendent>

</speed rack>

One of the coolest parts of a CSA is discovering new veggies.  Collard greens, while fairly common in southern dishes, were something I never had picked up before.  Spinach is in my wheelhouse, and leafy greens had bitten me in the past.  Curse you arugula; that's waaaaay too bitter for me.  So when collards started showing up, it was a new challenge to find recipes that weren't just using them as sandwich/wrap alternatives.  While trying to replace bread is not a great way to get into my good graces, collards redeemed themselves and may have even pushed past spinach with this recipe.  I don't prefer soup, but I finished every drop of the leftover broth.  The extra nutritional value is just a bonus on top of the tangy, savory taste.


Ingredients  Based on Southern Style Collard Greens from Southern Living (I made 1/2 a serving)
6 oz salted pork belly finely chopped
1 medium sweet onion, finely chopped
3 garlic cloves, finely chopped
1 - 1.5, 32oz container chicken broth
1.5lb collards washed and trimmed.  Cut into ribbons.
1/6 cup apple cider vinegar
1/2 tbsp sugar
1/2 tsp salt
1/4 + 1/8 tsp pepper
46 wonton wrappers

Heat a large stock pan over high heat.  Cook pork belly over heat until browned.  Remove from heat; add sweet onion and garlic cloves.  Cook until soft.  Add back pork belly.

Deglaze pan with chicken broth.  Add all the ingredients except the wrappers.

Put lid on pot.  Let cook for 3 hours until soft.  Check the liquid level and add some water if it gets too low.

Take off heat and strain the solids from the liquid reserving all the liquid.  This is the soup!  Let the greens cool a bit.

Time for some wonton folding!  I followed the tutorial from the Kitchn.  I used the soup to wet the edges of the wonton wrapper for an extra vinegar punch.

This might take awhile.  In the meantime, boil some water to cook the wontons.  You might alternatively want to boil the soup and cook the wontons there.  I didn't want to lose more liquid.
I couldn't wait and had a bowl of soup while boiling wontons. Sorry, not sorry.
Cook in batches; give the wontons some room in the pot.  Boil for about 5 minutes.
There are about 4 in the pot here.
Strain out and add to the soup.  Enjoy!  This is amazing reheated if it lasts that long; I was excited every day I had this for lunch.

</sidebar>

Friday, May 27, 2016

NC BBQ Dim Sum: Eastern-Style Cole Slaw Baked Egg Rolls

<speed rack alt_text:"Southern Eastern cuisine, remixed!">

</speed rack>

Cole slaw was never my favorite part of barbecue.  The mayonnaise and the spices killed it for me, and it doesn't keep well on a plate on a hot summer day.  Unfortunately, barbecue almost requires cole slaw to the point where it's on the sandwich.  Luckily, you can usually scrape it all off in one piece (score!) or get it on the side.  Or!  If you're really lucky, you can find a recipe that uses vinegar just like the good sauce.

Cole slaw translates pretty well into egg rolls or spring rolls.  Since I had a bunch of leftovers, I actually ended up eating it straight from the serving bowl while the egg rolls were in the oven.  Cook's gotta eat!


Ingredients  Recipe: Eastern North Carolina Slaw from Southern Living
1/2 cup white vinegar
1/4 cup sugar
1 tsp. kosher salt
1/4 tsp. freshly ground black pepper
1/2 head green cabbage (about 1 lb) grated - I usually get it preshredded
1/2 cup chopped celery
Egg roll wrappers
Olive oil

Mix all ingredients, toss to coat. Let stand 1 hour before serving, tossing occasionally.


Preheat the oven to 400F.  Assemble the egg rolls.  Spread a small amount of cole slaw into the center of the egg roll wrapper.


Fold the bottom of the wrapper over the cole slaw, wet and fold in the 2 sides.  Wet the edges of the top part of the wrapper and roll closed.


Assemble as many as you'd like to eat.  This make approximately 10 egg rolls depending on the amount of filling you use.  Brush the tops of the egg rolls with olive oil.  Put in the oven at 400 for 10 minutes or until golden.


Let cool and enjoy!  I find these are best when cooled, and the reheat very well.


</sidebar>