1+ # Copyright 2024 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # Base Image
16+ FROM nvcr.io/nvidia/nemo:24.07
17+
18+ # Set the working directory
19+ WORKDIR /workspace
20+ COPY requirements.txt /workspace/requirements.txt
21+
22+ # GCSfuse components (used to provide shared storage, not intended for high performance)
23+ RUN apt-get update && apt-get install --yes --no-install-recommends \
24+ ca-certificates \
25+ curl \
26+ gnupg \
27+ && echo "deb https://packages.cloud.google.com/apt gcsfuse-buster main" \
28+ | tee /etc/apt/sources.list.d/gcsfuse.list \
29+ && echo "deb https://packages.cloud.google.com/apt cloud-sdk main" \
30+ | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
31+ && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
32+ && apt-get update \
33+ && apt-get install --yes gcsfuse \
34+ && apt-get install --yes google-cloud-cli \
35+ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
36+ && mkdir /gcs
37+
38+ RUN pip install --require-hashes -r requirements.txt
39+
40+ # install kubectl
41+ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
42+ RUN chmod +x ./kubectl
43+ RUN mv ./kubectl /usr/local/bin
44+
45+ # Clone the AotC repository
46+ RUN git clone https://github.com/AI-Hypercomputer/aotc.git
47+ WORKDIR /workspace/aotc
48+
49+ # Build the wheel
50+ RUN pip install build setuptools
51+ RUN python3 -m pip wheel . --no-deps -w dist/
52+ RUN pip install dist/*.whl
53+
54+ # Add the build timestamp as a label
55+ ARG BUILD_TIMESTAMP
56+ LABEL build_timestamp=$BUILD_TIMESTAMP
57+
58+ ENTRYPOINT []
0 commit comments