FROM amazonlinux:2 LABEL description="Base container for Inferentia1 models" ENV PYTHONUNBUFFERED=TRUE ENV PYTHONDONTWRITEBYTECODE=TRUE ADD ./1-build/etc /etc RUN echo -e '[neuron]\nname=Neuron YUM Repository\nbaseurl=https://yum.repos.neuron.amazonaws.com\nenabled=1\nmetadata_expire=0\n' >> /etc/yum.repos.d/neuron.repo RUN rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB RUN yum update -y && \ yum install -y python3 python3-devel gcc-c++ && \ yum install -y tar gzip ca-certificates procps net-tools which vim wget libgomp htop jq bind-utils bc pciutils && \ yum install -y aws-neuronx-tools-2.* RUN yum install -y aws-neuronx-collectives-2.* && \ yum install -y aws-neuronx-runtime-lib-2.* RUN pip3 install --upgrade --force-reinstall --no-cache-dir neuronx-cc[tensorflow] torch-neuronx transformers==4.2.0 --extra-index-url=https://pip.repos.neuron.amazonaws.com RUN pip3 install --no-cache-dir torchserve==0.3.0 torch-model-archiver==0.3.0 configparser RUN alternatives --install /usr/bin/python python /usr/bin/python3 1; alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 RUN echo "export PATH=/opt/aws/neuron/bin:$PATH" >> /root/.bashrc RUN echo "alias ll='ls -alh --color=auto'" >> /root/.bashrc ADD ./1-build/*.py /app/