Skip to main content
Bruce Hewson
Participating Frequently
Dec 9, 2020 2:11 AM UTC

Z/OS Conda - architectural concepts in a multi-site multi-system environment with a single maintenance build system.

My first glance at MiniConda. It appears to be customized on a single system installation concept. 

Historically we have installed the OpenSource tools easily into each products own ZFS dataset mounted on the maintenance path. Propagation to all the other systems occurred via DFDSS backup of said ZFS dataset to be restored and renamed as required on each target system.

In simple terms can anyone document how this install/maintain/propagate process could be performed using MiniConda in Z/OS.

I have started reading the User Manuals @ https://docs.conda.io and my initial impression is that it is similar in concept to APT in DEBIAN LINUX.

Additionally what firewall rules would I need to get this working?

Regards
Bruce

------------------------------
Bruce Hewson
Citibank
------------------------------

    31 replies

    David Crayford
    Rocketeer
    May 4, 2021 4:57 AM UTC
    One question about combining those .sh files -

    Do I understand correctly that the reason for this is that for audit / change management, you can only report /etc/profile and not some scripts 'external' to it?

    Won't it work if you just 'source' them from your /etc/profile like this below? Also please keep in mind that PATH, LIBPATH and MANPATH are modified by conda itself and not by those activation scripts.

    export CONDA_PREFIX=/path/to/your/env
    export PATH=$CONDA_PREFIX/bin:$PATH
    export LIBPATH=$CONDA_PREFIX/lib:$LIBPATH
    export MANPATH=$CONDA_PREFIX/share/man:$CONDA_PREFIX/man:$MANPATH

    for i in $CONDA_PREFIX/etc/conda/activate.d/*.sh; do . $i; done

    ------------------------------
    Vladimir Ein
    Rocket Software
    ------------------------------
    I can't speak for Lionel but what I think he wants something similar to how we work at Rocket. He wants to download the tools into a sandbox and them deploy them to a shared file system that can be accessed by multiple LPARs.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    Lionel Dyck
    Participating Frequently
    May 4, 2021 6:38 AM UTC
    I can't speak for Lionel but what I think he wants something similar to how we work at Rocket. He wants to download the tools into a sandbox and them deploy them to a shared file system that can be accessed by multiple LPARs.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    @David Crayford - that is exactly what I'm looking for.  Is there a Conda on z/OS​ best practices doc.  Conda looks fine for an individual system, such as a personal computer, but doesn't appear granular enough for an environment of multiple LPARs and/or SYSPLEXes - at least not at 1st (or 2nd) look.

    From my reading it appears you can only have one environment active at a time, which means each environment must have all of the tools within it.

    The ideal is to be able to deploy release x of tool a and release y of tool b, each in their own filesystems so that either can be replaced by a newer release without impacting the other.

    ------------------------------
    Lionel Dyck
    lbdyck
    ------------------------------
    David Crayford
    Rocketeer
    May 4, 2021 6:55 AM UTC
    @David Crayford - that is exactly what I'm looking for.  Is there a Conda on z/OS​ best practices doc.  Conda looks fine for an individual system, such as a personal computer, but doesn't appear granular enough for an environment of multiple LPARs and/or SYSPLEXes - at least not at 1st (or 2nd) look.

    From my reading it appears you can only have one environment active at a time, which means each environment must have all of the tools within it.

    The ideal is to be able to deploy release x of tool a and release y of tool b, each in their own filesystems so that either can be replaced by a newer release without impacting the other.

    ------------------------------
    Lionel Dyck
    lbdyck
    ------------------------------
    @Lionel Dyck That is a perfectly legitimate requirement. I come from a System Programming background and would expect the same. I'm sure one of the PT guys will chip in with instructions on how we do it at Rocket.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    Participating Frequently
    May 4, 2021 7:27 AM UTC
    @Lionel Dyck That is a perfectly legitimate requirement. I come from a System Programming background and would expect the same. I'm sure one of the PT guys will chip in with instructions on how we do it at Rocket.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    When I used to do software installations, we had specific requirements for change control. Before changing a system we needed to submit information about exactly what modifications were being made, what were the symptoms of failure (e.g. a change to an environment variable that changed the behavior of something else would qualify here), and detailed instructions someone else could use to back out the change. I am unclear what those instructions would look like with Conda.

    Also, many customers have their own procedures that have evolved over decades for migrating software between systems. Often when a vendor had a custom installation system it was necessary to install, analyze what it actually did, tear apart the result and fit the pieces into the existing process. A 40 step process to install git doesn't sound that bad because I understand exactly what changes have been made. My initial impression of the Conda installation is it would actually be more difficult because you can't see exactly what it is doing.

    (Having viewed the videos on the installation maybe it isn't so bad - it looks like changes may be local to a directory, with some script changes to point to the updated location. So change documentation would need to list old and new directories, and the script changes.)

    ------------------------------
    Andrew Rowley
    Black Hill Software
    ------------------------------
    David Crayford
    Rocketeer
    May 4, 2021 7:53 AM UTC
    When I used to do software installations, we had specific requirements for change control. Before changing a system we needed to submit information about exactly what modifications were being made, what were the symptoms of failure (e.g. a change to an environment variable that changed the behavior of something else would qualify here), and detailed instructions someone else could use to back out the change. I am unclear what those instructions would look like with Conda.

    Also, many customers have their own procedures that have evolved over decades for migrating software between systems. Often when a vendor had a custom installation system it was necessary to install, analyze what it actually did, tear apart the result and fit the pieces into the existing process. A 40 step process to install git doesn't sound that bad because I understand exactly what changes have been made. My initial impression of the Conda installation is it would actually be more difficult because you can't see exactly what it is doing.

    (Having viewed the videos on the installation maybe it isn't so bad - it looks like changes may be local to a directory, with some script changes to point to the updated location. So change documentation would need to list old and new directories, and the script changes.)

    ------------------------------
    Andrew Rowley
    Black Hill Software
    ------------------------------

    The idea behind virtual environments like Conda and Poetry (Python, pyenv) is that you can create a virtual environment for your project with different versions of software, both libraries and the Python intepreter. It's actually much better for application stability but a PITA for global installations. Trade offs - but you can do both. Create a sandbox and roll out an installation wide environment. You have multiple sandboxes with different environments with easily downloadable updates.

    Suck it and see. If you don't like it post constructive criticism on here and I'm sure the guys will do their best to help.

    If you want paid support for the ported tools then I'm sure we can bundle together packages and provide on site support as needed.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    Lionel Dyck
    Participating Frequently
    May 4, 2021 8:08 AM UTC

    The idea behind virtual environments like Conda and Poetry (Python, pyenv) is that you can create a virtual environment for your project with different versions of software, both libraries and the Python intepreter. It's actually much better for application stability but a PITA for global installations. Trade offs - but you can do both. Create a sandbox and roll out an installation wide environment. You have multiple sandboxes with different environments with easily downloadable updates.

    Suck it and see. If you don't like it post constructive criticism on here and I'm sure the guys will do their best to help.

    If you want paid support for the ported tools then I'm sure we can bundle together packages and provide on site support as needed.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    Here is an example of what I was thinking (hoping for):

    1. Install git and related tools into /home/me/conda/git226
    2. test there
    3. copy ght git226 directory into a new filesystem (zfs)
    4. copy new filesystem to other systems (or share it)
    5. on  test system mount (RO) it at the /xxx/git mount point for broader validation
    6. on production systems mount (RO) it at /xxx/git mount point for production use
    7. This requires that the /etc/profile be setup to reference /xxx/git as appropriate

    With the pre-conda process I could do this. With miniconda I don't see how to do that  (yet).

    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------
    Participating Frequently
    May 4, 2021 7:49 PM UTC

    The idea behind virtual environments like Conda and Poetry (Python, pyenv) is that you can create a virtual environment for your project with different versions of software, both libraries and the Python intepreter. It's actually much better for application stability but a PITA for global installations. Trade offs - but you can do both. Create a sandbox and roll out an installation wide environment. You have multiple sandboxes with different environments with easily downloadable updates.

    Suck it and see. If you don't like it post constructive criticism on here and I'm sure the guys will do their best to help.

    If you want paid support for the ported tools then I'm sure we can bundle together packages and provide on site support as needed.

    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------
    Virtual environments with different versions of software is good for some types of software development, but I think most z/OS sites want everyone using the same thing. They don't want downloadable updates other than in their specific installation environment.

    Sites want to:
    • e.g. install bash and git and roll out bash to all systems but git to a subset.
    • e.g. install an update to bash to fix a CVE and roll out to all systems while an update to git has been rolled out to a few systems
    • roll out exactly what is installed on the test environment to the other systems
    Installing things independently makes dependencies more complex to manage, but sites are used to doing that already. 

    I'm not working in this area any more, but that is my experience from when I did do this work.

    ------------------------------
    Andrew Rowley
    Black Hill Software
    ------------------------------
    David Crayford
    Rocketeer
    May 4, 2021 10:07 PM UTC
    Virtual environments with different versions of software is good for some types of software development, but I think most z/OS sites want everyone using the same thing. They don't want downloadable updates other than in their specific installation environment.

    Sites want to:
    • e.g. install bash and git and roll out bash to all systems but git to a subset.
    • e.g. install an update to bash to fix a CVE and roll out to all systems while an update to git has been rolled out to a few systems
    • roll out exactly what is installed on the test environment to the other systems
    Installing things independently makes dependencies more complex to manage, but sites are used to doing that already. 

    I'm not working in this area any more, but that is my experience from when I did do this work.

    ------------------------------
    Andrew Rowley
    Black Hill Software
    ------------------------------

    No arguments from me Andrew, that's exactly how z/OS software is and should be managed. Conda doesn't prevent you from doing that.

    We've had a chat about this internally and the Ported Tools engineering manager will post a reply with a link to a document that describes how to do that.



    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------

    Tatiana Balaburkina
    Rocketeer
    May 5, 2021 4:20 AM UTC

    No arguments from me Andrew, that's exactly how z/OS software is and should be managed. Conda doesn't prevent you from doing that.

    We've had a chat about this internally and the Ported Tools engineering manager will post a reply with a link to a document that describes how to do that.



    ------------------------------
    David Crayford
    Senior Software Engineer
    Rocket Software
    ------------------------------

    Hi Lionel,

    The process that you described can be also used with Miniconda. We have a document that describes copying one installation to different LPARs in details. I want to note that Miniconda is a flexible tool, and it can be adapted to different environments. We didn't want to limit customers to only the maintenance approach. If you feel that you need guidelines on how to adjust Miniconda to your environment, don't hesitate to reach out to us.

     

    How to deploy a specific level of tools to one LPAR?

    Let's start with understanding what an environment is. From the perspective of filesystem a conda environment is a directory that contains a specific collection of conda packages that you have installed. During installation process conda installs dependencies and confirms that there are no incompatible packages in the environment, so the end user doesn't need to worry about that.
    From the user's perspective, a conda environment is a set of tools which will be used together (not necessarily simultaneously). We would recommend creating a separate environment for test purposes (see Early testing of updates) or when you need 2+ levels of tools on one LPAR.
    So how to deploy a specific level of tools to one LPAR? Create an environment, activate it and install required packages (all verbs refer to conda commands).

     

    Which files does miniconda modify?

    miniconda-zos-X.Y-yyyy-mm-dd.run is kind of a self-extracting archive, which will be unpacked to the directory specified by user. It is called the Miniconda installation directory. When you install a package into an environment conda will modify an environment directory and a cache directory, which by default are placed into the Miniconda installation directory. Also, conda can create and modify $HOME/.condarc and $HOME/.conda. This file and directory are located outside of the installation directory.

    Conda doesn't modify other external files or directories unless the user explicitly specifies that in configuration files, conda command options or any other way.

    Note, that the tools that you install with conda can modify external files. This behavior is unrelated to the Miniconda installation approach.

    Normally, environments are created within the Miniconda installation directory. Although it's possible to make an environment on a separate zFS, at the moment we don't recommend this approach, because it might lead to the further issues with updates.
    Note, that you will need a Miniconda installation on each LPAR where you want to use environments.

    Please, let us know if you need further assistance.



    ------------------------------
    Tatiana Balaburkina
    Rocket Software
    ------------------------------
    Lionel Dyck
    Participating Frequently
    May 6, 2021 9:23 AM UTC

    Hi Lionel,

    The process that you described can be also used with Miniconda. We have a document that describes copying one installation to different LPARs in details. I want to note that Miniconda is a flexible tool, and it can be adapted to different environments. We didn't want to limit customers to only the maintenance approach. If you feel that you need guidelines on how to adjust Miniconda to your environment, don't hesitate to reach out to us.

     

    How to deploy a specific level of tools to one LPAR?

    Let's start with understanding what an environment is. From the perspective of filesystem a conda environment is a directory that contains a specific collection of conda packages that you have installed. During installation process conda installs dependencies and confirms that there are no incompatible packages in the environment, so the end user doesn't need to worry about that.
    From the user's perspective, a conda environment is a set of tools which will be used together (not necessarily simultaneously). We would recommend creating a separate environment for test purposes (see Early testing of updates) or when you need 2+ levels of tools on one LPAR.
    So how to deploy a specific level of tools to one LPAR? Create an environment, activate it and install required packages (all verbs refer to conda commands).

     

    Which files does miniconda modify?

    miniconda-zos-X.Y-yyyy-mm-dd.run is kind of a self-extracting archive, which will be unpacked to the directory specified by user. It is called the Miniconda installation directory. When you install a package into an environment conda will modify an environment directory and a cache directory, which by default are placed into the Miniconda installation directory. Also, conda can create and modify $HOME/.condarc and $HOME/.conda. This file and directory are located outside of the installation directory.

    Conda doesn't modify other external files or directories unless the user explicitly specifies that in configuration files, conda command options or any other way.

    Note, that the tools that you install with conda can modify external files. This behavior is unrelated to the Miniconda installation approach.

    Normally, environments are created within the Miniconda installation directory. Although it's possible to make an environment on a separate zFS, at the moment we don't recommend this approach, because it might lead to the further issues with updates.
    Note, that you will need a Miniconda installation on each LPAR where you want to use environments.

    Please, let us know if you need further assistance.



    ------------------------------
    Tatiana Balaburkina
    Rocket Software
    ------------------------------
    Thank you for your document - I've developed an approach that seems to be working very well for me now.

    Thoughts/comments/suggestions welcome.

    1. conda create -n git226
    2. conda activate git226
    3. conda install git
    4. conda deactivate git226
    5. env | sort > before
    6. conda activate git226
    7. env | sort > after
    8. conda deactivate git226
    9. diff before after > diff
    10. edit diff
    - ignore > CONDA .... records
    - ignore all records that don't have a > or <
    - ignore PS2 and PWD
    - ignore SHELL and SHLVL
    - capture delta for remaining
    - create exports for delta
    export LIBPATH=/u/lbdyck/miniconda/envs/git226/lib:$LIBPATH
    export MANPATH=/u/lbdyck/miniconda/envs/git226/share/man:/u/lbdyck/miniconda/envs/git226/man:$MANPATH
    export PATH=/u/lbdyck/miniconda/envs/git226/bin:$PATH
    - adjust the exports for the new path (e.g. /tools/git/)
    export LIBPATH=/tools/git/lib:$LIBPATH
    export MANPATH=/tools/git/share/man:/tools/git/man:$MANPATH
    export PATH=/tools/git/bin:$PATH
    11. Create a new zfs (e.g. git226.zfs)
    12. mount it at /tools/git/
    13. copy (cp) from /u/lbdyck/miniconda/envs/git226 to /tools/git
    cp -R /u/lbdyck/miniconda/envs/git226/ /tools/git/
    14. Add new exports to /etc/profile

    I was hoping to find a document, or file, that explained the customizations required but was unable to do so and the activate script was more than I wanted to review - thus the use of the env command.

    ------------------------------
    LionelDyck <><
    https://github.com/zigi
    https://github.com/lbdyck
    ------------------------------