Thursday, 28 May 2020

More on the old ToDo list - tinkering with Red Hat OpenShift Container Platform

Having spent a few years working on "pure" Kubernetes, I also need to get up-to-speed with RH OCP ....

I've spun up a cluster on the IBM Cloud, now need to get around to using/learning it ...

To me, OCP is a distribution of K8s, but it's oh-so-much more ....

Here's at what I'm looking....






Thursday, 21 May 2020

Docker and Node and macOS - Computer Said No

I'm using a Docker container that runs a NodeJS application to lint-check YAML files relating to my new best friend, Tekton CD.

This container is run as follows: -

docker run --volume $(PWD):/foo --rm --interactive tekton-lint /foo/sbs_pipeline.yaml

and should check the YAML for errors such as this: -

Error: Pipeline 'pipeline' references task 'build-task' but the referenced task cannot be found. To fix this, include all the task definitions to the lint task for this pipeline.

Sadly, however, when I ran the container, I saw: -

[Error: EPERM: operation not permitted, open '/foo/foo.yaml'] {

Something told me that this MAY be related to the path of the file that I was checking ....

Note that the container uses Docker volumes, via the --volume switch, mapping FROM $(PWD) on the host TO /foo inside the container.

Therefore, I wondered whether the problem was with the FROM path, which was a GitHub repository cloned locally on my Mac.

Well, I was close .......

For no particular reason, I've chosen to clone GH repositories to a subdirectory of my ~/Documents folder: -

/Users/hayd/Documents/GitHub/....

Can you see where I might be going wrong ??

Yep, macOS is protecting me from myself, by disallowing Docker from full access to my Documents folder ......


Once I changed this: -


and restarted Docker .....

All was well 👍🏽



Saturday, 9 May 2020

Running COBOL on ....

There's been a splurge of interest in COBOL recently, and especially in acquiring COBOL skills.

Now I learned COBOL in college in the late 80s, and have barely ever looked at it since, apart from a brief spot of exploration of COBOL on the AS/400 back in the 90s

But now COBOL is cool again ( hint, it never went away )

So, without a Raspberry Pi to hand, here's me running COBOL on ..... an IBM mainframe !

cat /proc/cpuinfo 

vendor_id       : IBM/S390
# processors    : 2
bogomips per cpu: 21881.00
max thread id   : 0
features : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs 
facilities      : 0 1 2 3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 47 48 49 50 51 52 53 54 57 58 59 60 64 69 71 73 74 75 76 77 78 80 81 82 129 130 131 133 134 135 138 139 146 147 156
cache0          : level=1 type=Data scope=Private size=128K line_size=256 associativity=8
cache1          : level=1 type=Instruction scope=Private size=128K line_size=256 associativity=8
cache2          : level=2 type=Data scope=Private size=4096K line_size=256 associativity=8
cache3          : level=2 type=Instruction scope=Private size=2048K line_size=256 associativity=8
cache4          : level=3 type=Unified scope=Shared size=131072K line_size=256 associativity=32
cache5          : level=4 type=Unified scope=Shared size=688128K line_size=256 associativity=42
processor 0: version = FF,  identification = 4D3F07,  machine = 3906
processor 1: version = FF,  identification = 4D3F07,  machine = 3906

cpu number      : 0
cpu MHz dynamic : 5208
cpu MHz static  : 5208

cpu number      : 1
cpu MHz dynamic : 5208
cpu MHz static  : 5208


uname -a

Linux 766b81312d8b 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:21:03 UTC 2019 s390x s390x s390x GNU/Linux

cobc --version

cobc (OpenCOBOL) 1.1.0
Copyright (C) 2001-2009 Keisuke Nishida / Roger While
Built    Aug 04 2016 15:56:22
Packaged Feb 06 2009 10:30:55 CET


cat hello.cbl 

       Identification Division.
       Program-ID. sampleCOBOL.

       Data Division.

       Procedure Division.
       Main-Paragraph.
       Display "Hello World!"
       Stop Run.


cobc -x -o hello hello.cbl 

file ./hello

./hello: ELF 64-bit MSB shared object, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld6, for GNU/Linux 3.2.0, BuildID[sha1]=351ec732463ff4add4598e53e1533e534a2fdf44, not stripped

./hello 

Hello World!

So, for the record, I'm using a Virtual Server running on an IBM Z box hosted in the IBM Cloud via the IBM Hyper Protect Virtual Servers offering.

Even better, the first one is free ......




Finally, the idea of running COBOL on Ubuntu came from this blog: -


and uses Open COBOL

Other COBOL compilers exist .......

Wednesday, 6 May 2020

Looking up nslookup


I regularly need to install tools and utilities onto newly-built Ubuntu boxes, and was looking for the nslookup tool today ....

I'd tried installing it via net-tools 

apt-get update && apt-get install -y net-tools

but that didn't help ...

I tried/failed to remember how I'd installed it last time ....

Then I found this: -


which reminded me about the apt-cache tool: -

apt-cache search nslookup

dnsutils - Clients provided with BIND
gresolver - graphical tool for performing DNS queries
knot-dnsutils - Clients provided with Knot DNS (kdig, knslookup, knsupdate)
libbot-basicbot-pluggable-perl - extended simple IRC bot for pluggable modules
libnet-nslookup-perl - simple DNS lookup module for perl


apt-get install -y dnsutils

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  bind9-host geoip-database libbind9-160 libdns1100 libgeoip1 libirs160 libisc169 libisccc160 libisccfg160 liblwres160
Suggested packages:
  rblcheck geoip-bin
The following NEW packages will be installed:
  bind9-host dnsutils geoip-database libbind9-160 libdns1100 libgeoip1 libirs160 libisc169 libisccc160 libisccfg160 liblwres160
...
Setting up bind9-host (1:9.11.3+dfsg-1ubuntu1.11) ...
Setting up dnsutils (1:9.11.3+dfsg-1ubuntu1.11) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

which nslookup

/usr/bin/nslookup

nslookup -version

nslookup 9.11.3-1ubuntu1.11-Ubuntu

Job done!!

Saturday, 2 May 2020

Build and deploy a Docker image on Kubernetes using Tekton Pipelines

I've been tinkering with Tekton this past few weeks, and have found a bunch of useful resources including: -


Tekton is an open source project to configure and run continuous integration (CI) and continuous delivery (CD) pipelines within a Kubernetes cluster. In this tutorial, I walk you through basic concepts used by Tekton Pipelines. Then, you get a chance to create a pipeline to build and deploy to a container registry. You also learn how to run the pipeline, check its status, and troubleshoot issues. But before you get started, you must set up a Kubernetes environment with Tekton installed.

I've also been following a pair of Tekton tutorials: -



and, of course, the official Installing Tekton Pipelines

Modernize a monolithic Node.js application into a microservices architecture using IBM Cloud Pak for Applications

From one of my IBM colleagues, we have this: - This tutorial shows how to transform a traditional monolithic core banking application, which...