FROM nvidia/cudagl:11.4.0-base

ENV PYTHON_VERSION="3.9"
ENV CU_VERSION="11.4"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/work/mujoco-py/mujoco_py/binaries/linux/mujoco210/bin"
ENV TAR_OPTIONS="--no-same-owner"
ENV DEBIAN_FRONTEND=noninteractive

# ================================
# SETUP ENV.sh
# From https://github.com/pytorch/rl/blob/main/.github/unittest/linux_libs/scripts_gym/setup_env.sh
# ================================
# 1. Setup python
RUN apt-get update && apt-get install -y git wget gcc g++ curl\
    python3.9 python3.9-distutils python3.9-venv python3.9-dev libglib2.0-0 \ 
    && update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 \
    && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ 
    && python3.9 get-pip.py \
    && update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3 1 \ 
    && rm get-pip.py 

# ENV NVIDIA_PATH=/usr/src/nvidia-470.63.01 
RUN python -m pip install matplotlib wandb exprnames addict einops \ 
    tqdm termcolor scikit-image scikit-learn

# New installations Notes --- 
RUN apt update && apt-get install -y build-essential texinfo cmake make flex bison zip
RUN wget https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.23.tar.xz && tar -xvf gengetopt-2.23.tar.xz && cd gengetopt-2.23 && ./configure && make && make install


# Install GCC10 & G++10
RUN apt update && \
    apt install -y gcc-10 g++-10 && \
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 && \
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 && \
    update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && \
    update-alternatives --set cc /usr/bin/gcc && \
    update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && \
    update-alternatives --set c++ /usr/bin/g++

RUN pip install torch transformers ratelimit openai anthropic 
RUN pip install "alfworld[full]"
RUN pip install tiktoken
ENV ALFWORLD_DATA="/data/"
RUN alfworld-download
RUN apt-get install -y tmux
ENV PYTHONPATH="/workspace/taxonomy_llm"

RUN apt install -y default-jre default-jdk

RUN pip install bs4 tiktoken


