Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singularity container cannot find files after being created from a Docker image #2499

Closed
Deepakgthomas opened this issue Jan 8, 2024 · 0 comments

Comments

@Deepakgthomas
Copy link

Version of Apptainer

What version of Apptainer (or Singularity) are you using? Run

apptainer --version (or singularity --version).

singularity-ce version 4.0.2

Description of issue
I have posted the same question on SO too - https://stackoverflow.com/questions/77781660/singularity-container-cannot-find-files-after-being-created-from-a-docker-image

I am creating a Singularity container from a Docker image. However, the Singularity container gives me errors that weren't present while I used Docker.

This is how I create my Docker image -

FROM ubuntu:22.04

WORKDIR /app

SHELL ["/bin/bash", "-c"] 

RUN echo "Hello World!"
RUN apt-get update && apt-get install -y \
    libosmesa6-dev \
    sudo \
    wget \
    curl \
    unzip \
    gcc \
    g++ \
    &&  apt-get install \
    libosmesa6-dev \
    && rm -rf /var/lib/apt/lists/*
    
ENV DEBIAN_FRONTEND=noninteractive

ENV PATH="/miniconda3/bin:${PATH}"
ARG PATH="/miniconda3/bin:${PATH}"
RUN cd / \
    && mkdir -p /miniconda3 \
    && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /miniconda3/miniconda.sh \
    && bash /miniconda3/miniconda.sh -b -u -p /miniconda3 \
    && /miniconda3/bin/conda init bash \
    && source ~/.bashrc \
    && conda init \
    && conda create -y -n myenv python=3.8 \
    && conda update -y conda
    
WORKDIR /~
RUN wget https://roboti.us/download/mjpro150_linux.zip \
    && unzip mjpro150_linux.zip \
    && mkdir ~/.mujoco \
    && mv mjpro150 ~/.mujoco \
    && wget https://roboti.us/file/mjkey.txt \
    && mv mjkey.txt ~/.mujoco \
    && rm mjpro150_linux.zip


RUN cd /miniconda3/envs/myenv/lib/ && mv libstdc++.so.6 libstdc++.so.6.old && ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6
SHELL ["conda", "run", "-n", "myenv", "/bin/bash", "-c"]
EXPOSE 5003


RUN pip install --no-cache-dir "Cython<3" \
    && pip install mujoco-py==1.50.1.0 \
    && pip install gym

This is how I build, run and test my Docker image -

docker build -t dockercontainer:latest .
docker run -it dockercontainer:latest 

Once inside the container -

conda run -n myenv python -c"import gym; gym.make('Humanoid-v3')"

This works (except for a few warnings).

Then, I build a Singularity container from the Docker image -

singularity build singularity_container.sif docker-daemon://dockercontainer:latest

This is how I run the Singularity container -

singularity exec singularity_container.sif/ conda run -n myenv python -c"import gym; gym.make('Humanoid-v3')"

But then I get this error over here -

File "/home/thoma/.local/lib/python3.8/site-packages/mujoco_py/config.py", line 37, in init_config
    raise error.MujocoDependencyError('Found your MuJoCo license key but not binaries. Please put your binaries into ~/.mujoco/mjpro131 or set MUJOCO_PY_MJPRO_PATH. Follow the instructions on https://github.com/openai/mujoco-py for setup.')
mujoco_py.error.MujocoDependencyError: Found your MuJoCo license key but not binaries. Please put your binaries into ~/.mujoco/mjpro131 or set MUJOCO_PY_MJPRO_PATH. Follow the instructions on https://github.com/openai/mujoco-py for setup.

ERROR conda.cli.main_run:execute(124): `conda run python -cimport gym; gym.make('Humanoid-v3')` failed. (See above for error)

What OS/distro are you running

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

How did you install Apptainer

I installed Singularity. I followed the documentation given over here - https://docs.sylabs.io/guides/3.0/user-guide/installation.html

@sylabs sylabs locked and limited conversation to collaborators Jan 8, 2024
@dtrudg dtrudg converted this issue into discussion #2500 Jan 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant