Skip to content

Commit

Permalink
feat: add GSAS image and instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 6, 2024
1 parent da59622 commit 088cef6
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
49 changes: 49 additions & 0 deletions containers/gsas/Containerfile-conda
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM fedora

RUN dnf install -y wget \
bzip2 \
subversion \
libXxf86vm \
mesa-libGL \
mesa-libGLU
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh

RUN bash /tmp/miniconda.sh -b -p /opt/miniconda

ENV PATH="/opt/miniconda/bin:$PATH"
ENV g2home=/GSASII

RUN conda create -n GSASII python=3.10 \
wxpython=4.2 \
numpy=1.23 \
scipy matplotlib \
pyopengl \
pillow \
h5py \
imageio \
conda \
subversion \
requests \
bluesky \
-c conda-forge -y

RUN mkdir -p ${g2home}
WORKDIR ${g2home}
RUN svn export https://subversion.xray.aps.anl.gov/pyGSAS/install/bootstrap.py $g2home
RUN conda run -n GSASII python bootstrap.py
RUN conda init

RUN conda run -n GSASII python -m pip install 'bluesky-adaptive[all]'
RUN conda run -n GSASII python -m pip install nslsii

RUN mkdir -p /src/pdf-agents
COPY pdf_agents /src/pdf-agents/pdf_agents

ENV PYTHONPATH=${g2home}/GSASII:/src/pdf-agents:$PYTHONPATH

# Cleanup
RUN dnf clean all\
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/.cache/pip/* \
&& rm -rf /tmp/*
RUN conda run -n GSASII conda clean -y --all
14 changes: 14 additions & 0 deletions containers/gsas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# GSAS Image

Fedora based image that contains gsas, python3, bluesky, and bluesky-adaptive.
Primarily for gsas agent.

We had to use the conda install because the pure Fedora and Ubuntu image ran into issues with the GSASII install from pip and package managers.


```bash
cd /path/to/pdf-agents
curl https://subversion.xray.aps.anl.gov/admin_pyGSAS/downloads/gsas2full-Latest-Linux-x86_64.sh > ./containers/gsas/gsas2full-Latest-Linux-x86_64.sh
podman build --platform linux/amd64 -t gsas:conda -f containers/gsas/Containerfile-conda .
podman run -it --rm gsas:conda conda run -n GSASII --no-capture-output ipython
```

0 comments on commit 088cef6

Please sign in to comment.