Skip to content

Commit 903d58a

Browse files
authored
Merge pull request #46 from aws-solutions-library-samples/v1.13.2
V1.13.2
2 parents 3a8be35 + 9700f79 commit 903d58a

File tree

10 files changed

+64
-45
lines changed

10 files changed

+64
-45
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10-
## [1.13.2] - 2025-06-10
10+
## [1.13.2] - 2025-09-10
1111

1212
### 1.13.2 Fixed
1313

1414
- Updated build artifact location
15+
- Fix issue limiting deployment to us-east-1 only
16+
- Update SageMaker notebook platform ID
17+
- Fix issue downloading ESMFold parameters
18+
- Fix multiple issues with ESMFold inference script
19+
- Fix issue with version of numpy in RFDiffusion ontainer
20+
1521

1622
---
1723

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# AWS Batch Architecture for Protein Folding and Design
22

3+
> [!IMPORTANT]
4+
> The examples provided in this repository are for experimental and educational purposes only. They demonstrate concepts and techniques but are not intended for direct use in production environments.
5+
6+
> [!IMPORTANT]
7+
> The CloudFormation templates included in this repository only support deployment to the us-east-1, and us-east-2, eu-west-1, eu-west-2, eu-central-1, and ap-southwest-1 regions. For additional options, please refer to the [Drug Discovery Workflows for AWS HealthOmics](https://github.com/aws-samples/drug-discovery-workflows) project.
8+
39
## Contents
410

511
1. [Overview](#1-overview)

infrastructure/cloudformation/batch-protein-folding-cfn-notebook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Resources:
123123
InstanceType: ml.t3.medium
124124
DefaultCodeRepository: !Ref CodeRepositoryURI
125125
KmsKeyId: !GetAtt EncryptionKey.Arn
126-
PlatformIdentifier: "notebook-al2-v2"
126+
PlatformIdentifier: "notebook-al2-v3"
127127
RoleArn: !GetAtt SageMakerNotebookExecutionRole.Arn
128128
SubnetId: !Ref Subnet
129129
SecurityGroupIds:

infrastructure/docker/alphafold2/Dockerfile

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ ARG ALPHAFOLD2_VERSION
1515
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1616

1717
RUN apt-get update \
18-
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
19-
build-essential \
20-
cmake \
21-
cuda-command-line-tools-$(cut -f1,2 -d- <<< ${CUDA//./-}) \
22-
git \
23-
hmmer \
24-
kalign \
25-
tzdata \
26-
wget \
27-
awscli \
18+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
19+
build-essential \
20+
cmake \
21+
cuda-command-line-tools-$(cut -f1,2 -d- <<< ${CUDA//./-}) \
22+
git \
23+
hmmer \
24+
kalign \
25+
tzdata \
26+
wget \
27+
awscli \
2828
&& rm -rf /var/lib/apt/lists/* \
2929
&& apt-get autoremove -y \
3030
&& apt-get clean
@@ -40,43 +40,39 @@ RUN git clone --branch v3.3.0 https://github.com/soedinglab/hh-suite.git /tmp/hh
4040
&& rm -rf /tmp/hh-suite
4141

4242
# Install Miniconda package manager.
43-
RUN wget -q -P /tmp \
44-
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
45-
&& bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \
46-
&& rm /tmp/Miniconda3-latest-Linux-x86_64.sh
43+
RUN wget -q -P /tmp \
44+
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" \
45+
&& bash /tmp/Miniforge3-Linux-x86_64.sh -b -p /opt/conda \
46+
&& rm /tmp/Miniforge3-Linux-x86_64.sh
4747

4848
# Install conda packages.
4949
ENV PATH="/opt/conda/bin:$PATH"
50-
# RUN conda install -qy conda==4.13.0
51-
# && conda install -y -c conda-forge
52-
RUN conda install -y -c conda-forge \
53-
openmm=7.5.1 \
54-
cudatoolkit=${CUDA_VERSION} \
55-
pdbfixer=1.7 \
56-
pip \
57-
python=3.9.16 \
50+
ENV LD_LIBRARY_PATH="/opt/conda/lib:$LD_LIBRARY_PATH"
51+
52+
RUN conda install --quiet --yes --channel conda-forge pip python=3.11 openmm=8.0.0 pdbfixer --override-channels \
53+
&& conda install --quiet --yes --channel nvidia cuda=${CUDA_VERSION} --override-channels \
5854
&& conda clean --all --force-pkgs-dirs --yes
5955

60-
RUN git clone --branch ${ALPHAFOLD2_VERSION} --depth 1 https://github.com/deepmind/alphafold.git /app/alphafold
56+
# RUN git clone --branch ${ALPHAFOLD2_VERSION} --depth 1 https://github.com/deepmind/alphafold.git /app/alphafold
57+
RUN git clone --depth 1 https://github.com/deepmind/alphafold.git /app/alphafold
6158

6259
RUN wget -q -P /app/alphafold/alphafold/common/ \
63-
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
60+
https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
6461

6562
# Install pip packages.
6663
RUN pip3 install --upgrade pip --no-cache-dir \
67-
&& pip3 install -r /app/alphafold/requirements.txt --no-cache-dir \
68-
&& pip3 install --upgrade --no-cache-dir \
69-
jax==0.3.25 \
70-
jaxlib==0.3.25+cuda11.cudnn805 \
71-
-f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
72-
73-
# Apply OpenMM patch.
74-
WORKDIR /opt/conda/lib/python3.9/site-packages
75-
RUN patch -p0 < /app/alphafold/docker/openmm.patch
64+
&& pip3 install -r /app/alphafold/requirements.txt --no-cache-dir \
65+
&& pip3 install --upgrade --no-cache-dir \
66+
jax==0.4.26 \
67+
jaxlib==0.4.26+cuda12.cudnn89 \
68+
-f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
7669

7770
# Add SETUID bit to the ldconfig binary so that non-root users can run it.
7871
RUN chmod u+s /sbin/ldconfig.real
7972

73+
# Currently needed to avoid undefined_symbol error.
74+
RUN ln -sf /usr/lib/x86_64-linux-gnu/libffi.so.7 /opt/conda/lib/libffi.so.7
75+
8076
# We need to run `ldconfig` first to ensure GPUs are visible, due to some quirk
8177
# with Debian. See https://github.com/NVIDIA/nvidia-docker/issues/1399 for
8278
# details.
@@ -85,8 +81,8 @@ RUN chmod u+s /sbin/ldconfig.real
8581
WORKDIR /app/alphafold
8682
COPY run.sh /app/alphafold/run.sh
8783
RUN echo $'#!/bin/bash\n\
88-
ldconfig\n\
89-
python /app/alphafold/run_alphafold.py "$@"' > /app/run_alphafold.sh \
84+
ldconfig\n\
85+
python /app/alphafold/run_alphafold.py "$@"' > /app/run_alphafold.sh \
9086
&& chmod +x /app/run_alphafold.sh /app/alphafold/run.sh
9187

9288
ENTRYPOINT ["bash", "/app/alphafold/run.sh"]

infrastructure/docker/download/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2
55
COPY scripts /scripts
66
RUN amazon-linux-extras install epel -y \
77
&& yum update -y \
8-
&& yum install aria2 tar rsync unzip -y \
8+
&& yum install aria2 tar rsync unzip git git-lfs -y \
99
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" \
1010
&& unzip awscliv2.zip \
1111
&& ./aws/install \
1212
&& chmod -R 755 /scripts
1313

14+
WORKDIR /home/scripts
15+
1416
ENTRYPOINT ["bash", "-c"]

infrastructure/docker/download/scripts/download_esmfold_params.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
# Original Copyright 2022 AlQuraishi Laboratory
4-
# Modifications Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
# Modifications Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77
# Downloads and unzips the ESMFold parameters.
@@ -19,9 +19,10 @@ ROOT_DIR="${DOWNLOAD_DIR}/esmfold_params/hub"
1919
SOURCE_URL="facebook/esmfold_v1"
2020

2121
git lfs install
22-
echo "Downloading ${SOURCE_URI} from Hugging Face Hub"
22+
echo "Downloading ${SOURCE_URL} from Hugging Face Hub"
2323
mkdir tmp
24-
git clone https://huggingface.co/$SOURCE_URI tmp --depth=1
24+
git clone https://huggingface.co/$SOURCE_URL tmp --depth=1
2525
rm -rf tmp/.git
26+
mkdir -p $ROOT_DIR
2627
mv -n tmp/* $ROOT_DIR
2728
rm -rf tmp

infrastructure/docker/esmfold/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ FROM nvcr.io/nvidia/cuda:12.6.3-runtime-amzn2023 as base
33
WORKDIR /home
44

55
RUN dnf update -y \
6-
&& dnf install -y 'python3.11' \
6+
&& dnf install -y 'python3.11' unzip which \
77
&& dnf clean all \
88
&& rm -rf /var/cache/dnf/*
99

10+
# Install AWS CLI
11+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
12+
&& unzip awscliv2.zip \
13+
&& ./aws/install \
14+
&& rm -rf aws \
15+
&& rm awscliv2.zip
16+
1017
ENV VIRTUAL_ENV='/opt/venv'
1118
ENV PATH="${VIRTUAL_ENV}/bin:$PATH"
1219

infrastructure/docker/esmfold/scripts/esmfold_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def predict_structures(
6666

6767
output = {key: value.cpu() for key, value in outputs.items()}
6868
pdb_string = model.output_to_pdb(output)[0]
69-
output_dir = os.path.join(args.output_dir, str(n))
69+
output_dir = os.path.join(output_dir, str(n))
7070
if not os.path.exists(output_dir):
7171
os.makedirs(output_dir)
7272

infrastructure/docker/rfdiffusion/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ RUN apt-get -q update \
2626
hydra-core==1.3.2 \
2727
pyrsistent==0.19.3 \
2828
icecream==2.1.3 \
29+
numpy==1.26.4 \
2930
/app/RFdiffusion/env/SE3Transformer \
3031
&& wget -O "awscliv2.zip" "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
3132
&& unzip awscliv2.zip \

src/batchfold/esmfold_job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def __attrs_post_init__(self) -> None:
2929
command_list = [f"-i {self.fasta_s3_uri}:input/{self.target_id}.fasta"]
3030
command_list.extend([f"-o output/:{self.output_s3_uri}"])
3131
command_list.extend([
32-
"python scripts/esmfold_inference.py",
33-
f"--fasta=input/{self.target_id}.fasta",
32+
"python esmfold_inference.py",
3433
f"--pdb=output",
3534
f"--num-recycles={self.num_recycles}",
3635
f"--model-dir={self.model_dir}",
36+
f"input/{self.target_id}.fasta",
3737
])
3838

3939
if self.chunk_size:

0 commit comments

Comments
 (0)