devcontainers / ci

A GitHub Action and Azure DevOps Task designed to simplify using Dev Containers (https://containers.dev) in CI/CD systems.
MIT License
303 stars 46 forks source link

cache miss #200

Open yaozhang09 opened 1 year ago

yaozhang09 commented 1 year ago

Hoping to get some guidance πŸ™ In my workflow I have a separate job that builds a test image in CI off of a base production image using docker's build-push action. That image then gets pushed to GCR and subsequent steps pull to run tests. I'm noticing that for the first devcontainer action it'll rebuild the container from scratch everytime, even though the cache is being stored in line. looking at the docker build command shows Screenshot 2023-02-02 at 4 35 33 PM

Could someone point out where my configuration may be incorrect?

Here is my workflow, (i've omitted some steps that I don't believe to be related to the issue):

jobs:
  pre-build:
    runs-on: ubuntu-latest

    outputs:
      run_attempt: ${{ github.run_attempt }}

    env:
      SHA: ${{ github.event.pull_request.head.sha }}

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Get Short GitHub SHA
        run: echo "SHA7=${SHA::7}" >> $GITHUB_ENV

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Log in to GCR
        uses: docker/login-action@v2
        with: 
          registry: gcr.io
          username: _json_key
          password: ${{ env.SERVICE_KEY_FILE }}

      - name: Build and Push Docker Image
        uses: docker/build-push-action@v3
        with:
          context: "{{defaultContext}}:dbt"
          pull: true
          push: true
          tags: |
            ${{ env.IMAGE_NAME }}:${{ env.DATASET }}.gh-${{ github.run_id }}.${{ github.run_attempt }}
            ${{ env.IMAGE_NAME }}:${{ env.SHA7 }}
          cache-from: type=gha
          cache-to: type=gha,mode=max,type=inline
          provenance: false
          secrets: |
            GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
  test:
    runs-on: ubuntu-latest
    needs: [ pre-build ]

    env:
      GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID_TEST }}
      TARGET: test

    steps:
      - name: Checkout
        uses: actions/checkout@v3     

      - name: Run git hooks
        uses: devcontainers/ci@v0.2
        env: 
          GOOGLE_APPLICATION_CREDENTIALS: /var/secrets/google/client_secrets.json
        with:
          cacheFrom: ${{ env.IMAGE_NAME }}:${{ env.DATASET }}.gh-${{ github.run_id }}.${{ github.run_attempt }}
          runCmd: |
              pre-commit run 

      - name: Run test
        uses: devcontainers/ci@v0.2
        env: 
          GOOGLE_APPLICATION_CREDENTIALS: /var/secrets/google/client_secrets.json
        with:
          cacheFrom: ${{ env.IMAGE_NAME }}:${{ env.DATASET }}.gh-${{ github.run_id }}.${{ github.run_attempt }}
          runCmd: |
              dbt test -m state:modified+ --defer --state .

The first devcontainer call: Screenshot 2023-02-02 at 4 51 36 PM

The second devcontainer call: Screenshot 2023-02-02 at 4 51 55 PM it doesn't look like in the first instance of devcontainer the cache is being used?

The build and push step is successful: Screenshot 2023-02-02 at 4 57 19 PM

stuartleeks commented 1 year ago

Hi @yaozhang09 - are you able to share your devcontainer.json and any associated Dockerfile?

Looking at your workflow, it seems that you are building with a standard docker/build-push-action action in the pre-build job?

The test job is then using the devcontainers/ci action to build/run the container, which will often have extra steps on top of the base docker build. Are you able to try building with the devcontainers/ci action in the pre-build job?

yaozhang09 commented 1 year ago

@stuartleeks πŸ‘‹ yes I am using the standard docker build in the pre-build step. The idea was to use try to prod image that gets built without the extra steps from the devcontainer json as cache to speed up build time. But now i'm wondering if it's because devcontainer/ci has extra steps that the cache is invalidated each time? I will try building with the devcontainer/ci action in the pre-build instead.

here is my devcontainer json:


{
    "name": "dbt",
    "build": {
        "dockerfile": "../dbt/Dockerfile",
        "args": { "VARIANT": "3.10-bullseye" }
    },
    "workspaceMount": "src=${localWorkspaceFolder},target=/usr/app,type=bind,consistency=cached",
    "mounts": [
        "src=${localEnv:HOME}/.dbt/profiles.yml,target=/home/vscode/.dbt/profiles.yml,type=bind,readonly",
        "src=${localEnv:HOME}/.config/gcloud/application_default_credentials.json,target=/var/secrets/google/client_secrets.json,type=bind,readonly"
    ],
    "workspaceFolder": "/usr/app/dbt",
    "containerEnv": {
        "GOOGLE_APPLICATION_CREDENTIALS": "${localEnv:GOOGLE_APPLICATION_CREDENTIALS:/var/secrets/google/client_secrets.json}",
        "TARGET": "${localEnv:TARGET:dev}",
        "GCP_PROJECT_ID": "${localEnv:GCP_PROJECT_ID:dev}",
        "DBT_PROFILES_DIR": "${localEnv:DBT_PROFILES_DIR:~/.dbt/}",
        "DATASET": "${localEnv:DATASET}"
    },
    "forwardPorts": [
        8000
    ],
    "postCreateCommand": "dbt deps && dbt debug && dbt seed && pre-commit install && pre-commit install --hook-type post-checkout && cp target/manifest.json .",
    "settings": {
        "terminal.integrated.defaultProfile.linux": "zsh",
        "python.pythonPath": "/usr/local/bin/python",
        "python.languageServer": "Pylance",
        "files.associations": {
            "*.sql": "jinja-sql"
        },
        // "dbt-bigquery-preview.projectId": "dev",
        // "dbt-bigquery-preview.location": "US",
        "dbt.bigquery.projectId": "dev",
        "dbt.bigquery.runnerTheme": "light",
        "sqlfluff.config": "${workspaceFolder}/.sqlfluff",
        "sqlfluff.linter.run": "onSave",
        "sqlfluff.experimental.format.executeInTerminal": true,
        "editor.formatOnSave": false
    },
    "remoteUser": "vscode",
    "features": {
        "ghcr.io/devcontainers/features/docker-from-docker:1": {
            "version": "latest",
            "dockerDashComposeVersion": "v2"
        }
    },
    "customizations": {
        "vscode": {
            "extensions": [
                "eamodio.gitlens",
                "mhutchie.git-graph",
                "ms-azuretools.vscode-docker",
                "GitHub.vscode-pull-request-github",
                "MarkLarah.pre-commit-vscode",
                "dorzey.vscode-sqlfluff",
                "bastienboutonnet.vscode-dbt",
                // "jjuanramos.dbt-bigquery-preview",
                "butchland.vscode-dbt-bigquery-power-user"
            ]
        }
    }
}

dockerfile:

ARG VARIANT="3.10-bullseye"
ARG VERSION="0.204.5"
FROM mcr.microsoft.com/vscode/devcontainers/python:${VERSION}-${VARIANT}

RUN export DEBIAN_FRONTEND=noninteractive

ARG dbt_bigquery_ref=dbt-bigquery@v1.3.0
# System setup
RUN apt-get update \
  && apt-get dist-upgrade -y \
  && apt-get install -y --no-install-recommends \
    git \
    ssh-client \
    software-properties-common \
    make \
    build-essential \
    ca-certificates \
    libpq-dev \
  && apt-get clean \
  && rm -rf \
    /var/lib/apt/lists/* \
    /tmp/* \
    /var/tmp/*

# Env vars
ENV PYTHONIOENCODING=utf-8
ENV LANG=C.UTF-8

# Update python
RUN python -m pip install --upgrade pip setuptools wheel --no-cache-dir

# Set docker basics
WORKDIR /usr/app/dbt/
ENTRYPOINT ["dbt"]

ARG SQLFLUFF_VERSION="1.4.5"
ARG PRECOMMIT_VERSION='2.20.0'
ARG DBT_COVERAGE_VERSION='0.3.2'

RUN python -m pip install sqlfluff==${SQLFLUFF_VERSION} \
  sqlfluff-templater-dbt==${SQLFLUFF_VERSION} \
  pre-commit==${PRECOMMIT_VERSION} \
  dbt-coverage==${DBT_COVERAGE_VERSION} \
  --no-cache-dir "git+https://github.com/dbt-labs/${dbt_bigquery_ref}#egg=dbt-bigquery" 

# Breaking out to utilize layer caching and only rerun if DBT package dependencies change
COPY packages.yml dbt_project.yml ./
RUN dbt deps

COPY . .
yaozhang09 commented 1 year ago

@stuartleeks I've updated the pre-build step to build the image with devcontainer/ci action instead but it still doesn't look to be pulling from the image cache in the subsequent steps for testing.

  - name: Log in to GCR
    uses: docker/login-action@v2
    with: 
      registry: gcr.io
      username: _json_key
      password: ${{ env.SERVICE_KEY_FILE }}

  - name: Build
    uses: devcontainers/ci@v0.2
    env: 
      GOOGLE_APPLICATION_CREDENTIALS: /var/secrets/google/client_secrets.json
    with:
      push: always
      imageName: ${{ env.IMAGE_NAME }}
      imageTag: ${{ env.DATASET }}.gh-${{ github.run_id }}.${{ github.run_attempt }}
Screenshot 2023-02-05 at 12 14 46 PM Screenshot 2023-02-05 at 12 22 02 PM

some log outputs that i couldn't capture in the screenshot

  #6 importing cache manifest from gcr.io/***/dbt:test_provenance.gh-4098263189.1

  [2023-02-05T20:12:11.121Z] #6 DONE 1.6s

  #5 [internal] load build context

  [2023-02-05T20:12:11.274Z] #5 ...

  #4 [dev_container_auto_added_stage_label 1/9] FROM mcr.microsoft.com/vscode/devcontainers/python:0.204.5-3.10-bullseye

  [2023-02-05T20:12:11.274Z] #4 DONE 0.1s

  #5 [internal] load build context

  [2023-02-05T20:12:11.424Z] #5 transferring context: 20.25MB 0.3s done
  #5 DONE 0.3s

  #8 [dev_container_auto_added_stage_label 2/9] RUN export DEBIAN_FRONTEND=noninteractive

  [2023-02-05T20:12:11.725Z] #8 DONE 0.5s

  #9 [dev_container_auto_added_stage_label 3/9] RUN apt-get update   && apt-get dist-upgrade -y   && apt-get install -y --no-install-recommends     git     ssh-client     software-properties-common     make     build-essential     ca-certificates     libpq-dev   && apt-get clean   && rm -rf     /var/lib/apt/lists/*     /tmp/*     /var/tmp/*

  [2023-02-05T20:12:13.047Z] #9 1.451 Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]

  [2023-02-05T20:12:13.047Z] 

  [2023-02-05T20:12:13.153Z] #9 1.486 Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]

  [2023-02-05T20:12:13.153Z] 
  #9 1.487 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
  #9 1.557 Get:4 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]

  [2023-02-05T20:12:13.605Z] #9 1.954 Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]

  [2023-02-05T20:12:13.723Z] #9 2.068 Get:6 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [222 kB]
  #9 2.127 Get:7 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]

  [2023-02-05T20:12:13.874Z] #9 2.194 Get:8 https://dl.yarnpkg.com/debian stable/main all Packages [10.9 kB]
  #9 2.219 Get:9 https://dl.yarnpkg.com/debian stable/main amd64 Packages [10.9 kB]

  [2023-02-05T20:12:14.926Z] #9 3.237 Fetched 8667 kB in 2s (4455 kB/s)
  #9 3.237 Reading package lists...

  [2023-02-05T20:12:15.377Z] 
  #9 3.[71](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:72)3 Reading package lists...

  [2023-02-05T20:12:15.829Z] 
  #9 4.181 Building dependency tree...

  [2023-02-05T20:12:15.967Z] 
  #9 4.2[72](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:73) Reading state information...
  #9 4.295 Calculating upgrade...

  [2023-02-05T20:12:16.117Z] #9 4.458 The following packages will be upgraded:
  #9 4.458   curl git git-man libcurl3-gnutls libcurl4 libcurl4-openssl-dev

  [2023-02-05T20:12:16.252Z] #9 4.620 6 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  #9 4.620 Need to get 8[73](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:74)9 kB of archives.
  #9 4.620 After this operation, 28.7 kB of additional disk space will be used.
  #9 4.620 Get:1 http://deb.debian.org/debian-security bullseye-security/main amd64 libcurl4-openssl-dev amd64 7.[74](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:75).0-1.3+deb11u5 [436 kB]
  #9 4.656 Get:2 http://deb.debian.org/debian-security bullseye-security/main amd64 curl amd64 7.74.0-1.3+deb11u5 [270 kB]

  [2023-02-05T20:12:16.403Z] #9 4.659 Get:3 http://deb.debian.org/debian-security bullseye-security/main amd64 libcurl4 amd64 7.74.0-1.3+deb11u5 [346 kB]
  #9 4.666 Get:4 http://deb.debian.org/debian-security bullseye-security/main amd64 git-man all 1:2.30.2-1+deb11u1 [1829 kB]
  #9 4.679 Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 libcurl3-gnutls amd64 7.74.0-1.3+deb11u5 [343 kB]
  #9 4.681 Get:6 http://deb.debian.org/debian-security bullseye-security/main amd64 git amd64 1:2.30.2-1+deb11u1 [5514 kB]

  [2023-02-05T20:12:17.124Z] #9 5.494 debconf: unable to initialize frontend: Dialog
  #9 5.494 debconf: (TERM is not set, so the dialog frontend is not usable.)
  #9 5.494 debconf: falling back to frontend: Readline
  #9 5.528 debconf: unable to initialize frontend: Readline
  #9 5.528 debconf: (This frontend requires a controlling tty.)
  #9 5.528 debconf: falling back to frontend: Teletype

  [2023-02-05T20:12:17.2[75](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:76)Z] #9 5.533 dpkg-preconfigure: unable to re-open stdin: 
  #9 5.570 Fetched 8739 kB in 0s (34.9 MB/s)

  [2023-02-05T20:12:17.425Z] #9 5.680 (Reading database ... 
  (Reading database ... 5%
  (Reading database ... 10%
  (Reading database ... 15%
  (Reading database ... 20%
  (Reading database ... 25%
  (Reading database ... 30%
  (Reading database ... 35%
  (Reading database ... 40%
  (Reading database ... 45%
  (Reading database ... 50%
  (Reading database ... 55%
  (Reading database ... 60%
  (Reading database ... 65%

  [2023-02-05T20:12:17.568Z] (Reading database ... 70%

  [2023-02-05T20:12:17.868Z] (Reading database ... 75%

  [2023-02-05T20:12:18.170Z] (Reading database ... 80%

  [2023-02-05T20:12:18.301Z] (Reading database ... 85%

  [2023-02-05T20:12:18.602Z] (Reading database ... 90%
  (Reading database ... 95%
  (Reading database ... 100%
  (Reading database ... 28348 files and directories currently installed.)
  #9 6.938 Preparing to unpack .../0-libcurl4-openssl-dev_7.74.0-1.3+deb11u5_amd64.deb ...
  #9 6.941 Unpacking libcurl4-openssl-dev:amd64 (7.74.0-1.3+deb11u5) over (7.74.0-1.3+deb11u3) ...

  [2023-02-05T20:12:18.894Z] #9 7.184 Preparing to unpack .../1-curl_7.74.0-1.3+deb11u5_amd64.deb ...
  #9 7.187 Unpacking curl (7.74.0-1.3+deb11u5) over (7.74.0-1.3+deb11u3) ...
  #9 7.298 Preparing to unpack .../2-libcurl4_7.74.0-1.3+deb11u5_amd64.deb ...

  [2023-02-05T20:12:19.001Z] #9 7.302 Unpacking libcurl4:amd64 (7.74.0-1.3+deb11u5) over (7.74.0-1.3+deb11u3) ...
  #9 7.405 Preparing to unpack .../3-git-man_1%3a2.30.2-1+deb11u1_all.deb ...

  [2023-02-05T20:12:19.151Z] #9 7.408 Unpacking git-man (1:2.30.2-1+deb11u1) over (1:2.30.2-1) ...

  [2023-02-05T20:12:19.437Z] #9 7.841 Preparing to unpack .../4-libcurl3-gnutls_7.74.0-1.3+deb11u5_amd64.deb ...

  [2023-02-05T20:12:19.562Z] #9 7.844 Unpacking libcurl3-gnutls:amd64 (7.74.0-1.3+deb11u5) over (7.74.0-1.3+deb11u3) ...
  #9 7.966 Preparing to unpack .../5-git_1%3a2.30.2-1+deb11u1_amd64.deb ...

  [2023-02-05T20:12:19.712Z] #9 8.014 Unpacking git (1:2.30.2-1+deb11u1) over (1:2.30.2-1) ...

  [2023-02-05T20:12:22.387Z] #9 10.79 Setting up libcurl3-gnutls:amd64 (7.74.0-1.3+deb11u5) ...

  [2023-02-05T20:12:22.538Z] #9 10.79 Setting up libcurl4:amd64 (7.74.0-1.3+deb11u5) ...
  #9 10.80 Setting up git-man (1:2.30.2-1+deb11u1) ...
  #9 10.80 Setting up curl (7.74.0-1.3+deb11u5) ...
  #9 10.80 Setting up libcurl4-openssl-dev:amd64 (7.74.0-1.3+deb11u5) ...
  #9 10.80 Setting up git (1:2.30.2-1+deb11u1) ...
  #9 10.85 Processing triggers for man-db (2.9.4-2) ...

  [2023-02-05T20:12:23.399Z] #9 11.80 Processing triggers for libc-bin (2.31-13+deb11u5) ...

  [2023-02-05T20:12:25.804Z] #9 14.10 Reading package lists...

  [2023-02-05T20:12:26.232Z] 
  #9 14.56 Building dependency tree...
  #9 14.64 Reading state information...

  [2023-02-05T20:12:26.347Z] 
  #9 14.75 build-essential is already the newest version (12.9).
  #9 14.75 ca-certificates is already the newest version (20210119).
  #9 14.75 make is already the newest version (4.3-4.1).
  #9 14.75 openssh-client is already the newest version (1:8.4p1-5+deb11u1).
  #9 14.75 libpq-dev is already the newest version (13.9-0+deb11u1).
  #9 14.75 git is already the newest version (1:2.30.2-1+deb11u1).
  #9 14.75 The following additional packages will be installed:
  #9 14.75   gir1.2-glib-2.0 gir1.2-packagekitglib-1.0 iso-codes libdbus-1-3

  [2023-02-05T20:12:26.454Z] #9 14.75   libgirepository-1.0-1 libpackagekit-glib2-18 python-apt-common python3-apt
  #9 14.75   python3-dbus python3-gi python3-pycurl python3-software-properties
  #9 14.75 Suggested packages:
  #9 14.75   isoquery python3-apt-dbg python-apt-doc python-dbus-doc python3-dbus-dbg
  #9 14.75   libcurl4-gnutls-dev python-pycurl-doc python3-pycurl-dbg
  #9 14.75 Recommended packages:
  #9 14.75   dbus packagekit unattended-upgrades
  #9 14.86 The following NEW packages will be installed:

  [2023-02-05T20:12:26.554Z] #9 14.86   gir1.2-glib-2.0 gir1.2-packagekitglib-1.0 iso-codes libdbus-1-3
  #9 14.86   libgirepository-1.0-1 libpackagekit-glib2-18 python-apt-common python3-apt
  #9 14.86   python3-dbus python3-gi python3-pycurl python3-software-properties
  #9 14.86   software-properties-common
  #9 14.89 0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
  #9 14.89 Need to get 4283 kB of archives.
  #9 14.89 After this operation, 25.9 MB of additional disk space will be used.
  #9 14.89 Get:1 http://deb.debian.org/debian bullseye/main amd64 libgirepository-1.0-1 amd64 1.66.1-1+b1 [96.7 kB]
  #9 14.91 Get:2 http://deb.debian.org/debian bullseye/main amd64 gir1.2-glib-2.0 amd64 1.66.1-1+b1 [151 kB]
  #9 14.92 Get:3 http://deb.debian.org/debian bullseye/main amd64 libpackagekit-glib2-18 amd64 1.2.2-2 [124 kB]
  #9 14.92 Get:4 http://deb.debian.org/debian bullseye/main amd64 gir1.2-packagekitglib-1.0 amd64 1.2.2-2 [36.8 kB]
  #9 14.92 Get:5 http://deb.debian.org/debian bullseye/main amd64 iso-codes all 4.6.0-1 [2824 kB]
  #9 14.95 Get:6 http://deb.debian.org/debian bullseye/main amd64 libdbus-1-3 amd64 1.12.24-0+deb11u1 [222 kB]
  #9 14.96 Get:7 http://deb.debian.org/debian bullseye/main amd64 python-apt-common all 2.2.1 [96.5 kB]
  #9 14.96 Get:8 http://deb.debian.org/debian bullseye/main amd64 python3-apt amd64 2.2.1 [190 kB]
  #9 14.96 Get:9 http://deb.debian.org/debian bullseye/main amd64 python3-dbus amd64 1.2.16-5 [108 kB]
  #9 14.96 Get:10 http://deb.debian.org/debian bullseye/main amd64 python3-gi amd64 3.38.0-2 [232 kB]

  [2023-02-05T20:12:26.693Z] #9 14.96 Get:11 http://deb.debian.org/debian bullseye/main amd64 python3-pycurl amd64 7.43.0.6-5 [68.8 kB]
  #9 14.96 Get:12 http://deb.debian.org/debian bullseye/main amd64 python3-software-properties all 0.96.20.2-2.1 [49.7 kB]
  #9 14.96 Get:13 http://deb.debian.org/debian bullseye/main amd64 software-properties-common all 0.96.20.2-2.1 [83.4 kB]
  #9 15.10 debconf: unable to initialize frontend: Dialog

  [2023-02-05T20:12:26.826Z] #9 15.10 debconf: (TERM is not set, so the dialog frontend is not usable.)
  #9 15.10 debconf: falling back to frontend: Readline
  #9 15.10 debconf: unable to initialize frontend: Readline
  #9 15.10 debconf: (This frontend requires a controlling tty.)
  #9 15.10 debconf: falling back to frontend: Teletype
  #9 15.11 dpkg-preconfigure: unable to re-open stdin: 
  #9 15.14 Fetched 4283 kB in 0s (43.4 MB/s)
  #9 15.15 Selecting previously unselected package libgirepository-1.0-1:amd64.
  #9 15.15 (Reading database ... 
  (Reading database ... 5%
  (Reading database ... 10%
  (Reading database ... 15%
  (Reading database ... 20%
  (Reading database ... 25%
  (Reading database ... 30%
  (Reading database ... 35%
  (Reading database ... 40%
  (Reading database ... 45%
  (Reading database ... 50%
  (Reading database ... 55%
  (Reading database ... 60%
  (Reading database ... 65%
  (Reading database ... 70%
  (Reading database ... 75%
  (Reading database ... 80%
  (Reading database ... 85%
  (Reading database ... 90%
  (Reading database ... 95%
  (Reading database ... 100%
  (Reading database ... 28349 files and directories currently installed.)

  [2023-02-05T20:12:26.826Z] #9 15.17 Preparing to unpack .../00-libgirepository-1.0-1_1.66.1-1+b1_amd64.deb ...
  #9 15.17 Unpacking libgirepository-1.0-1:amd64 (1.66.1-1+b1) ...
  #9 15.19 Selecting previously unselected package gir1.2-glib-2.0:amd64.
  #9 15.20 Preparing to unpack .../01-gir1.2-glib-2.0_1.66.1-1+b1_amd64.deb ...
  #9 15.20 Unpacking gir1.2-glib-2.0:amd64 (1.66.1-1+b1) ...
  #9 15.23 Selecting previously unselected package libpackagekit-glib2-18:amd64.

  [2023-02-05T20:12:26.9[76](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:77)Z] #9 15.24 Preparing to unpack .../02-libpackagekit-glib2-18_1.2.2-2_amd64.deb ...
  #9 15.24 Unpacking libpackagekit-glib2-18:amd64 (1.2.2-2) ...
  #9 15.27 Selecting previously unselected package gir1.2-packagekitglib-1.0.
  #9 15.27 Preparing to unpack .../03-gir1.2-packagekitglib-1.0_1.2.2-2_amd64.deb ...
  #9 15.27 Unpacking gir1.2-packagekitglib-1.0 (1.2.2-2) ...
  #9 15.29 Selecting previously unselected package iso-codes.
  #9 15.29 Preparing to unpack .../04-iso-codes_4.6.0-1_all.deb ...
  #9 15.29 Unpacking iso-codes (4.6.0-1) ...

  [2023-02-05T20:12:27.394Z] #9 15.80 Selecting previously unselected package libdbus-1-3:amd64.

  [2023-02-05T20:12:27.509Z] #9 15.80 Preparing to unpack .../05-libdbus-1-3_1.12.24-0+deb11u1_amd64.deb ...
  #9 15.80 Unpacking libdbus-1-3:amd64 (1.12.24-0+deb11u1) ...
  #9 15.84 Selecting previously unselected package python-apt-common.
  #9 15.84 Preparing to unpack .../06-python-apt-common_2.2.1_all.deb ...
  #9 15.84 Unpacking python-apt-common (2.2.1) ...
  #9 15.87 Selecting previously unselected package python3-apt.
  #9 15.87 Preparing to unpack .../07-python3-apt_2.2.1_amd64.deb ...
  #9 15.88 Unpacking python3-apt (2.2.1) ...
  #9 15.91 Selecting previously unselected package python3-dbus.

  [2023-02-05T20:12:27.612Z] #9 15.92 Preparing to unpack .../08-python3-dbus_1.2.16-5_amd64.deb ...
  #9 15.92 Unpacking python3-dbus (1.2.16-5) ...
  #9 15.95 Selecting previously unselected package python3-gi.
  #9 15.95 Preparing to unpack .../09-python3-gi_3.38.0-2_amd64.deb ...
  #9 15.95 Unpacking python3-gi (3.38.0-2) ...
  #9 15.99 Selecting previously unselected package python3-pycurl.
  #9 15.99 Preparing to unpack .../10-python3-pycurl_7.43.0.6-5_amd64.deb ...
  #9 15.99 Unpacking python3-pycurl (7.43.0.6-5) ...
  #9 16.02 Selecting previously unselected package python3-software-properties.
  #9 16.02 Preparing to unpack .../11-python3-software-properties_0.96.20.2-2.1_all.deb ...

  [2023-02-05T20:12:27.762Z] #9 16.02 Unpacking python3-software-properties (0.96.20.2-2.1) ...
  #9 16.04 Selecting previously unselected package software-properties-common.
  #9 16.04 Preparing to unpack .../12-software-properties-common_0.96.20.2-2.1_all.deb ...
  #9 16.04 Unpacking software-properties-common (0.96.20.2-2.1) ...
  #9 16.08 Setting up libpackagekit-glib2-18:amd64 (1.2.2-2) ...
  #9 16.08 Setting up python3-pycurl (7.43.0.6-5) ...

  [2023-02-05T20:12:28.355Z] #9 16.76 Setting up libdbus-1-3:amd64 (1.12.24-0+deb11u1) ...

  [2023-02-05T20:12:28.505Z] #9 16.76 Setting up python-apt-common (2.2.1) ...
  #9 16.[77](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:78) Setting up libgirepository-1.0-1:amd64 (1.66.1-1+b1) ...
  #9 16.77 Setting up iso-codes (4.6.0-1) ...
  #9 16.77 Setting up python3-dbus (1.2.16-5) ...

  [2023-02-05T20:12:28.649Z] #9 16.91 Setting up python3-apt (2.2.1) ...
  #9 17.05 Setting up python3-software-properties (0.96.20.2-2.1) ...

  [2023-02-05T20:12:28.776Z] #9 17.18 Setting up gir1.2-glib-2.0:amd64 (1.66.1-1+b1) ...

  [2023-02-05T20:12:28.927Z] #9 17.18 Setting up gir1.2-packagekitglib-1.0 (1.2.2-2) ...
  #9 17.19 Setting up python3-gi (3.38.0-2) ...

  [2023-02-05T20:12:29.063Z] #9 17.35 Setting up software-properties-common (0.96.20.2-2.1) ...
  #9 17.47 Processing triggers for man-db (2.9.4-2) ...

  [2023-02-05T20:12:29.168Z] #9 17.57 Processing triggers for libc-bin (2.31-13+deb11u5) ...

  [2023-02-05T20:12:29.268Z] #9 DONE 17.7s

  [2023-02-05T20:12:29.419Z] 
  #10 [dev_container_auto_added_stage_label 4/9] RUN python -m pip install --upgrade pip setuptools wheel --no-cache-dir

  [2023-02-05T20:12:30.171Z] #10 0.[83](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:84)2 Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (22.3.1)

  [2023-02-05T20:12:30.300Z] #10 0.9[84](https://github.com/mdg-private/data/actions/runs/4098263189/jobs/7067262717#step:11:85) Collecting pip
  #10 1.031   Downloading pip-23.0-py3-none-any.whl (2.1 MB)
  ...
ericslandry commented 4 months ago

Hi @yaozhang09 πŸ‘‹. Old thread, but did you ever figure out how to use the pre-built dev container (without rebuilding every time)?

RadxaYuntian commented 3 months ago

I also use cacheFrom with this action but the download count remains at 0.

yaozhang09 commented 3 months ago

@ericslandry we actually moved away from using devcontainers in our ci builds since it wasn't giving us any added benefits. Ended up using the built in github actions cache registry for our images.