-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multi-stage exmaple yaml file and generated Dockerfile (#13)
- Loading branch information
Showing
7 changed files
with
125 additions
and
77 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.1.18" | ||
__version__ = "0.1.19" |
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,16 @@ | ||
images: | ||
base-cpu: | ||
name: agi | ||
base: debian:buster-slim | ||
system: | ||
- wget | ||
python: "3.8.10" | ||
pip: | ||
- scikit-learn | ||
run: | ||
- echo "Hello, world!" | ||
|
||
dev-cpu: | ||
base: base-cpu | ||
system: | ||
- build-essential |
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,103 @@ | ||
# >>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
# Auto-generated by agi-pack (version=0.1.18). | ||
FROM debian:buster-slim AS base-cpu | ||
|
||
# Setup environment variables | ||
ENV AGIPACK_PROJECT agi | ||
ENV AGIPACK_PYENV agi-py38 | ||
ENV AGIPACK_PATH /opt/agi-pack | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
ENV PYTHON_VERSION 3.8.10 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONWARNINGS ignore | ||
ENV PIP_CACHE_DIR /var/cache/pip | ||
ENV CONDA_PKGS_DIRS /var/cache/conda/pkgs | ||
|
||
# Setup conda paths | ||
ENV CONDA_PATH=${AGIPACK_PATH}/conda/envs/${AGIPACK_PYENV} | ||
ENV CONDA_PREFIX=${CONDA_PATH} | ||
ENV CONDA_EXE=${CONDA_PATH}/bin/conda | ||
ENV PATH=${CONDA_PATH}/bin:${AGIPACK_PATH}/conda/bin:$PATH | ||
ENV CONDA_DEFAULT_ENV ${AGIPACK_PYENV} | ||
|
||
# Install base system packages | ||
RUN apt-get -y update \ | ||
&& apt-get -y --no-install-recommends install \ | ||
curl bzip2 git ca-certificates | ||
|
||
# Install additional system packages | ||
RUN --mount=type=cache,target=/var/cache/apt \ | ||
apt-get -y update \ | ||
&& apt-get -y --no-install-recommends install \ | ||
wget \ | ||
&& echo "system install complete" | ||
|
||
# Install mambaforge, with cache mounting ${CONDA_PKGS_DIRS} for faster builds | ||
RUN --mount=type=cache,target=${CONDA_PKGS_DIRS} \ | ||
curl -sLo ~/mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \ | ||
&& chmod +x ~/mambaforge.sh \ | ||
&& ~/mambaforge.sh -b -p ${AGIPACK_PATH}/conda \ | ||
&& ${AGIPACK_PATH}/conda/bin/mamba init bash \ | ||
&& ${AGIPACK_PATH}/conda/bin/mamba config --add channels conda-forge \ | ||
&& ${AGIPACK_PATH}/conda/bin/mamba create -n ${AGIPACK_PYENV} python=${PYTHON_VERSION} -y \ | ||
&& rm ~/mambaforge.sh | ||
|
||
# Upgrade pip | ||
RUN pip install --upgrade pip | ||
|
||
# Install pip packages, with cache mounting ${PIP_CACHE_DIR} for faster builds | ||
# Note: Cache mounts allow us to re-use the cache for pip packages | ||
# instead of having to re-download them every time we build. | ||
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \ | ||
pip install --cache-dir ${PIP_CACHE_DIR} \ | ||
"scikit-learn" \ | ||
&& echo "pip install complete" | ||
|
||
# Export conda environment on login | ||
RUN echo "export CONDA_PATH=${AGIPACK_PATH}/conda/envs/${AGIPACK_PYENV}" >> ~/.bashrc \ | ||
&& echo "export PATH=${AGIPACK_PATH}/conda/envs/${AGIPACK_PYENV}/bin:$PATH" >> ~/.bashrc \ | ||
&& echo "export CONDA_DEFAULT_ENV=${AGIPACK_PYENV}" >> ~/.bashrc \ | ||
&& echo "mamba activate ${AGIPACK_PYENV}" > ~/.bashrc | ||
|
||
# Setup working directory | ||
WORKDIR /app/$AGIPACK_PYENV | ||
|
||
# Run commands | ||
RUN echo "running commands" | ||
RUN --mount=type=cache,target=${CONDA_PKGS_DIRS} \ | ||
--mount=type=cache,target=${PIP_CACHE_DIR} \ | ||
echo "Hello, world!" | ||
RUN echo "run commands complete" | ||
# Cleanup apt, mamba/conda and pip packages | ||
RUN apt-get -y autoclean \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& ${AGIPACK_PATH}/conda/bin/mamba clean -ya \ | ||
&& rm -rf ${PIP_CACHE_DIR} \ | ||
&& rm -rf ${CONDA_PKGS_DIRS} \ | ||
&& rm -rf /tmp/reqs \ | ||
&& echo "pip cleanup complete" | ||
# >>>>>>>>>>>>>>>>>>>>>>>>>>> | ||
# Auto-generated by agi-pack (version=0.1.18). | ||
FROM base-cpu AS dev-cpu | ||
|
||
# Install additional system packages | ||
RUN --mount=type=cache,target=/var/cache/apt \ | ||
apt-get -y update \ | ||
&& apt-get -y --no-install-recommends install \ | ||
build-essential \ | ||
&& echo "system install complete" | ||
|
||
# Setup working directory | ||
WORKDIR /app/$AGIPACK_PYENV | ||
# Cleanup apt, mamba/conda and pip packages | ||
RUN apt-get -y autoclean \ | ||
&& apt-get -y autoremove \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& ${AGIPACK_PATH}/conda/bin/mamba clean -ya \ | ||
&& rm -rf ${PIP_CACHE_DIR} \ | ||
&& rm -rf ${CONDA_PKGS_DIRS} \ | ||
&& rm -rf /tmp/reqs \ | ||
&& echo "pip cleanup complete" |
This file was deleted.
Oops, something went wrong.