-
Notifications
You must be signed in to change notification settings - Fork 401
Update Dockerfile and its README #1098
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,48 +12,44 @@ | |
|
||
# Dockerfile for OpenFermion, Cirq, and select plugins. | ||
|
||
FROM ubuntu | ||
|
||
USER root | ||
|
||
RUN apt-get update | ||
|
||
# Install utilities | ||
RUN apt-get install -y bzip2 | ||
RUN apt-get install -y cmake | ||
RUN apt-get install -y git | ||
RUN apt-get install -y wget | ||
RUN apt-get install -y libblas-dev | ||
RUN apt-get install -y liblapack-dev | ||
|
||
# Install Python 3 | ||
RUN apt-get install -y python3 | ||
|
||
# Install pip. | ||
RUN apt-get install -y python3-pip | ||
|
||
# Install Psi4. | ||
RUN cd /root; wget http://vergil.chemistry.gatech.edu/psicode-download/psi4conda-1.2.1-py36-Linux-x86_64.sh | ||
RUN echo '/root/psi4conda' | bash /root/psi4conda-1.2.1-py36-Linux-x86_64.sh | ||
RUN rm /root/psi4conda-1.2.1-py36-Linux-x86_64.sh | ||
RUN export PATH=/root/psi4conda/bin:$PATH | ||
|
||
# Install PySCF. | ||
RUN cd /root; git clone https://github.com/sunqm/pyscf | ||
RUN cd /root/pyscf/pyscf/lib; mkdir build; cd build; cmake ..; make | ||
|
||
# Install OpenFermion, Cirq, and plugins. | ||
RUN pip3 install openfermion | ||
RUN pip3 install cirq | ||
RUN pip3 install openfermioncirq | ||
RUN pip3 install openfermionpsi4 | ||
RUN pip3 install openfermionpyscf | ||
|
||
# Update paths | ||
RUN export PATH=/root/psi4conda/bin:$PATH | ||
RUN export PYTHONPATH=/root/pyscf:$PYTHONPATH | ||
|
||
# Make python point to python3 | ||
RUN ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
ENTRYPOINT bash | ||
FROM ubuntu:22.04 | ||
|
||
|
||
WORKDIR /root/workspace | ||
COPY . /root/workspace | ||
|
||
# Set PATH for miniforge | ||
ENV PATH="/root/conda/bin:${PATH}" | ||
# Set PATH for pyscf | ||
ENV PYTHONPATH=/root/pyscf | ||
|
||
RUN apt-get update && \ | ||
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For DL3009, I will add a configuration setting to For DL3015, go ahead and add the recommended For DL3008, we should probably pin the versions, although there are pros and cons to doing that. One way to find out the versions that can be used is to do roughly the following:
I don't know if it's possible with |
||
apt-get install -y --no-install-recommends bzip2=1.0.8-5build1 \ | ||
cmake=3.22.1-1ubuntu1.22.04.2 \ | ||
git=1:2.34.1-1ubuntu1.15 \ | ||
wget=1.21.2-2ubuntu1.1 \ | ||
libblas-dev=3.10.0-2ubuntu1 \ | ||
liblapack-dev=3.10.0-2ubuntu1 \ | ||
# in order to verify github's certificate | ||
ca-certificates=20240203~22.04.1 \ | ||
build-essential=12.9ubuntu3 | ||
|
||
# Install miniforge https://github.com/conda-forge/miniforge?tab=readme-ov-file#as-part-of-a-ci-pipeline | ||
RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/download/25.3.1-0/Miniforge3-25.3.1-0-$(uname)-$(uname -m).sh" && \ | ||
bash Miniforge3.sh -b -p "${HOME}/conda" && \ | ||
conda init bash && \ | ||
conda update -n base -c conda-forge conda && \ | ||
# Create virtual env (fermion) with installing Psi4 | ||
conda create -n fermion psi4 python=3.12 -c conda-forge -y && \ | ||
conda install -n fermion pip -y && \ | ||
# Install OpenFermion, Cirq, and plugins | ||
conda run -n fermion pip install openfermion \ cirq \ openfermioncirq \ openfermionpsi4 \ openfermionpyscf | ||
Comment on lines
+37
to
+45
Check warningCode scanning / Scorecard Pinned-Dependencies Medium
score is 3: downloadThenRun not pinned by hash
Click Remediation section below to solve this issue |
||
|
||
# Install PySCF | ||
WORKDIR /root | ||
RUN git clone https://github.com/sunqm/pyscf | ||
WORKDIR /root/pyscf/pyscf/lib/build | ||
RUN cmake .. && \ | ||
make | ||
|
||
# Activate venv (fermion) | ||
RUN echo "conda activate fermion" >> ~/.bashrc |
Uh oh!
There was an error while loading. Please reload this page.