Sunday 20 August 2023

Podman Issues connecting to Registry

I recently got a new laptop so was setting up my pod man for the article I wrote a few months ago on IBM App Connect Enterprise (ACE) image hierarchy setup https://community.ibm.com/community/user/integration/blogs/aiden-gallagher1/2022/11/09/app-connect-enterprise-container-image-hierarchies and started getting a few issues doing a pod man build.

I am currently on: podman version 4.3.0, Apple M1 MAC Ventura 13.3.1.

[Solution] - changer the DockerFile pull 'FROM' tag to be the 12.0.0.7 or the podman image id e.g., ae6dcfdd3e9d. subsequent FROMs also work e.g., FROM level-1 worked after doing a FROM 09d860f27b68 for the ace base.

Errors:

podman build -f level-1.dockerfile . -t level-1    

STEP 1/2: FROM acebase

Resolving "acebase" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)

Trying to pull docker.io/library/acebase:latest...

Error: creating build container: initializing source docker://acebase:latest: reading manifest latest in docker.io/library/acebase: requested access to the resource is denied


podman build -f level-1.dockerfile . -t level-1    

STEP 1/2: FROM acebase:v1

Resolving "acebase" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)

Trying to pull docker.io/library/acebase:v1...

Error: creating build container: initializing source docker://acebase:v1: reading manifest v1 in docker.io/library/acebase: requested access to the resource is denied


podman build -f level-1.dockerfile . -t level-1    

STEP 1/2: FROM localhost/acebase

Trying to pull localhost/acebase:latest...

Error: creating build container: initializing source docker://localhost/acebase:latest: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

Wednesday 16 November 2022

World Cup 2022 Simulation - footballsimulationengine v4.0.0

 World Cup 2022 - Football Simulation Engine


I have revamped the World Cup 2018 from a few years ago https://aidensgallyvanting.blogspot.com/2018/06/russia-world-cup-2018-simulator.html and updated it with the latest teams and players. 

1. Pick your two teams and click select teams.
Hint: If you don't pick any teams or only pick one, just click "select teams" and it'll randomly pick two teams. 

This dynamically generates 11 selection boxes with each countries squad displayed in each box, ready to pick your team. You will also need to select your formation or it won't work!

2. Pick your players. Not sure who to pick? Just click random select and it will pick a formation. This will fill in each position with either a Goalkeeper, a Defender, a Midfielder or a Forward depending on the formation and the players preferred position.
Hint: Not all player of a certain type will be put in their best position i.e. an RB in a CB position!

3. Hit simulate match. After you hit "Simulate Match" you'll see a screen with all the players selected and the positions they were put in. At which point you can either do a "Quick Match" which simulates the match with updates to the statistics or you can "Watch Match" which will give a graphical view.

--------------------------------------------------------------------------------------------

First Match - Qatar vs Ecuador


Results

You can store your results in the 'public/WC22.html' file in the html table. Which looks something like so..

I'll post an update on how close the first round of results were next week after the real matches have occurred. 

Monday 16 May 2022

Is there value in buying commercial integration products?

 Original post is on medium

Authors: Sachin Tanna and Aiden Gallagher

Introduction

The Evolution of Integration

How is the integration landscape changing?

Figure 1 — Changing IT Landscape Factors (2021)

Greenfield Software Solutions

When to keep on developing

Using commercial integration products

Choosing an integration model

Conclusion

References


Monday 25 April 2022

Peer reviews - why we have them and how to cope with the comments

Whether writing an article, blog, code, creating a video or any other document, it's important to get other people to review what you have created. This ensures the quality is good, the content reads well and that the message being portrayed is correctly expressed.

Looking for a Reviewer

First, you need a reviewer. Reviewers come in all types and forms, but generally you want someone who can read and comment on the technical content of the document, someone to assess the readability alone and either could judge the relatability. Does it read well for all the intended audience(s), does it make sense and does it resonate with other people's needs? Basically, is it worth reading?

Once you have found a reviewer, have a brief chat to discuss the document:

  • Explain who is the intended audience and the context of the writing
  • Check if the language is suitable for non native speakers
  • Ensure they know they can be open and honest, it's pointless asking someone who will just say "looks great".

Post Review

Once the reviewer has completed their review and sent it back to you, if they have done their job well there is likely to be a number of comments. Questions, suggested changes and direct edits, but a sea of changes can be difficult to process and accept.

A lot of times after a review, I tend to go through the 5 stages of grief:
  1. Denial - There's no way they understood the point of the article, there's nothing that needs changing. It's perfect! come on!
  2. Anger - Well, I'm not making THAT change. This comment doesn't even make sense...
  3. Bargaining - Okay, well, actually maybe I didn't write that bit very well. Okay, it's possible that I have rambled a bit too much.
  4. Depression - Why do I write anything at all? I should hang up the pen or let someone else write this instead. Time for a sprinkle of imposter syndrome!
  5. Acceptance - That change I made thanks to that comment is pretty good. Actually, this reads quite well now. This is so much better.
I dramatise for effect but it certainly is a whirlwind of emotions when you get comments, especially at first or with a new reviewer. Over time it gets easier and when you have a couple of reviewers you trust its easier to jump straight to bargaining.

Make sure to thank your reviewer for their time (they didn't have to read it, and they didn't have to put a lot of time / energy into it either, they could have skim read). 

Coping with review comments

There are a number of ways to cope and handle the review comments, in order to bypass at least 'denial' and 'anger' stages and possibly after a while the 'depression' stage too.

Here are my 6 top tips for coping with review comments:
  1. Time to process - take some time, have a cup of tea/coffee, sleep on it and come back when you are happy / not too stressed
  2. Assume the reviewer is acting in good faith - even when they are not
  3. Try it out - Make a copy, try it out, does it look or feel better. You won't know if its better with the changes until you make them. The worst that happens is you back out your changes and revert to the original but generally there are always improvements to make
  4. Has the reviewer misunderstood the audience, purpose or context? If so, is it obvious in the text? find out where the misunderstanding could have happened and either ask the reviewer to reread or add the context into the document
  5. Have a call and talk it through - go through the comments, discuss what changes could be made, clarify the context, explain your thought process. This can accelerate future iterations and help get published quicker.
  6. Don't take it personally!

Conclusion

Document reviews are very important, they make our work better by ensuring the words we write have an impact. Whether improving readability, making it more accessible, helping get direct to the point and increasing how many people actually consume the content.

Monday 10 January 2022

Using Apple Shortcuts to track my New Year’s Resolutions

You can listen to our latest podcast on New Year's Resolutions here

Introduction

Each year I make a couple of New Year’s Resolutions, including a reading and running goal. To stay on track, I know I can quickly calculate how many kilometres I should have run so far this year or how many pages I should have read.

Rather than work this out manually every day, I thought I would create an Apple shortcut to give me an update. I hadn’t made one before, so thought I would combine learning something new with helping keep to my goals, so here’s how I did it.

Figure 1 - My Goal Shortcuts

The following results are from my first day playing with Apple Shortcuts. Thank you for your patience with the poorly named variables and probable sloppy steps to achieve the end results. Feel free to comment where I can save time or add efficiency.

Reading Goal

My goal is to read 8000 pages in a year, so I need to read 8000/365 pages per day (~22 pages a day). Times this by the number of days passed this year and you have the daily target. Easy enough in January, bit harder as you move through the months.

The following is what I set up in the Shortcut:

  1. “Set a variable” as the Current Date called ‘Today’
  2.  “Get the time between” the last day of last year (31/12/2021) and the variable ‘Today’
  3. “Set a variable” called ‘NumOfDay’ to the result of “Get the time between”
  4. Do a “Calculation” of 8000 / 365
  5. “Set a variable” called ‘PagesPerDay’ to the result of the “Calculation” function
  6. Do a “Calculation” of ‘PagesPerDay’ times ‘NumOfDay’ i.e. on 8th January – 8 * 22 = 176
  7. “Set a variable” called ‘PagesSoFar’ to the result of the ‘PagesPerDay’ times ‘NumOfDay’ calculation
  8. Round the ‘PagesSoFar’ to One Place
  9. Speak the Rounded Number

Below are the images to make it a bit clearer. 


Figure 2 - How many pages should I have read shortcut

The title of the Shortcut was “How Much Should I Have Read” which is what you say to Siri to get the output. Like today 9th January responds with 198.

Running Goal

I can repeat the same steps for my running goal of 600km. Changing the variable names and the 8000 to 600. 


Figure 3 – How many kilometres should I have run shortcut

So, I know how many kilometres I should have run, but how can I track how many I have actually run using Apple Shortcuts? Well, there doesn’t seem to be an out of the box Strava, Nike+ or Fitbit shortcut to get run totals or add runs.

Tracking Runs

There is an extensive set of Apple Notes shortcuts, so I set up a Note called “Running” where I can add keep a tally of runs. From that note, I was able to create two additional shortcuts, “Add Run to Total” and “What Distance have I Run”.


Figure 4 - Running Note

Add Run to Total

To add new runs to the Note, the Notes “Append” shortcut was used with the dictated text to allow a number to be said. Start off by saying “Hey Siri, Add run to Total”, Siri asks for input, you say how many kilometres you did on your run and it will add it to the end of the note.

The following is what I set up in the Shortcut:

  1. Add “Dictate Text” function
  2. Use the “Get numbers from” function from the dictated text
  3. “Set a variable” called ‘RunNum’ to the Calculator Numbers
  4. Use the “FindNote” function looking for a note with “Running” in the name
  5. Use the “Append” function to add ‘Numbers’ to the returned note. 

Figure 5 - Add Run to Total Shortcut

What distance have I done?

As I’m adding the runs, there needs to be an easy way of totalling them and then asking Siri to tell me the total without me having to add it all up. This is fairly simple if we iterate over the runs in the Note and add them to a variable before getting Siri to speak the variable back to us. 

The following is what I set up in the Shortcut:

  1. Use the “FindNote” function looking for a note with “Running” in the name
  2. Split the returned Note by New Lines (one for each run)
  3. Use the “Calculate” function to instantiate a variable soon with 0 + 0
  4. “Set a variable” called ‘TotalRuns’ which is a result of the previous calculation
  5. Start a loop of each line of the note by using the “Repeat” function with each item in the split text
  6. Discount the title line “Running” using the “If” function with a check that the repeated item isn’t “Running”
  7. Inside the if add the current lines run amount ‘Repeat Item’ to the running total variable ‘TotalRuns’
  8. Use “Set a variable” to set the already created ‘TotalRuns’ to the calculated value
  9. End the IF
  10. End the Repeat
  11. Set some text using the “Text” variable to be “km this year”
  12. Use the “Speak” function to output the ‘TotalRuns’ variable
  13. Use the “Speak” function to output the ‘Text’

This will output the total run distance this year from the Running Note with “km this year” after i.e., 12 km this year 


Figure 6 - What Distance Have I Done shortcut

So, What Next?

I can add runs to the Note, I can get the total distance I have ran and the target number of kilometres for the number of days passed. Next might be to get how many kilometres over or under the target I am.  

Other shortcuts that might come in useful:

  • Automatically add items to my “AnyList” shopping list
  • Open the garage in case my hands are full
  • Add information to a spreadsheet

Let’s see how I get on!

Tuesday 7 September 2021

Microsoft Azure PowerShell Storage Creation Error - 403

I was recently completing a Microsoft Azure lab and was starting a new PowerShell window. Within the PowerShell setup page you need to set a storage account and file share in order to use the PowerShell. The specific (advanced) settings you need to select are:

  • Subscription
  • Cloud Shell Region
  • Resource Group
  • Storage Account
  • File Share
I already had a pre-defined subscription and resource group and the region appeared to be pre-selected based on my location (Europe). The next step is to create a new storage account and file share but pressing 'Create' gave a 403 error and the below error message.

{"error":{"code":"RequestDisallowedByPolicy","target":"the123cloud","message":"Resource 'the123cloud' was disallowed by policy. Policy identifiers: '[{\"policyAssignment\":{\"name\":\"Allowed locations\",\"id\":\"/providers/Microsoft.Management/managementGroups/temp/providers/Microsoft.Authorization/policyAssignments/1111111111111\"},\"policyDefinition\":{\"name\":\"Allowed locations\",\"id\":\"/providers/Microsoft.Authorization/policyDefinitions/22222222222222\"}},{\"policyAssignment\":{\"name\":\"Allowed locations - Exclude IoTCentral\...


The keywords in the error were "RequestDisallowedByPolicy" and "Allowed locations" which essentially means the Cloud Shell Region selected was disallowed either because it wasn't selected within the subscription policy OR was intentionally excluded.

  1. Select a valid region in the 'Cloud Shell Region' which is allowed
  2. Ask the administrator to allow the location in the subscriptions policies

Monday 9 August 2021

Updating IBM MQ Storage Size in CP4I

If you have already deployed your IBM MQ operator in IBM Cloud Pak for Integration (CP4I) but want to increase the total amount of storage available for Persistent Volume Claims of the three log types (if using PVC) then the correct method is to first edit the PV / PVC and then update the MQ Deployment YAML and apply it.

The three log types that can rely on a persistent volume claim are:

  • Queue Manager – Holds data normally under /var/mqm. Will contain all persisted data and recovery logs, if no other volumes are specified.
  • PersistedData – PersistentVolume details for MQ persisted data, including configuration, queues and messages. Required when using multi-instance Queue Manager
  • RecoveryLogs - Persistent volume details for MQ recovery logs.

These must use persistent claims if you are running multi-instance. Here is an example of the Queue Manager specification that is deployed on CP4I. (This is a small snippet of the overall yaml)

spec:
queueManager:
name: QM01
storage:
queueManager:
type: persistent-claim
defaultDeleteClaim: false
persistedData:
enabled: true
size: 500M
class: rook-cephfs
type: persistent-claim
recoveryLogs:
enabled: true
size: 500M
class: rook-cephfs
type: persistent-claim

Example Recovery Log Storage Size Update

The following steps give an example set of steps of updating the recovery log which can be applied too any of the three MQ log types listed above.

  1. Login to the OpenShift console as an Administrator
  2. Navigate to Storage -> Persistent Volume Claim
  3. In the search bar type "${queueManagerName}-ibm-mq-recovery-logs"
    e.g. qm01-ibm-mq-recovery-logs
  4. Select the burger bar menu and select "Expand PVC"
  5. Type the required value i.e. 700 MiB and select "Expand"
  6. To validate the change: Navigate to the Workloads -> Pods
  7. Select the 'Ready' qm01 pod which will be either qm01-ibm-mq-0 OR qm01-ibm-mq-1
  8. Switch to the 'Terminal' view and run `df -h | grep mqm-logs` which will show the available storage has increased
    ${ip-address-and-port}:/volumes/csi/csi-vol-550e9a08-f915-11eb-9348-0a580afe140b/a1d2871a-aa2c-46cb-a422-19eca1ef0b36  700M   48M  852M   6% /mnt/mqm-log
  9. It's important to ensure you update the deployment YAML (configuration as code) in order to have a consistent record of your queue manager configuration should you build a new environment etc. from the same config.

    Go to your deployment YAML for the Queue Manager which we have stored locally. 
  10. Update the recovery log size to 700M and save the file. e.g.
    recoveryLogs:
    enabled: true
    size: 7000M
    class: rook-cephfs
    type: persistent-claim
  11. On a terminal where you are already logged into the OpenShift cluster run the following command:
    `oc apply -f ${yamlfilename}.yaml` e.g. `oc apply -f my-qm.yaml`

    This should result in "queuemanager.mq.ibm.com/qm01 configured"

Note: updating the Queue Manager YAML before updating the persistent volume will lead to the Queue Manager showing a failed status in the MQ operator view, although the container will continue to run.