]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph*build: Login to docker.io if needed 1709/head
authorDavid Galloway <dgallowa@redhat.com>
Tue, 17 Nov 2020 22:08:06 +0000 (17:08 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Tue, 17 Nov 2020 22:20:31 +0000 (17:20 -0500)
We ran into an issue today where the internal mirror was temporarily unavailable.  The job fell back to docker.io and despite the fact that we're not using it all that much, we still got rate limited.  I suspect other tenants in the Community Cage are still pulling from docker.io anonymously.

This PR will have us login (with a higher rate-limit).

Signed-off-by: David Galloway <dgallowa@redhat.com>
ceph-dev-build/config/definitions/ceph-dev-build.yml
ceph-dev-new-build/config/definitions/ceph-dev-new-build.yml
scripts/build_utils.sh

index c973f1739be566698ebaafef8eabe1d73df2ed38..a74570c87593171f7befd9257b0be1be9bce5bbe 100644 (file)
               credential-id: dmick-quay
               username: CONTAINER_REPO_USERNAME
               password: CONTAINER_REPO_PASSWORD
+          - username-password-separated:
+              credential-id: dgalloway-docker-hub
+              username: DOCKER_HUB_USERNAME
+              password: DOCKER_HUB_PASSWORD
       - build-name:
           name: "#${BUILD_NUMBER} ${BRANCH}, ${SHA1}, ${DISTROS}, ${FLAVOR}"
 
index 6d5cfa7e7c8193c735879a99af46314c9dcee621..cff519462b7f87da9128841280332833e7b863dc 100644 (file)
               credential-id: dmick-quay
               username: CONTAINER_REPO_USERNAME
               password: CONTAINER_REPO_PASSWORD
+          - username-password-separated:
+              credential-id: dgalloway-docker-hub
+              username: DOCKER_HUB_USERNAME
+              password: DOCKER_HUB_PASSWORD
       - build-name:
           name: "#${BUILD_NUMBER} ${BRANCH}, ${SHA1}, ${DISTROS}, ${FLAVOR}"
index 27b888c8d47de7e3864f9de6fae162292cf60046..1c904e10d5620525ce8579ec966dd82a8121bfbd 100644 (file)
@@ -1304,6 +1304,9 @@ use_internal_container_registry() {
   if curl -s "https://docker-mirror.front.sepia.ceph.com:5000"; then
     REGISTRY="docker-mirror.front.sepia.ceph.com:5000/library"
   else
+    if [ -n "${DOCKER_HUB_USERNAME}" ] && [ -n "${DOCKER_HUB_PASSWORD}" ]; then
+      docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}" docker.io
+    fi
     REGISTRY="docker.io"
   fi
 }