ci: fix cache misses (#1053)

Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>
diff --git a/Jenkinsfile b/Jenkinsfile
index 6228f11..8b9b9eb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -82,39 +82,6 @@
           }
         }
 
-        stage('images') {
-          agent {
-            label 'earthly'
-          }
-
-          environment {
-            TEST_REGISTRY = "registry.atmosphere.dev/builds/${env.BRANCH_NAME.toLowerCase()}"
-            PROD_REGISTRY = "ghcr.io/vexxhost/atmosphere"
-            REGISTRY = "${env.BRANCH_NAME == 'main' ? PROD_REGISTRY : TEST_REGISTRY}"
-
-            EARTHLY_BUILD_ARGS = "REGISTRY=${REGISTRY}"
-            EARTHLY_PUSH = "true"
-          }
-
-          steps {
-            script {
-              if (env.BRANCH_NAME == 'main') {
-                docker.withRegistry('https://ghcr.io', 'github-packages-token') {
-                  sh 'earthly --push +images'
-                }
-              } else {
-                docker.withRegistry('https://registry.atmosphere.dev', 'harbor-registry') {
-                  sh 'earthly --push +images'
-                }
-              }
-            }
-
-            sh 'earthly --output +pin-images'
-            sh 'earthly +scan-images'
-            stash name: 'src-with-pinned-images', includes: '**'
-          }
-        }
-
         stage('docs') {
           agent {
             label 'earthly-2c-4g'
diff --git a/images/barbican/Dockerfile b/images/barbican/Dockerfile
index 046f67e..243df60 100644
--- a/images/barbican/Dockerfile
+++ b/images/barbican/Dockerfile
@@ -5,10 +5,7 @@
 
 FROM openstack-venv-builder AS build
 COPY --from=barbican --link /src /src/barbican
-ARG TARGETARCH
-ARG TARGETVARIANT
-RUN \
-    --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT-$RELEASE-cache,sharing=locked,target=/root/.cache/pip <<EOF bash -xe
+RUN <<EOF bash -xe
 pip3 install \
     --constraint /upper-constraints.txt \
         /src/barbican \
diff --git a/images/openstack-runtime/Dockerfile b/images/openstack-runtime/Dockerfile
index 2df606c..732761d 100644
--- a/images/openstack-runtime/Dockerfile
+++ b/images/openstack-runtime/Dockerfile
@@ -1,10 +1,5 @@
 FROM ubuntu-cloud-archive
-ARG TARGETARCH
-ARG TARGETVARIANT
-ARG RELEASE
-RUN \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-$RELEASE-var-cache-apt,sharing=locked,target=/var/cache/apt \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-$RELEASE-var-lib-apt-lists,sharing=locked,target=/var/lib/apt/lists <<EOF bash -xe
+RUN <<EOF bash -xe
 apt-get update -qq
 apt-get install -qq -y --no-install-recommends \
     ca-certificates \
diff --git a/images/openstack-venv-builder/Dockerfile b/images/openstack-venv-builder/Dockerfile
index 4ceb97f..7fea169 100644
--- a/images/openstack-venv-builder/Dockerfile
+++ b/images/openstack-venv-builder/Dockerfile
@@ -1,10 +1,5 @@
 FROM ubuntu-cloud-archive
-ARG TARGETARCH
-ARG TARGETVARIANT
-ARG RELEASE
-RUN \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-$RELEASE-var-cache-apt,sharing=locked,target=/var/cache/apt \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-$RELEASE-var-lib-apt-lists,sharing=locked,target=/var/lib/apt/lists <<EOF bash -xe
+RUN <<EOF bash -xe
 apt-get update -qq
 apt-get install -qq -y --no-install-recommends \
     build-essential \
@@ -20,14 +15,12 @@
     python3-pip \
     python3-venv
 EOF
-RUN \
-    --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT-$RELEASE-cache,sharing=locked,target=/root/.cache/pip <<EOF bash -xe
+RUN <<EOF bash -xe
 python3 -m venv --upgrade-deps --system-site-packages /var/lib/openstack
 EOF
 ENV PATH=/var/lib/openstack/bin:$PATH
 COPY --link --from=requirements /src/upper-constraints.txt /upper-constraints.txt
-RUN \
-    --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT-$RELEASE-cache,sharing=locked,target=/root/.cache/pip <<EOF bash -xe
+RUN <<EOF bash -xe
 pip3 install \
     --constraint /upper-constraints.txt \
         cryptography \
diff --git a/images/requirements/Dockerfile b/images/requirements/Dockerfile
index fe201f0..1ba9f82 100644
--- a/images/requirements/Dockerfile
+++ b/images/requirements/Dockerfile
@@ -1,9 +1,5 @@
 FROM ubuntu
-ARG TARGETARCH
-ARG TARGETVARIANT
-RUN \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-var-cache-apt,sharing=locked,target=/var/cache/apt \
-    --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-var-lib-apt-lists,sharing=locked,target=/var/lib/apt/lists <<EOF bash -xe
+RUN <<EOF bash -xe
 apt-get update -qq
 apt-get install -qq -y --no-install-recommends ca-certificates git
 EOF
diff --git a/images/ubuntu/Dockerfile b/images/ubuntu/Dockerfile
index 46a9164..d776231 100644
--- a/images/ubuntu/Dockerfile
+++ b/images/ubuntu/Dockerfile
@@ -1,16 +1,2 @@
 FROM ubuntu
 LABEL org.opencontainers.image.source=https://github.com/vexxhost/atmosphere
-RUN <<EOF
-rm -f /etc/apt/apt.conf.d/docker-clean
-echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
-EOF
-
-# ARG TARGETARCH
-# ARG TARGETVARIANT
-# RUN \
-#     --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-var-cache-apt,sharing=locked,target=/var/cache/apt \
-#     --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT-var-lib-apt-lists,sharing=locked,target=/var/lib/apt/lists <<EOF bash -xe
-# apt-get update -qq
-# apt-get install -qq -y --no-install-recommends \
-#     # CVE-XXXX
-# EOF
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index b5c87b8..e1762f46 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -16,6 +16,7 @@
     name: atmosphere-build-images
     pre-run: zuul.d/playbooks/build-images/pre.yml
     run: zuul.d/playbooks/build-images/run.yml
+    ansible-split-streams: true
 
 - job:
     name: atmosphere-upload-images
diff --git a/zuul.d/playbooks/build-images/run.yml b/zuul.d/playbooks/build-images/run.yml
index 5da714a..68ad3a7 100644
--- a/zuul.d/playbooks/build-images/run.yml
+++ b/zuul.d/playbooks/build-images/run.yml
@@ -42,7 +42,7 @@
     - name: Set fact with list of images
       set_fact:
         images_built: "{{ images_built_json.stdout | from_json | json_query('target.*.tags[?@] | []') }}"
-      
+
     - name: Sign images
       when: zuul.pipeline == 'post'
       block: