Skip to content

Commit

Permalink
fixed bugs for analysis, submit and tplfeature service.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimiao1025 committed Mar 8, 2024
1 parent 7a5eb41 commit 6686ea4
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 23 deletions.
19 changes: 18 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ services:
build:
context: ./gui
dockerfile: Dockerfile
args:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
ports:
- "80:4173"
volumes:
Expand All @@ -19,6 +25,12 @@ services:
build:
context: ./api
dockerfile: Dockerfile
args:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
ports:
- "8081:8081"
depends_on:
Expand Down Expand Up @@ -181,7 +193,6 @@ services:
- ./lib:/worker/lib
command: celery -A worker worker --loglevel=info -Q queue_selecttpl --concurrency=4


worker_tplfeature:
build:
context: ./services/tplfeature
Expand Down Expand Up @@ -295,6 +306,12 @@ services:
build:
context: ./services/submit
dockerfile: Dockerfile
args:
- http_proxy=${http_proxy}
- https_proxy=${https_proxy}
- USER_ID=${UID}
- GROUP_ID=${GID}
- USER_NAME=${USER_NAME}
depends_on:
- rabbitmq
environment:
Expand Down
2 changes: 1 addition & 1 deletion gui/stats.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions services/analysis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ RUN pip install -U setuptools pip
RUN pip install --no-cache-dir -r /tmp/requirements.txt


# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}


WORKDIR /worker

# Specify the command to run on container start
Expand Down
4 changes: 2 additions & 2 deletions services/analysis/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ psutil
gpustat
absl-py
scipy
tensorflow
ray
dm-tree
dm-tree
tensorflow-gpu==2.6.0
4 changes: 2 additions & 2 deletions services/analysis/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def rerank_relaxed_plddts(self, dirname):
)
os.system(f"cp {src_path} {tgt_path}")

def run(self, *args, dry=False, **kwargs):
def run(self):
ptree = get_pathtree(request=self.requests[0])
num_res = len(self.requests[0]["sequence"])
dirname = str(ptree.alphafold.root)
Expand Down Expand Up @@ -300,4 +300,4 @@ def run(self, *args, dry=False, **kwargs):
)
result_path = os.path.join(dirname, "plddt_results.json")
dtool.write_json(result_path, data=model2plddts)
# return True
return str(result_path)
10 changes: 10 additions & 0 deletions services/blast/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ RUN mkdir /tmp/blast \
&& cp ncbi-blast-2.13.0+/bin/* /usr/local/bin/ \
&& rm -rf /tmp/blast

# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

# Specify the command to run on container start
Expand Down
19 changes: 7 additions & 12 deletions services/hhblits/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@ RUN pip install -U setuptools pip
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# install cmake
# RUN apt-get update && apt-get -y install cmake protobuf-compiler
RUN apt-get update \
&& apt-get -y install build-essential \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /opt/cmake-3.24.1 \
&& /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.24.1 \
&& rm /tmp/cmake-install.sh \
&& ln -s /opt/cmake-3.24.1/bin/* /usr/local/bin
RUN wget -O cmake-3.22.5-linux-x86_64.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-x86_64.tar.gz \
&& tar zxvf cmake-3.22.5-linux-x86_64.tar.gz \
&& cd cmake-3.22.5-linux-x86_64 \
&& cp -r bin/ /usr/local \
&& cp -r share/ /usr/local \
&& rm -rf /tmp/cmake-3.22.5-linux-x86_64 \
&& rm -rf /tmp/cmake-3.22.5-linux-x86_64.tar.gz

# Install HH-suite3
RUN git clone --recursive https://github.com/soedinglab/hh-suite.git /tmp/hhsuite \
Expand Down
10 changes: 10 additions & 0 deletions services/jackhmmer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ RUN mkdir /tmp/hmmer \
&& make \
&& make install \
&& rm -rf /tmp/hmmer

# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

Expand Down
11 changes: 11 additions & 0 deletions services/mergemsa/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install -U setuptools pip
RUN pip install --no-cache-dir -r /tmp/requirements.txt


# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

# Specify the command to run on container start
Expand Down
10 changes: 10 additions & 0 deletions services/mmseqs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ RUN cd /tmp \
&& cp -r mmseqs/bin/* /usr/local/bin/ \
&& rm -rf /tmp/mmseqs

# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

# Specify the command to run on container start
Expand Down
10 changes: 10 additions & 0 deletions services/selecttpl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install -U setuptools pip
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

# Specify the command to run on container start
Expand Down
15 changes: 14 additions & 1 deletion services/submit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ ENV CELERY_BROKER_URL pyamqp://guest:guest@localhost:5672/
ENV CELERY_RESULT_BACKEND rpc://
ENV C_FORCE_ROOT true

# RUN apk add build-base linux-headers # very slow
ARG USER_ID=1011
ARG GROUP_ID=1011
ARG USER_NAME=docker

COPY requirements.txt /tmp/requirements.txt

RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install -U setuptools pip
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# add user
RUN if [ $USER_NAME != "root" ] ; \
then addgroup --gid ${GROUP_ID} ${USER_NAME} \
&& adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID ${USER_NAME} \
&& usermod -aG sudo ${USER_NAME} \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers ; fi

# Switch to the created user
USER ${USER_NAME}

WORKDIR /worker

# Specify the command to run on container start
Expand Down
3 changes: 2 additions & 1 deletion services/submit/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ gpustat
absl-py
scikit-learn
ray
dm-tree
dm-tree
numpy==1.23
4 changes: 2 additions & 2 deletions services/submit/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def init_runners(self, groups):
self.add_runner(f"submit_{sender}", submit)
return runners

def run(self, dry=False, *args, **kwargs):
def run(self, dry=False):
for runner in self.runners:
runner.run(dry=dry)
# return True
return "submitted!"
3 changes: 2 additions & 1 deletion services/tplfeature/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ gpustat
absl-py
docker
ray
dm-tree
dm-tree
numpy==1.23
1 change: 1 addition & 0 deletions services/tplfeature/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def run(self):
# get template hits
ptree = get_pathtree(request=self.requests[0])
template_hits_path = str(ptree.search.template_hits)
logger.info(f"template_hits_path: {template_hits_path}")
template_hits = dtool.read_pickle(template_hits_path)

output_path = str(ptree.alphafold.template_feat)
Expand Down

0 comments on commit 6686ea4

Please sign in to comment.