-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new build capabilities to maxdiffusion (#103)
* Nightly Docker Image build * Updated flow to generate this nightly image
- Loading branch information
Showing
3 changed files
with
111 additions
and
21 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,72 @@ | ||
# Use Python 3.10-slim-bullseye as the base image | ||
FROM python:3.10-slim-bullseye | ||
|
||
# Environment variable for no-cache-dir and pip root user warning | ||
ENV PIP_NO_CACHE_DIR=1 | ||
ENV PIP_ROOT_USER_ACTION=ignore | ||
|
||
# Set environment variables for Google Cloud SDK and Python 3.10 | ||
ENV PYTHON_VERSION=3.10 | ||
ENV CLOUD_SDK_VERSION=latest | ||
|
||
# Set DEBIAN_FRONTEND to noninteractive to avoid frontend errors | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Upgrade pip to the latest version | ||
RUN python -m pip install --upgrade pip --no-warn-script-location | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y apt-utils git curl gnupg procps iproute2 ethtool && rm -rf /var/lib/apt/lists/* | ||
|
||
# Add the Google Cloud SDK package repository | ||
RUN curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \ | ||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list | ||
|
||
# Install the Google Cloud SDK | ||
RUN apt-get update && apt-get install -y google-cloud-sdk && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install cloud-accelerator-diagnostics | ||
RUN pip install cloud-accelerator-diagnostics | ||
|
||
# Install cloud-tpu-diagnostics | ||
RUN pip install cloud-tpu-diagnostics | ||
|
||
# Install gcsfs | ||
RUN pip install gcsfs | ||
|
||
# Install google-cloud-storage | ||
RUN pip install google-cloud-storage | ||
|
||
# Install jax-nightly | ||
RUN pip install --pre -U jax -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html | ||
|
||
# Install jaxlib-nightly | ||
RUN pip install --pre -U jaxlib -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html | ||
|
||
# Install libtpu-nightly | ||
RUN pip install libtpu-nightly -f https://storage.googleapis.com/jax-releases/libtpu_releases.html -U --pre | ||
|
||
# Installing nightly tensorboard plugin profile | ||
RUN pip install tbp-nightly --upgrade | ||
|
||
|
||
# Set the working directory in the container | ||
WORKDIR /deps | ||
|
||
# Copy all files from local workspace into docker container | ||
COPY . . | ||
RUN ls . | ||
|
||
ARG MAXDIFFUSION_REQUIREMENTS_FILE | ||
|
||
# Install Maxdiffusion requirements | ||
RUN if [ ! -z "${MAXDIFFUSION_REQUIREMENTS_FILE}" ]; then \ | ||
echo "Using MaxDiffusion requirements: ${MAXDIFFUSION_REQUIREMENTS_FILE}" && \ | ||
pip install -r /deps/${MAXDIFFUSION_REQUIREMENTS_FILE}; \ | ||
fi | ||
|
||
# Install MaxDiffusion | ||
RUN pip install . | ||
|
||
# Cleanup | ||
RUN rm -rf /root/.cache/pip |