Convert from docker container to singularity introduces error

256 views
Skip to first unread message

Maurice Manning

unread,
Apr 5, 2018, 9:27:59 AM4/5/18
to singularity
Hello 
Ran into an issue with converting a Docker container containing Photoscan into a Singularity container. When I run the Docker container with a basic Photoscan command it notifies me that I don't have a license (expected) then exits. Then I push this build to docker hub and pull into a Singularity container. When I run the same command on the Singularity container I get local encoding errors.

Working as expected with Docker:
vagrant@vagrant:~/photoscan13-containerized$ docker run -v /home/vagrant/:/opt  -it  photoscan13 /usr/local/photoscan-pro/photoscan.sh -r /opt/ps.py
No license found.
Details: No license for product (-1)
vagrant@vagrant:~/photoscan13-containerized$ docker tag photoscan13:latest mmmanning/photoscan13:latest

New errors when run as Singularity:
vagrant@vagrant:~/photoscan13-containerized$ singularity exec -B /home/vagrant/:/opt/ photoscan13-latest.img /usr/local/photoscan-pro/photoscan.sh -r /opt/ps.py
No license found.
Details: No license for product (-1)
Can't load geoid: /usr/local/photoscan-pro/geoids/egm96-15.tif
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007f407236b7c0 (most recent call first):

(process:29277): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Aborted (core dumped)
vagrant@vagrant:~/photoscan13-containerized$

 My Dockerfile:


##
## Dockerfile for photoscan13
##


FROM ubuntu:xenial
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y software-properties-common libglib2.0 libqt5gui5 libgtk2.0-0 libglu1-mesa libgomp1 zlib1g && \
apt-get install -y language-pack-en language-pack-en-base wget vim
## install Agisoft Photoscan 1.3
RUN wget --directory-prefix=/usr/local http://download.agisoft.com/photoscan-pro_1_3_0_amd64.tar.gz ;\
(cd /usr/local && tar zxvf photoscan-pro_1_3_0_amd64.tar.gz) ;\
(cd /usr/local/bin && ln -s ../photoscan-pro/photoscan-pro.sh) ;\
rm -f /usr/local/photoscan-pro_1_3_0_amd64.tar.gz ;\
dpkg-reconfigure locales ;\
chmod 755 /usr/local//photoscan-pro/ ;\
chmod 755 /usr/local//photoscan-pro/*

CMD ["bash"]


My build process:
git clone https://github.com/mauricemanning/photoscan13-containerized
cd photoscan13-containerized
docker build --rm --tag photoscan13 .
docker tag photoscan13:latest mmmanning/photoscan13:latest
docker push mmmanning/photoscan13:latest
docker images
singularity pull docker://mmmanning/photoscan13:latest


Thanks for an ideas.
Maurice


David Trudgian

unread,
Apr 5, 2018, 1:44:55 PM4/5/18
to singu...@lbl.gov
Hi Maurice,

I just tried to reproduce by pulling your docker image, but if I call the .sh I get something different:

```
$ singularity exec photoscan13-latest.simg /usr/local/photoscan-pro/photoscan.sh
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
```

Is any part of this related to what you are binding in to /opt in your example?

Thanks,

DT


--
You received this message because you are subscribed to the Google Groups "singularity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to singularity+unsubscribe@lbl.gov.

Maurice Manning

unread,
Apr 5, 2018, 8:51:47 PM4/5/18
to singularity
Hi David
that error is because you are in headless mode. when running in batch/command line mode you need to provide a script with the '-r' param so that it does not try to launch the gui. To just ping the exec try:

vagrant@vagrant:~/photoscan13-containerized$ singularity exec photoscan13-latest.img /usr/local/photoscan-pro/photoscan.sh --help

Agisoft PhotoScan Professional version 1.3.0 build 3772 (64 bit)

Usage: photoscan [project] [flags]



To unsubscribe from this group and stop receiving emails from it, send an email to singularity...@lbl.gov.

David Trudgian

unread,
Apr 11, 2018, 9:46:51 PM4/11/18
to singularity
Hi Maurice,

I do get the help message if i run like that, but it doesn't throw the locale error you see:

dave@spongebob:~
08:42 PM $ singularity exec photoscan13-latest.simg /usr/local/photoscan-pro/photoscan.sh --help
Agisoft PhotoScan Professional version 1.4.1 build 5925 (64 bit)
Usage: photoscan [project] [flags]

Do you have an example script I can try and run, if I create an empty python script with nothing really in it I'm still getting the following, not a locale error:

singularity exec photoscan13-latest.simg /usr/local/photoscan-pro/photoscan.sh -r test.py

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
Aborted

Also, trying the interactive python option gives the same thing:

dave@spongebob:~
08:42 PM $ singularity exec photoscan13-latest.simg /usr/local/photoscan-pro/photoscan.sh -i

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
Aborted

Cheers,

DT
Reply all
Reply to author
Forward
0 new messages