-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features: Add Chai-1, optimize builds, fix bugs
Add Chai-1 Add Astral UV for fast python package management Fix bug with Boltz env/flag translation Fix bug with Boltz default env variables Enable python fault handling by default (`PYTHONFAULTHANDLER`) Update Boltz readme Add VIRTUAL_ENV variable for builds Add 'lsb-release tree vim nano' to defaults
- Loading branch information
Showing
8 changed files
with
172 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
FROM docker.io/library/python:3.12-slim-bookworm | ||
|
||
LABEL \ | ||
maintainer="Liana64" \ | ||
org.opencontainers.image.source="https://github.com/chaidiscovery/chai-lab" | ||
|
||
ARG TARGETPLATFORM | ||
ARG VERSION | ||
ARG CHANNEL | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV \ | ||
Check warning on line 12 in apps/chai/Dockerfile GitHub Actions / build-images / Build/Test chai (linux/amd64)Variables should be defined before their use
Check warning on line 12 in apps/chai/Dockerfile GitHub Actions / build-images / Build/Test chai (linux/arm64)Variables should be defined before their use
|
||
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility,graphics" \ | ||
VIRTUAL_ENV=/opt/venv \ | ||
PATH="${VIRTUAL_ENV}:$PATH" \ | ||
UMASK="0002" \ | ||
LANG=C.UTF-8 \ | ||
TZ="Etc/UTC" \ | ||
USERNAME=rare \ | ||
UID=900 \ | ||
GID=900 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONFAULTHANDLER=1 \ | ||
PIP_ROOT_USER_ACTION=ignore \ | ||
PIP_NO_CACHE_DIR=1 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | ||
PIP_BREAK_SYSTEM_PACKAGES=1 \ | ||
UV_HTTP_TIMEOUT=1000 | ||
|
||
USER root | ||
WORKDIR /app | ||
|
||
RUN \ | ||
groupadd --gid ${GID} ${USERNAME} \ | ||
&& useradd --uid ${UID} --gid ${GID} --create-home --shell /bin/bash ${USERNAME} \ | ||
&& apt-get update && apt-get install -y --no-install-recommends \ | ||
curl unzip build-essential catatonit jq \ | ||
gnupg ca-certificates lsb-release \ | ||
nano vim tree \ | ||
# ----------------------------------- | ||
# TODO: Build images with extras | ||
# ----------------------------------- | ||
# htop tmux psmisc \ | ||
# socat rsync aria2 openssh-server \ | ||
# ----------------------------------- | ||
# TODO: Build images with RDMA & InfiniBand | ||
# ----------------------------------- | ||
# libibverbs1 librdmacm1 \ | ||
# ----------------------------------- | ||
&& curl -fsSL -o /tmp/app.zip "https://github.com/chaidiscovery/chai-lab/archive/refs/tags/v${VERSION}.zip" \ | ||
&& unzip -q /tmp/app.zip -d /tmp/app \ | ||
&& cp -R /tmp/app/chai-lab-${VERSION}/LICENSE /app \ | ||
&& cp -R /tmp/app/chai-lab-${VERSION}/assets /app \ | ||
&& cp -R /tmp/app/chai-lab-${VERSION}/examples /app \ | ||
&& cp -R /tmp/app/chai-lab-${VERSION}/tests /app \ | ||
&& printf "UpdateMethod=docker\nBranch=master\nPackageVersion=%s\nPackageAuthor=[RareCompute](https://github.com/RareCompute)\n" "${VERSION}" > /app/package_info \ | ||
&& chown -R ${UID}:${GID} /app && chmod -R 755 /app \ | ||
&& curl -LsSf https://astral.sh/uv/0.5.6/install.sh | sh \ | ||
&& . $HOME/.local/bin/env \ | ||
&& uv venv --no-python-downloads ${VIRTUAL_ENV} \ | ||
&& . ${VIRTUAL_ENV}/bin/activate \ | ||
&& uv pip install -r /tmp/app/chai-lab-${VERSION}/requirements.in \ | ||
&& chown -R ${UID}:${GID} ${VIRTUAL_ENV} && chmod -R 755 ${VIRTUAL_ENV} \ | ||
&& apt-get purge -y build-essential \ | ||
&& apt-get autoremove -y \ | ||
&& apt-get clean \ | ||
&& rm -rf /root/.cache /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& chsh -s /bin/bash | ||
|
||
COPY --chown=${UID}:${GID} ./apps/chai/entrypoint.sh /entrypoint.sh | ||
RUN chmod -R 755 /entrypoint.sh | ||
|
||
USER ${USERNAME} | ||
WORKDIR /app | ||
|
||
ENTRYPOINT ["/usr/bin/catatonit", "--", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Chai | ||
|
||
From the [upstream repository](https://github.com/chaidiscovery/chai-lab) | ||
|
||
> Chai-1 is a multi-modal foundation model for molecular structure prediction that performs at the state-of-the-art across a variety of benchmarks. Chai-1 enables unified prediction of proteins, small molecules, DNA, RNA, glycosylations, and more. | ||
## Environment variables | ||
|
||
You can configure the docker image using the below environment variables | ||
|
||
| Environment Variable | CLI Flag | Type | Default Value | Description | | ||
| -------------------- | ------------------ | --------- | ---------------- | ----------------------------------------------- | | ||
| `USERNAME` | N/A | `STR` | `rare` | Username for the container | | ||
| `UID` | N/A | `INTEGER` | `900` | UID for the container | | ||
| `GID` | N/A | `INTEGER` | `900` | GID for the container | | ||
| `CHAI_DOWNLOADS_DIR` | N/A | `PATH` | `/tmp/downloads` | The path where downloads will be cached. | | ||
| `USE_MSA_SERVER` | `--use-msa-server` | `BOOLEAN` | `False` | Whether to use the MSA server to generate MSAs. | | ||
| `MSA_SERVER_URL` | `--msa-server-url` | `STR` | N/A | Use a custom MSA server | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml | ||
file: | ||
/opt/venv/bin/chai: | ||
exists: true | ||
/app/LICENSE: | ||
exists: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
version=$(curl -sX GET "https://api.github.com/repos/chaidiscovery/chai-lab/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null) | ||
version="${version#*v}" | ||
version="${version#*release-}" | ||
printf "%s" "${version}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
EXTRA_FLAGS="" | ||
declare -A FLAG_MAP=( | ||
[USE_MSA_SERVER]="--use-msa-server" | ||
[MSA_SERVER_URL]="--msa-server-url" | ||
) | ||
|
||
for VAR in "${!FLAG_MAP[@]}"; do | ||
if [ -n "${!VAR}" ]; then | ||
VALUE_LOWER=$(echo "${!VAR}" | tr '[:upper:]' '[:lower:]') | ||
if [[ "$VALUE_LOWER" == "true" ]]; then | ||
EXTRA_FLAGS+=" ${FLAG_MAP[$VAR]}" | ||
elif [[ "$VALUE_LOWER" != "false" ]]; then | ||
EXTRA_FLAGS+=" ${FLAG_MAP[$VAR]} ${!VAR}" | ||
fi | ||
fi | ||
done | ||
|
||
exec \ | ||
chai \ | ||
"$@" \ | ||
$EXTRA_FLAGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
#yamllint disable | ||
app: chai | ||
semver: true | ||
channels: | ||
- name: stable | ||
platforms: ["linux/amd64", "linux/arm64"] | ||
stable: true | ||
tests: | ||
enabled: false | ||
type: cli |