Skip to content

Commit

Permalink
revert image caching
Browse files Browse the repository at this point in the history
  • Loading branch information
yoomlam committed May 18, 2024
1 parent dd275c4 commit 90a7852
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,12 @@ jobs:
if: inputs.build_image
uses: actions/checkout@v4

# Improve building performance by pulling image from GHCR, if it exists
# https://stackoverflow.com/questions/77494739/github-action-gha-docker-cache-much-slower-than-recreating-the-image
- name: "Login to GHCR (GitHub Container Registry) for caching image"
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Pull cached image"
if: inputs.build_image
run: |
{ docker pull "$GHCR_PATH" && docker tag "$GHCR_PATH" ${{ inputs.image_name }}:${{ inputs.image_tag }}
} || exit 0
- name: "Build image ${{ inputs.image_name }} with tag '${{ inputs.image_tag }}'"
if: inputs.build_image
run: |
cd ${{ inputs.dockerfile_folder }}
docker build -t "${{ inputs.image_name }}:${{ inputs.image_tag }}" .
- name: "Cache image in GHCR for future runs"
if: inputs.build_image
run: |
# echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker tag ${{ inputs.image_name }}:${{ inputs.image_tag }} "$GHCR_PATH"
docker push "$GHCR_PATH"
- name: "Publish image to AWS ECR'"
if: inputs.build_image
env:
Expand Down
17 changes: 7 additions & 10 deletions 02-household-queries/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/navapbc/labs-gen-ai-experiments.git .
WORKDIR /app/02-household-queries
RUN pip3 install -r requirements.txt
# RUN apt-get update && apt-get install -y \
# build-essential \
# curl \
# software-properties-common \
# git \
# && rm -rf /var/lib/apt/lists/*

COPY . .
RUN pip3 install -r requirements.txt

# Associate GHCR package with GitHub repo; otherwise, it's associated with the navapbc GitHub organization
# See https://github.com/orgs/navapbc/packages?repo_name=labs-gen-ai-experiments
Expand Down

0 comments on commit 90a7852

Please sign in to comment.