"ipcluster nbextension enable" doesn't have subcommand specified - ipython-parallel

I have ipyparallel 5.3.0. Its official doc, https://github.com/ipython/ipyparallel#install, instructs the following:
To enable the IPython Clusters tab in Jupyter Notebook:
ipcluster nbextension enable
But I got the following issue hence it didn't work.
No subcommand specified. Must specify one of: ['start', 'stop', 'engines'].
I did more checks following minrk's tips.
$ipcluster --version
5.2.0
$which -a ipcluster
/home/etlolap/anaconda3/bin/ipcluster
/user/bin/cluster
$head -n 1 $(which ipcluster)
#!/home/etlolap/anaconda3/bin/python
Everything looks fine though.

For all users with root/admin access :
sudo jupyter serverextension enable --py ipyparallel
sudo jupyter nbextension install --py ipyparallel
sudo jupyter nbextension enable --py ipyparallel
Don't forget to start it by :
ipcluster start

That suggests that ipcluster doesn't point to the version you expect to have installed. What do you see for:
ipcluster --version
? You might also check if there's more than one installed with:
which -a ipcluster
You can also verify that the ipcluster command is started with the Python you expect with:
head -n 1 $(which ipcluster)
If there is some confusion of package versions, it can help to remove and reinstall the package. Repeat:
pip uninstall ipyparallel
Until it says there is no ipyparallel package found, then install again with:
pip install --upgrade ipyparallel

For anyone facing this issue, try on your terminal :
jupyter serverextension enable --py ipyparallel --user
jupyter nbextension install --py ipyparallel --user
jupyter nbextension enable --py ipyparallel --user
It worked just fine for me, I had the same command problem and everything seemed well installed (ipcluster version, python version...).
The issue was also debated on IPython's Github if you need further information : https://github.com/ipython/ipyparallel/issues/170

Related

Install valgrind on ubi8-minimal docker image

I want to install valgrind on a docker container based on ubi-8 minimal image. The problem is the tool doesn't seem to be available in any packages on the microdnf repository. I tried with gcc-toolset-11-valgrind, gcc-toolset-11-gcc-11, gcc-toolset-11-gcc-c++, gcc-toolset-11-runtime, etc to see if the tool is available in any package. There should be a package available for normal rpm: gcc-toolset-11-perftools, but it isn't available.
I also tried to download valgrind by hand and execute from a volume but the dependencies are not available. Is there a easier way to get running valgrind on a ubi8-minimal docker container?
Using rpm in combination with already download packages I finally managed to install valgrind, the process was:
download valgrind package and dependencies with yum in the host machine
yum install --downloadonly --downloaddir=./valgrindDownload gcc-toolset-11-valgrind
Find out missing dependencies (gcc-toolset-11-runtime-11, and perl)
Install local packages using rpm:
rpm --install ./valgrindDownload/gcc-toolset-11-valgrind-3.17.0-6.el8.x86_64.rpm
Find out valgrind instalation directory
In my case was under /opt/rh/gcc-toolset-11/root/usr/bin/valgrind
Finally run the full command:
sudo docker run -v `pwd`:/home/<container-dir> <docker-image>:<version> /bin/bash -c "microdnf install gcc-toolset-11-runtime-11.1-1.el8.x86_64 && microdnf install perl-5.26.3-421.el8.x86_64 && rpm --install ./valgrindDownload/gcc-toolset-11-valgrind-3.17.0-6.el8.x86_64.rpm && /opt/rh/gcc-toolset-11/root/usr/bin/valgrind --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt command <arguments>"
Doing so, the valgrind output gets redirected to valgrind-out.txt

Can't find any man pages in Fedora Docker Image

After installing the man pages via dnf, I still can't find them inside /usr/share/man.
docker run --rm -it fedora bash -c "dnf install -y man-pages && ls -lR /usr/share/man"
Did I miss something?
The default configuration for the docker version of fedora disable the installation of documentation.
cat /etc/dnf/dnf.conf
Check out the last line :
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=False
skip_if_unavailable=True
tsflags=nodocs
However, it is still possible to change the last line or override it like below command :
dnf install -y man-pages --setopt='tsflags='
I would liked to contribute as I was looking for the answer and I found the answer, from the link here
Confirm the below line is removed from /etc/dnf/dnf.conf
tsflags=nodocs
and remove and reinstall the man pages using dnf
dnf install man man-pages man-db

Docker: Openjdk:14 RHEL based imaged, cannot install yum/wget/netstat

In my dockerfile, I need a maven builder (3.6 at least) working on a OpenJDK (J14 is required).
FROM maven:3.6.3-openjdk-14 as builder
The problem is simple: I need netstat command because it is used in several scripts. The OpenJDK official image is RHEL based, so it comes without any of this package installed.
I tried to download it or yum via wget command but, as you can guess, it is not installed. I feel trapped because it seems like you cannot you can't install any package on it.
That image is actually based on Oracle
$ podman run -it maven:3.6.3-openjdk-14 /bin/bash -c 'cat /etc/os-release'
NAME="Oracle Linux Server"
VERSION="8.2"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.2"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:2:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.2
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.2
And this is actually a "slim" variant where dnf or yum aren't installed, but microdnf is. Try using that, instead:
RUN microdnf install /usr/bin/netstat
Or
RUN microdnf install net-tools

Is there any way to run "pkexec" from a docker container?

I am trying to set up a Docker image (my Dockerfile is available here, sorry for the french README: https://framagit.org/Gwendal/firefox-icedtea-docker) with an old version of Firefox and an old version of Java to run an old Java applet to start a VPN. My image does work and successfully allows me to start the Java applet in Firefox.
Unfortunately, the said applet then tries to run the following command in the container (I've simply removed the --config part from the command as it does not matter here):
INFO: launching '/usr/bin/pkexec sh -c /usr/sbin/openvpn --config ...'
Then the applet exits silently with an error. While investigating, I've tried running a command with pkexec with the same Docker image, and it gives me this result:
$ sudo docker-compose run firefox pkexec /firefox/firefox-sdk/bin/firefox-bin -new-instance
**
ERROR:pkexec.c:719:main: assertion failed: (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject)) > 0)
But I don't know polkit at all and cannot understand this error.
EDIT: A more minimal way to reproduce the problem is with this Dockerfile:
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -y policykit-1
And then run:
$ sudo docker build -t pkexec-test .
$ sudo docker run pkexec-test pkexec echo Hello
Which leads here again to:
ERROR:pkexec.c:719:main: assertion failed: (polkit_unix_process_get_start_time (POLKIT_UNIX_PROCESS (subject)) > 0)
Should I conclude that pkexec cannot work in a docker container? Or is there any way to make this command work?
Sidenote: I have no control whatsoever on the Java applet that I try to run, it is a horrible and very dated proprietary black box that I am supposed to use at work, for which I have no access to the source code, and that I must use as is.
I have solved my own problem by replacing pkexec by sudo in the docker image, and by allowing passwordless sudo.
Given an ubuntu docker image where a user called developer was created and configured with a USER statement, add these lines:
# Install sudo and make 'developer' a passwordless sudoer
RUN apt-get install sudo
ADD ./developersudo /etc/sudoers.d/developersudo
# Replacing pkexec by sudo
RUN rm /usr/bin/pkexec
RUN ln -s /usr/bin/sudo /usr/bin/pkexec
with the file developersudo containing:
developer ALL=(ALL) NOPASSWD:ALL
This replaces any call to pkexec made in a process running in the container, by a call to sudo without any password prompt, which works nicely.

RStudio in docker image does not deal with some librairies

I have a problem to use the docker rstudio-image rocker/rstudio proposed
on https://www.rocker-project.org/ (docker containers for R). Since I am a beginner with both docker and RStudio, I suspect the problem comes from me and does not deserve a bug report:
I open a proper terminal with 'Docker Quickstart Terminal'
where I run the image with docker run -d -p 8787:8787 -e DISABLE_AUTH=true -v <...>:/home/rstudio/<...> --name rstudio rocker/rstudio
in my browser I then get a nice RStudio instance at the address http://192.168.99.100:8787
but in this instance I can't install several packages such as xml2. I get the message:
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
* deb: libxml2-dev (Debian, Ubuntu, etc)
* rpm: libxml2-devel (Fedora, CentOS, RHEL)
* csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/usr/local/lib/R/site-library/xml2’
Warning in install.packages :
installation of package ‘xml2’ had non-zero exit status
I don't know whether xml2 is on the image but the file libxml-2.0.pc does exist on my laptop in the directory /opt/local/lib/pkgconfig and pkg-config is in /opt/local/bin. So I tried linking these pkg paths when running
the image (to see what happen when I play with the image environment
in RStudio), adding options -v
/opt/local/lib/pkgconfig:/home/rstudio/lib/pkgconfig -v
/opt/local/bin:/home/rstudio/bin to the run command. But it doesn't work: for some reason
I don't see the content of lib/pkgconfig in RStudio...
Also the RStudio instance does not accept root/sudo commands so I can't
use tools such as apt-get in the RStudio terminal
so, what's the trick ?
Libraries on your laptop (the host for docker) are not available for docker containers. You should create a custom image with required libraries, create a Dockerfile like this:
FROM rocker/rstudio
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libxml2-dev # add any additional libraries you need
CMD ["/init"]
Above I added the libxml2-dev but you can add as many libraries as you need.
Then build your image using this command (you need to execute below command in directory there you created Dockerfile):
docker build -t my_rstudio:0.1 .
Then you can start your container:
docker run -d -p 8787:8787 -e DISABLE_AUTH=true --name rstudio my_rstudio:0.1
(you can add any additional arguments like -v to above).

Resources