|
| 1 | +FROM ubuntu:23.10 |
| 2 | + |
| 3 | +MAINTAINER Darrell Ricke < [email protected]> |
| 4 | + |
| 5 | +################################################################################ |
| 6 | +# Author: Darrell O. Ricke, Ph.D. (email: [email protected]) |
| 7 | +# |
| 8 | +# RAMS request ID 1026639 |
| 9 | +# |
| 10 | +# DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited. |
| 11 | +# This material is based upon work supported by the Department of the Air Force |
| 12 | +# under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, |
| 13 | +# conclusions or recommendations expressed in this material are those of the |
| 14 | +# author(s) and do not necessarily reflect the views of the Department of the |
| 15 | +# Air Force. |
| 16 | +# |
| 17 | +# © 2024 Massachusetts Institute of Technology. |
| 18 | +# |
| 19 | +# The software/firmware is provided to you on an As-ls basis |
| 20 | +# Delivered to the U.S. Government with Unlimited Rights, as defined in |
| 21 | +# DFARS Part 252.227-7013 or 7014 (Feb 2014). Notwithstanding any copyright |
| 22 | +# notice, U.S. Government rights in this work are defined by DFARS 252.227-7013 |
| 23 | +# or DFARS 252.227-7014 as detailed above. Use of this work other than as |
| 24 | +# specifically authorized by the U.S. Government may violate any copyrights that |
| 25 | +# exist in this work. |
| 26 | +# |
| 27 | +# This program is free software: you can redistribute it and/or modify |
| 28 | +# it under the terms of the GNU General Public License as published by |
| 29 | +# the Free Software Foundation, either version 2 of the License, or |
| 30 | +# (at your option) any later version. |
| 31 | +# |
| 32 | +# This program is distributed in the hope that it will be useful, |
| 33 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 34 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 35 | +# GNU General Public License for more details. |
| 36 | +################################################################################ |
| 37 | + |
| 38 | +ENV http_proxy="http://llproxy.llan.ll.mit.edu:8080" |
| 39 | +ENV https_proxy="http://llproxy.llan.ll.mit.edu:8080" |
| 40 | +ENV ftp_proxy="http://llproxy.llan.ll.mit.edu:8080" |
| 41 | +ENV no_proxy=.ll.mit.edu,.mit.edu,localhost,127.0.0.1 |
| 42 | +COPY dependencies/apt.conf /etc/apt/apt.conf |
| 43 | + |
| 44 | +ENV LC_ALL en_US.UTF-8 |
| 45 | +ENV LANG en_US.UTF-8 |
| 46 | + |
| 47 | +RUN apt-get update && apt-get install -y build-essential coreutils \ |
| 48 | + wget bzip2 git g++ gfortran libreadline6-dev libncurses5-dev xorg-dev libpng-dev libbz2-dev \ |
| 49 | + liblzma-dev libpcre3-dev make libcairo2-dev libgtk2.0-dev \ |
| 50 | + locales libcurl4-nss-dev \ |
| 51 | + language-pack-en language-pack-en-base \ |
| 52 | + git curl unzip bc tabix \ |
| 53 | + libssl-dev libgit2-dev libssh2-1-dev \ |
| 54 | + gcc zip \ |
| 55 | + python3.11 gcc zip python3-dev \ |
| 56 | + zlib1g-dev libbz2-dev liblzma-dev pigz libncurses5-dev \ |
| 57 | + libreadline-dev \ |
| 58 | + openssl \ |
| 59 | + gnupg2 \ |
| 60 | + libmysqlclient-dev \ |
| 61 | + nodejs \ |
| 62 | + sqlite3 \ |
| 63 | + ruby-full rubygems vim libyaml-dev libsqlite3-dev |
| 64 | + |
| 65 | +RUN mkdir /S |
| 66 | + |
| 67 | +RUN gem install bundler \ |
| 68 | + && gem install mysql2 \ |
| 69 | + && gem install sqlite3 \ |
| 70 | + && gem install rake \ |
| 71 | + && gem install tzinfo-data \ |
| 72 | + && gem install rails |
| 73 | + |
| 74 | +WORKDIR /S |
| 75 | +RUN curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py \ |
| 76 | + && python3 get-pip.py |
| 77 | + |
| 78 | +COPY dependencies/wgetrc /etc |
| 79 | +WORKDIR /S |
| 80 | +RUN cd /S && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /S/miniconda.sh |
| 81 | +RUN bash /S/miniconda.sh -b -p /S/miniconda/ |
| 82 | +ENV PATH="/S/miniconda/bin/:$PATH" |
| 83 | +RUN export PATH="/S/miniconda/bin/:$PATH" |
| 84 | + |
| 85 | +RUN conda create -n llama2 |
| 86 | +RUN conda init bash |
| 87 | +# RUN conda activate llama2 |
| 88 | +COPY dependencies/llms_requirements.txt /S |
| 89 | +RUN pip install -r llms_requirements.txt \ |
| 90 | + && pip install llama-cpp-python \ |
| 91 | + && pip install fastapi uvicorn sse-starlette requests \ |
| 92 | + && pip install transformers \ |
| 93 | + && pip install gradio \ |
| 94 | + && pip install langchain \ |
| 95 | + && pip install "langserve[all]" \ |
| 96 | + && pip install langchain_openai \ |
| 97 | + && pip install langchainhub \ |
| 98 | + && pip install langgraph \ |
| 99 | + && pip install scipy \ |
| 100 | + && pip install einops \ |
| 101 | + && pip install bitsandbytes \ |
| 102 | + && pip install accelerate |
| 103 | + |
| 104 | +RUN git clone https://github.com/facebookresearch/llama.git |
| 105 | +WORKDIR /S/llama |
| 106 | +RUN pip install . |
| 107 | +WORKDIR /S |
| 108 | +RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ |
| 109 | + && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ |
| 110 | + sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ |
| 111 | + tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ |
| 112 | + && \ |
| 113 | + apt-get update |
| 114 | +RUN apt-get install -y nvidia-container-toolkit |
| 115 | + |
| 116 | +ENV HF_HOME=/io |
| 117 | +ENV HF_HUB_CACHE=/io/hub |
| 118 | +ENV HF_ASSETS_CACHE=/io/assets |
| 119 | + |
| 120 | +# Crystal LLM is being released: |
| 121 | +# COPY crystal_llm.tar /S |
| 122 | +# WORKDIR /S |
| 123 | +# RUN tar -xf crystal_llm.tar |
| 124 | +# WORKDIR /S/crystal_llm |
| 125 | +# RUN bundle update |
| 126 | + |
| 127 | +WORKDIR /io |
| 128 | + |
| 129 | +COPY dependencies/entrypoint.sh /usr/bin |
| 130 | +RUN chmod +x /usr/bin/entrypoint.sh |
| 131 | +ENTRYPOINT ["entrypoint.sh"] |
| 132 | +EXPOSE 3000 |
| 133 | +EXPOSE 7860 |
| 134 | +EXPOSE 8888 |
0 commit comments