I want to try open source software such as python, Node.js, and R on IBM i, but I'm reluctant to try development on the server IBM i environment. .. I thought, so I would like to introduce and utilize chroot.
Try it in the environment where yum is already installed by following the procedure here in advance.
Introduce the chroot package provided for IBM i with yum.
bash-4.4$ yum install -y ibmichroot
In the environment I tried, four other packages were also installed.
==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Installing:
ibmichroot noarch 2.1.3-0 ibm 20 k
Installing for dependencies:
coreutils-gnu ppc64 8.25-2 ibm 27 M
findutils ppc64 4.6.0-4 ibm 1.8 M
tar-gnu ppc64 1.29-1 ibm 1.1 M
unzip ppc64 6.0-3 ibm 249 k
Transaction Summary
==================================================================================================
Install 5 Packages
It is a function to make an arbitrary directory under / QOpenSys as the root of the virtual environment with chroot. This allows open source to be deployed without affecting the original environment. Here, the root is the directory ** / QOpenSys / chroot_test **. You didn't have to create the directory in advance.
bash-4.4$ chroot_setup /QOpenSys/chroot_test minimal nls
Setup will take a few minutes. Looking at the progress log, it looks like the environment under / QOpenSys is duplicated in the specified directory.
##### # # ###### ####### ####### #######
# # # # # # # # # # #
# # # # # # # # # #
# ####### ###### # # # # #
# # # # # # # # # #
# # # # # # # # # # #
##### # # # # ####### ####### #
##### ####### ####### # # ######
# # # # # # # #
# # # # # # #
##### ##### # # # ######
# # # # # #
# # # # # # #
##### ####### # ##### #
**********************
Live IBM i session (changes made).
**********************
/QOpenSys/chroot_test
/QOpenSys/chroot_test Does not Exist
+++/QOpenSys/chroot_test creation was successful!+++
Chroot type is: minimal
Chroot type is: nls
=====================================
setting up based on /QOpenSys/pkgs/lib/ibmichroot/config/chroot_minimal.lst
=====================================
action = :file
action = :mkdir
mkdir -p /QOpenSys/chroot_test/QOpenSys/usr/sbin
(Omission)
Extracting the tar file /QOpenSys/pkgs/lib/ibmichroot/config/icu4c.tar
To enter Your Chroot
RUN: chroot /QOpenSys/chroot_test /QOpenSys/usr/bin/sh
DONE!
Since the created chroot environment is in a clean state, we will introduce the package using yum. First, add ** bash ** and ** yum **.
bash-4.4$ yum --installroot=/QOpenSys/chroot_test install -y bash yum
Prepare yum repolist in chroot environment.
bash-4.4$ mkdir /QOpenSys/chroot_test/QOpenSys/etc/yum/repos.d/
bash-4.4$ cp /QOpenSys/etc/yum/repos.d/ibm.repo /QOpenSys/chroot_test/QOpenSys/etc/yum/repos.d/ibm.repo
Enter the set up environment. Change the bash prompt to distinguish between sessions.
bash-4.4$ chroot /QOpenSys/chroot_test /QOpenSys/usr/bin/bash
bash-4.4$ export PS1='chroot_test \$ '
chroot_test $
I will put python and necessary packages etc. with yum.
chroot_test $ yum install -y python3 python3-pip python3-pyzmq yum-utils vim
Insert Jupyter with pip.
chroot_test $ pip3 install --upgrade pip
chroot_test $ pip3 install jupyter
Generate a Jupyter notebook configuration file.
chroot_test $ jupyter notebook --generate-config
chroot_test $ vim /home/DEMO/.jupyter/jupyter_notebook_config.py
Edit the parameters.
#c.NotebookApp.ip = 'localhost'
c.NotebookApp.ip = 'xxx.xxx.xxx.xxx'
#c.NotebookApp.open_browser = True
c.NotebookApp.open_browser = False
Start Jupyter notebook.
chroot_test $ jupyter notebook
[I 13:12:16.529 NotebookApp] Writing notebook server cookie secret to /home/DEMO/.local/share/jupyter/runtime/notebook_cookie_secret
[I 13:12:16.952 NotebookApp] Serving notebooks from local directory: /
[I 13:12:16.952 NotebookApp] The Jupyter Notebook is running at:
[I 13:12:16.952 NotebookApp] http://xxx.xxx.xxx.xxx:8888/?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Access it with a browser and check it.
You can now use the Jupyter Notebook set up in the chroot environment.
For the setup of jupyter notebook on IBM i, I also referred to the article here!
Recommended Posts