Installing Miniconda in z/OS UNIX

Making z/OS UNIX more and more UNIX like

Aaron M. Kippins
Theropod
6 min readApr 27, 2023

--

Photo by Emile Perron on Unsplash

🖥🖥

Getting Setup

Working through installation documentation can be a little daunting sometimes. Because of that, we’ll walk through a recent install of Miniconda from Rocket Software on a z/OS LPAR.

First up, choose an LPAR and make sure that the target system is IPLed and has access to z/OS UNIX/OMVS. For this installation I’m assuming that you have a couple of things:

  • Bash installed on your z/OS system (not required, but recommended)
  • FTP/SFTP available on your laptop/desktop
  • a ZFS with at least 900MB of space on your z/OS system

Once you have these things settled, we can get right into the installation of Miniconda. Here’s a link to the Rocket Site where we’ll install the .pax file:

Once we get to the webpage, we’ll be greeted with a page that looks like this.

From here, you’ll need to make a login to access the community portal and gain access to the .pax files

From there, you can click downloads in the header on top, bringing you to a page that looks like this.

You’ll want to click on Open AppDev for Z on the left.

Then you’ll want to select USSP-2043 Rocket Open AppDev for Z (free solution).

From here you’ll download the following files.

  • miniconda-zos-<X.Y>-<yyyy-mm-dd>.run
  • appdev_manifest-<X.Y>.txt

In my instance they were I just chose the most up-to-date versions of both.

I’d also recommend installing the “zOS Miniconda documentation.pdf” which will have some general information about the installation. Some that I’ll walk you through and some other stuff that may be helpful later.

Into the Terminal

For now, we’re going to SFTP or FTP the files we just downloaded to the target system. They need to be transferred in binary mode. With SFTP this will be taken care of but with FTP the binary command needs to be run before the files are transferred.

➜ ~/Downloads sftp <LPAR ip or url>
<username>@<LPAR ip or url>s password:
Connected to <LPAR ip or url>
sftp> put miniconda-zos-2.0-2022-01-17.run
Uploading miniconda-zos-2.0-2022-01-17.run to /home/<username>/miniconda-zos-2.0-2022-01-17.run
miniconda-zos-2.0-2022-01-17.run 100% 96MB 9.2MB/s 00:10
sftp> put appdev_manifest_1.2.1.txt
Uploading appdev_manifest_1.2.1.txt to /home/<username>/appdev_manifest_1.2.1.txt
appdev_manifest_1.2.1.txt 100% 657 194.6KB/s 00:00
sftp> exit

From here we’ll SSH into the target installation system. First I am going to check to see that my files were transferred properly. Change into the directory that you SFTP or FTP’d your files into. Then run a quick ls to make sure that your files are there.

➜ ~/Downloads ssh <LPAR ip or url>
<username>@<LPAR ip or url>s password:
>bash
>source .bash_profile
>ls
appdev_manifest_1.2.1.txt miniconda-zos-2.0-2022-01-17.run

*Note: remember that I’m using bash for ease of navigation in z/OS UNIX

From here we need to make sure a couple of things get set before we run the actual install.

We’re going to set tags for the files that we installed and FTP’d over for the miniconda file. We’re going to make sure that it’s executable with a chmod +x

chmod +x miniconda-zos-<X.Y>-<yyyy-mm-dd>.run

Next we’re going to change the tag of the appdev_manifest file. For this, we’re changing the file to be tagged as a form of ASCII that z/OS can understand. That way when the file is read in for our installation later it’s read as ASCII and not EBCDIC.

chtag -tc 819 appdev_manifest-<X.Y>.txt

If you need to check use the command ls -laT your files should look something like this.

>ls -laT
total 196744
drwxr-x--- 2 <username> <usergroup> 8192 Jan 10 14:57 .
dr-xr-xr-x 4 <username> <usergroup> 0 Jan 10 14:34 ..
- untagged T=off -rw------- 1 <username> <usergroup> 1360 Dec 8 12:37 .bash_history
- untagged T=off -rw-r--r-- 1 <username> <usergroup> 352 May 8 2020 .bash_profile
- untagged T=off -rw------- 1 <username> <usergroup> 151 Jan 10 14:34 .sh_history
t ISO8859-1 T=on -rw-r--r-- 1 <username> <usergroup> 657 Jan 10 14:57 appdev_manifest_1.2.1.txt
- untagged T=off -rwxr-xr-x 1 <username> <usergroup> 100620275 Jan 10 14:57 miniconda-zos-2.0-2022-01-17.run

Following that, we’ll need to set a couple of environment variables

export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS='FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)'

The first is _BPXK_AUTOCVT

From the IBM z/OS 2.5 Documentation:

Used when enabling automatic conversion of tagged files. When set, this variable overrides the AUTOCVT setting in BPXPRMxx.

The second is _CEE_RUNOPTS

From the IBM z/OS 2.5 Documentation:

The _CEE_RUNOPTS environment variable has a unique behavior. It can be unset, or modified, but will be re-created or added to across an exec to effect the propagation of invocation Language Environment runtime options. Mechanisms for setting the value of the _CEE_RUNOPTS environment variable include using the export command within the z/OS® UNIX shell, or using the setenv() or putenv() functions within a C/C++ application.

You’ll also need these settings for any user that is going to use Miniconda after installation so it’s recommended that you also place those two export lines into your .bash_profile as well. Considering that vi isn’t on the systems by default, you may want to do this in oedit through the use of omvs from the ISPF panels.

Now we can run the installer using this command:

./miniconda-zos-<X.Y>-<yyyy-mm-dd>.run --path <miniconda_installation_path>

* Note: If you don’t specify a path Miniconda will be installed into your home directory in a folder named “miniconda”.

You may see this warning message:

WARNING: Available space in /example_tools_directory/miniconda is 20 MB, it is less than minimum space required for this installation — 900 MB

That just is telling you that you need more space in the ZFS that you’re installing into.

Extra Tidbits

After this, you should be all set! There are a couple of final things that I’d recommend doing. The first is adding your newly installed Miniconda tools to your PATH. You can do that with this command here.

export PATH="$PATH:<miniconda_installation_path>/bin"

Similar to the exports above you’ll also need these settings for any user that is going to use Miniconda after installation so it’s recommended that you also place this export line into your .bash_profile as well.

One more thing that we can set up is the open-source repo that Rocket has for Conda and Miniconda. By default, this channel isn’t included in the base set of channels that you can download from. This one is useful because it has tools like git and vim that might prove helpful!

conda config --add channels zoss-appdev

After adding that to your configuration you can install from a bunch of the packages that they have available for z/OS!

That’s that for the Miniconda install! Have fun with all your new toys!

I hope that you enjoyed this article! If you did please hold down the applause button as long as you can 👏🏽 (Really! Hold it! 😉)! Leave a comment to let me know your thoughts! Share with a friend or colleague! If you’d like to hear more from me please follow! It all means the world to me! Cheers!

Check out another one of my articles if you have the time!

--

--

Aaron M. Kippins
Theropod

Senior Software Engineer @ IBM ✨ Overthinker ✨ Conversationalist ✨ Writing about my career, experiences, tech, and just life in general ❤️🍻 kippins.me