LSST v14 Docker image -- can not sudo

Hi,

On the LSST v13 Docker image I was able to become root using sudo in order to install additional software. I used this to build an image containing lsst_sims on top of the base image. However it seems in the v14 Docker image (lsstsqre/centos:7-stack-lsst_distrib-v14_0) I cannot do this - sudo now asks for a password. Is it still possible to become root somehow in the new version of the image?

Thanks,
James

There are a couple of generic options, applicable to any docker image/container:

  • Creating a new image based upon lsstsqre/centos:7-stack-lsst_distrib-v14_0. This is the standard docker-ish workflow and my recommendation Eg.
 cat <<'END' > Dockerfile
FROM docker.io/lsstsqre/centos:7-stack-lsst_distrib-v14_0

USER root

# install an rpm
RUN yum install -y ImageMagick && yum clean -y all

# automatically source a script -- Eg., setup the lsst/eups env
RUN echo "source /opt/lsst/software/stack/loadLSST.bash" >> /etc/profile.d/lsst.sh

USER lsst
END
docker build -t mylsst .
docker run -ti mylsst
  • Entering into a running container as root. Eg.,
$ docker ps --filter ancestor=mylsst
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
76346c34d806        mylsst              "/bin/bash"         About a minute ago   Up About a minute                       reverent_goodall
$ docker exec -ti --user root 76346c34d806 bash
Creating user data directory: /root/.eups
[root@76346c34d806 stack]# whoami
root

Thanks, your first suggestion has solved the problem I was having.

I’m now having a problem when trying to install lsst_sims (“Product lsst_sims sims not found in any package repository”) but I don’t think this is anything to do with Docker.

Hello James, have succeeded installing lsst_sims in the lsst_v14 docker container? I am also having trouble install lsst_sims.

Thanks

Hi, I couldn’t get it to install on top of the v14 container. I think maybe the installation method used in the container is not compatible with lsst_sims. I started from scratch and built my own lsst v14 container instead. I was then able to start the lsst_sims installation, but I have since run into a different problem (the python 0.0.7 package installed as part of lsst_sims requires Python 3.6 but the newinstall.sh script installs 3.5). I am going to look into the problem further today.

I have installed the latest available weekly of lsst_distrib, namely w_2017_48 from source and I get Python v3.6.2 installed:

$ source loadLSST.bash 
$ python --version
Python 3.6.2 :: Continuum Analytics, Inc.

For my installations I always use the version of newinstall.sh in the master branch, i.e. https://raw.githubusercontent.com/lsst/lsst/master/scripts/newinstall.sh.

However, I have not installed lsst_sims, so this suggestion may not solve your issue.

Thanks for the hint. I will give the master version a try instead of v14.

v14.0 comes with a newinstall.sh that installed 3.5 because it was tested on 3.5. Following v14.0 we switched the minimum python version to 3.6 and the master newinstall.sh installs that version. Fundamentally, you can’t mix a modern sims release with the older DM v14.0 release.