Skip to content

Commit

Permalink
update dev container setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rvhonorato committed Jan 23, 2024
1 parent 8cbaac0 commit f7321e8
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 25 deletions.
57 changes: 51 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,68 @@ FROM golang:1.21 AS golang
#========================================================================================================#
FROM xenonmiddleware/slurm:20

#==============================================================================================
# Define ARGs
ARG HADDOCK_VERSION=v3.0.0-beta.5
ARG USERNAME=dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID

#==============================================================================================
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential=12.1ubuntu2 \
sudo=1.8.16-0ubuntu1.10 \
wget=1.17.1-1ubuntu1.5 \
git=1:2.7.4-0ubuntu1.10 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

#==============================================================================================
# Configure User
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y --no-install-recommends sudo=1.8.16-0ubuntu1.10 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

#==============================================================================================
# Install miniconda
ENV CONDA_DIR /opt/conda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /opt/conda

ENV PATH=$CONDA_DIR/bin:$PATH
RUN conda install python=3.9

#==============================================================================================
# Install HADDOCK3
WORKDIR /opt

RUN git clone --recursive https://github.com/haddocking/haddock3.git
WORKDIR /opt/haddock3
RUN git checkout ${HADDOCK_VERSION}

WORKDIR /opt/haddock3/src/fcc/src
RUN make

WORKDIR /opt/haddock3
RUN pip install --no-cache-dir -r requirements.txt \
&& python setup.py develop

WORKDIR /opt/haddock3/bin
COPY cns /opt/haddock3/bin/cns

#==============================================================================================
# Copy Go
COPY --from=golang /usr/local/go/ /usr/local/go/

#========================================================================================================#
# Configure container startup
WORKDIR /app
COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh

COPY --from=golang /usr/local/go/ /usr/local/go/

USER $USERNAME
WORKDIR $HOME
#========================================================================================================#
20 changes: 14 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
},
"features": {
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/git:1": {}
"ghcr.io/devcontainers/features/git:1": {},
},
"postCreateCommand": "sudo /app/start.sh",
"postCreateCommand": "sudo bash /app/start.sh",
"customizations": {
"vscode": {
"extensions": ["golang.go", "GitHub.copilot"]
}
"extensions": ["golang.go", "GitHub.copilot"],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/bash",
},
},
},
},
},
"containerUser": "dev"
"containerUser": "dev",
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#***********************************************************************
# VSCode things
.vscode

.devcontainer/cns

#***********************************************************************
# Benchmark things
Expand Down
13 changes: 7 additions & 6 deletions example/example_haddock30.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
general:
executable: /home/rodrigo/repos/haddock-runner/example/haddock3.sh
max_concurrent: 4
haddock_dir: /home/rodrigo/repos/haddock3
executable: /workspaces/haddock-runner/example/haddock3.sh
max_concurrent: 1
haddock_dir: /opt/haddock3
receptor_suffix: _r_u
ligand_suffix: _l_u
input_list: /home/rodrigo/repos/haddock-runner/example/input_list.txt
work_dir: /home/rodrigo/repos/haddock-runner/bm-goes-here
input_list: /workspaces/haddock-runner/example/input_list.txt
work_dir: /workspaces/haddock-runner/bm-goes-here
use_slurm: true

scenarios:
- name: true-interface
Expand All @@ -31,7 +32,7 @@ scenarios:
unambig_fname: _unambig.tbl
ligand_top_fname: _ligand.top
ligand_param_fname: _ligand.param
emref:
emref: ~
caprieval:
reference_fname: _ref.pdb

Expand Down
8 changes: 2 additions & 6 deletions example/haddock3.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/bin/bash
#===============================================================================
HADDOCK3_DIR="$HOME/repos/haddock3"

### Activate the virtual environment
## if your haddock3 installation uses venv
source "$HADDOCK3_DIR/venv/bin/activate" || exit
## if your haddock3 installation uses conda
# conda activate haddock3
source /opt/conda/etc/profile.d/conda.sh
conda activate env

haddock3 "$@"
#===============================================================================

0 comments on commit f7321e8

Please sign in to comment.