-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cache_to option in the build and publish commands (#195)
* Add cache_to option to docker build and publish * Fix trailing spaces * Remove macos old tests * Remove old resource class for macos * Use docker buildx * Add platfrom option to credentials helper * Fix arch parameter name * Use load when generating cache * Use a bigger image to test the cache * Add bigger image * Use a different tag instead of repo * use machine executor for cache test * Use cache from on save cache step * Add more debug to build script * Use arm to cache test * Use amd64 * update cache parameters description
- Loading branch information
1 parent
354aaf5
commit ac2f5c4
Showing
9 changed files
with
179 additions
and
25 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
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,15 @@ | ||
description: > | ||
Build/publish a Docker image using --cache-to | ||
usage: | ||
version: 2.1 | ||
|
||
orbs: | ||
docker: circleci/[email protected] | ||
|
||
workflows: | ||
build-docker-image-only: | ||
jobs: | ||
- docker/publish: | ||
image: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME | ||
tag: latest | ||
cache_to: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:cache |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Set environment variables | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update and install common packages (same as base) | ||
RUN apt-get update && apt-get install -y \ | ||
python3.10 \ | ||
python3-pip \ | ||
curl \ | ||
wget \ | ||
git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install common Python packages (same as base) | ||
RUN pip3 install --no-cache-dir --upgrade pip && \ | ||
pip3 install --no-cache-dir \ | ||
numpy \ | ||
pandas \ | ||
scikit-learn \ | ||
matplotlib | ||
|
||
# Install additional packages | ||
RUN apt-get update && apt-get install -y \ | ||
nodejs \ | ||
npm \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install TensorFlow and Keras | ||
RUN pip3 install --no-cache-dir tensorflow keras | ||
|
||
# Install PyTorch | ||
RUN pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu | ||
|
||
# Install some Node.js packages globally | ||
RUN npm install -g \ | ||
express \ | ||
lodash \ | ||
moment | ||
|
||
# Create large files to simulate longer build time | ||
RUN dd if=/dev/urandom of=/large_file_1 bs=1M count=500 && \ | ||
dd if=/dev/urandom of=/large_file_2 bs=1M count=500 && \ | ||
rm /large_file_1 /large_file_2 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Create a simple Python script that uses one of the new packages | ||
RUN echo 'import tensorflow as tf; print(f"TensorFlow version: {tf.__version__}")' > tf_version.py | ||
|
||
CMD ["python3", "tf_version.py"] |