Skip to content

Commit

Permalink
permissions, namd opts
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwoods2 committed Dec 17, 2024
1 parent ab3f82e commit 79118cc
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 38 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
arch: [amd64]
build: ["Common-CPU", "Common-GPU"]
build: ["common-cpu", "common-gpu"]

permissions:
contents: read
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Option
id: option
run: |
if [ "${{ matrix.build }}" == "Common-CPU" ]; then
if [ "${{ matrix.build }}" == "common-cpu" ]; then
echo GMX_OPTS= >> $GITHUB_ENV
echo LMP_OPTS= >> $GITHUB_ENV
echo NAMD_OPTS= >> $GITHUB_ENV
Expand All @@ -46,19 +46,19 @@ jobs:
echo DOCKERFILE="GPU.Dockerfile" >> $GITHUB_ENV
fi
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./docker/common
push: false
file: ./docker/common/${{ env.DOCKERFILE }}
build-args: |
GMX_OPTS="${{ env.GMX_OPTS }}"
LMP_OPTS="${{ env.LMP_OPTS }}"
CUDA_VER=12.4.1
DISTRO_ARCH=${{ matrix.arch }}
DISTRO_VER=22.04
DISTRO_NAME=ubuntu
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./docker/common
# push: false
# file: ./docker/common/${{ env.DOCKERFILE }}
# build-args: |
# GMX_OPTS="${{ env.GMX_OPTS }}"
# LMP_OPTS="${{ env.LMP_OPTS }}"
# CUDA_VER=12.4.1
# DISTRO_ARCH=${{ matrix.arch }}
# DISTRO_VER=22.04
# DISTRO_NAME=ubuntu

- name: Build and push private NAMD Docker image
uses: docker/build-push-action@v5
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/deploy_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
arch: [amd64]
build: ["Common-CPU", "Common-GPU"]
build: ["common-cpu", "common-gpu"]

permissions:
contents: read
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Option
id: option
run: |
if [ "${{ matrix.build }}" == "Common-CPU" ]; then
if [ "${{ matrix.build }}" == "common-cpu" ]; then
echo GMX_OPTS= >> $GITHUB_ENV
echo LMP_OPTS= >> $GITHUB_ENV
echo NAMD_OPTS= >> $GITHUB_ENV
Expand All @@ -65,29 +65,29 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./docker/common
file: ./docker/common/${{ env.DOCKERFILE }}
push: true
tags: ${{ steps.meta.outputs.tags }}-${{ matrix.build }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GMX_OPTS="${{ env.GMX_OPTS }}"
LMP_OPTS="${{ env.LMP_OPTS }}"
CUDA_VER=12.4.1
DISTRO_ARCH=${{ matrix.arch }}
DISTRO_VER=22.04
DISTRO_NAME=ubuntu
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# context: ./docker/common
# file: ./docker/common/${{ env.DOCKERFILE }}
# push: true
# tags: ${{ steps.meta.outputs.tags }}-${{ matrix.build }}
# labels: ${{ steps.meta.outputs.labels }}
# build-args: |
# GMX_OPTS="${{ env.GMX_OPTS }}"
# LMP_OPTS="${{ env.LMP_OPTS }}"
# CUDA_VER=12.4.1
# DISTRO_ARCH=${{ matrix.arch }}
# DISTRO_VER=22.04
# DISTRO_NAME=ubuntu

- name: Build and push private NAMD Docker image
uses: docker/build-push-action@v5
with:
context: ./docker/namd
file: ./docker/namd/${{ env.DOCKERFILE }}
push: false
tags: ${{ steps.meta.outputs.tags }}-${{ matrix.build }}
push: true
tags: ghcr.io/becksteinlab/streaming-namd-docker:main-${{ matrix.build }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
NAMD_OPTS="${{ env.NAMD_OPTS }}"
Expand Down
1 change: 1 addition & 0 deletions docker/namd/CPU.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ ARG NAMD_OPTS=""

COPY . .
RUN . /opt/conda/etc/profile.d/conda.sh && conda env create --file env.yaml
RUN chmod +x install_namd.sh
RUN --mount=type=secret,id=NAMD_ACCESS_TOKEN \
. /opt/conda/etc/profile.d/conda.sh && conda activate env && ./install_namd.sh "$NAMD_OPTS"

Expand Down
1 change: 1 addition & 0 deletions docker/namd/GPU.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ ARG NAMD_OPTS=""

COPY . .
RUN . /opt/conda/etc/profile.d/conda.sh && conda env create --file env.yaml
RUN chmod +x install_namd.sh
RUN --mount=type=secret,id=NAMD_ACCESS_TOKEN \
. /opt/conda/etc/profile.d/conda.sh && conda activate env && ./install_namd.sh "$NAMD_OPTS"

Expand Down
15 changes: 11 additions & 4 deletions docker/namd/install_namd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export HOME_DIR=${PWD}
# set include path to conda
# export CPATH=${CONDA_PREFIX}/include
# # set linker path to conda libs
export LIBRARY_PATH=${CONDA_PREFIX}/lib
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib
export LIBRARY_PATH=${CONDA_PREFIX}/lib:/usr/local/cuda/lib64
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:/usr/local/cuda/lib64
export NPROC=$(nproc)

# Setup NAMD
Expand All @@ -15,9 +15,16 @@ cd namd
git checkout IMDv3-dev
tar xf charm-8.0.0.tar
cd charm-8.0.0
./build charm++ multicore-linux-x86_64 -j ${NPROC} --with-production --libdir=${CONDA_PREFIX}/lib --incdir=${CONDA_PREFIX}/include
./build charm++ multicore-linux-x86_64 -j ${NPROC} \
--with-production
cd ../
./config Linux-x86_64-g++ $(echo ${1} | sed 's/"//g') --charm-arch multicore-linux-x86_64 --with-fftw3 --tcl-prefix ${CONDA_PREFIX} --cxx-opts -L${CONDA_PREFIX}/lib --cc-opts -L${CONDA_PREFIX}/lib
./config Linux-x86_64-g++ $(echo ${1} | sed 's/"//g') \
--charm-arch multicore-linux-x86_64 --with-fftw3 \
--tcl-prefix ${CONDA_PREFIX} \
--cxx-opts="-I/usr/local/cuda/include -I${CONDA_PREFIX}/include -L/usr/local/cuda/lib64 -L${CONDA_PREFIX}/lib" \
--cc-opts="-I/usr/local/cuda/include -I${CONDA_PREFIX}/include -L/usr/local/cuda/lib64 -L${CONDA_PREFIX}/lib" \
--cuda-prefix /usr/local/cuda

cd Linux-x86_64-g++
make -j ${NPROC}

Expand Down

0 comments on commit 79118cc

Please sign in to comment.