From 47c907d41a752eecf5f35ebffe72d537007a4f3f Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 17 Dec 2021 13:20:48 +0300 Subject: [PATCH 1/2] Add dockerhub proxy --- docker/test/integration/runner/dockerd-entrypoint.sh | 4 ++-- docker/test/testflows/runner/dockerd-entrypoint.sh | 4 ++-- tests/ci/worker/ubuntu_style_check.sh | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/test/integration/runner/dockerd-entrypoint.sh b/docker/test/integration/runner/dockerd-entrypoint.sh index 5a021036b26..ad8a8e4eb84 100755 --- a/docker/test/integration/runner/dockerd-entrypoint.sh +++ b/docker/test/integration/runner/dockerd-entrypoint.sh @@ -8,8 +8,8 @@ echo '{ "ip-forward": true, "log-level": "debug", "storage-driver": "overlay2", - "insecure-registries" : ["dockerhub-proxy.sas.yp-c.yandex.net:5000"], - "registry-mirrors" : ["http://dockerhub-proxy.sas.yp-c.yandex.net:5000"] + "insecure-registries" : ["dockerhub-proxy.dockerhub-proxy-zone:5000"], + "registry-mirrors" : ["http://dockerhub-proxy.dockerhub-proxy-zone:5000"] }' | dd of=/etc/docker/daemon.json 2>/dev/null dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --default-address-pool base=172.17.0.0/12,size=24 &>/ClickHouse/tests/integration/dockerd.log & diff --git a/docker/test/testflows/runner/dockerd-entrypoint.sh b/docker/test/testflows/runner/dockerd-entrypoint.sh index 8abbd9e1c8e..0e15396082a 100755 --- a/docker/test/testflows/runner/dockerd-entrypoint.sh +++ b/docker/test/testflows/runner/dockerd-entrypoint.sh @@ -5,8 +5,8 @@ echo "Configure to use Yandex dockerhub-proxy" mkdir -p /etc/docker/ cat > /etc/docker/daemon.json << EOF { - "insecure-registries" : ["dockerhub-proxy.sas.yp-c.yandex.net:5000"], - "registry-mirrors" : ["http://dockerhub-proxy.sas.yp-c.yandex.net:5000"] + "insecure-registries" : ["dockerhub-proxy.dockerhub-proxy-zone:5000"], + "registry-mirrors" : ["http://dockerhub-proxy.dockerhub-proxy-zone:5000"] } EOF diff --git a/tests/ci/worker/ubuntu_style_check.sh b/tests/ci/worker/ubuntu_style_check.sh index 585c8610772..3fabbb1f8a4 100644 --- a/tests/ci/worker/ubuntu_style_check.sh +++ b/tests/ci/worker/ubuntu_style_check.sh @@ -53,7 +53,9 @@ usermod -aG docker ubuntu cat < /etc/docker/daemon.json { "ipv6": true, - "fixed-cidr-v6": "2001:db8:1::/64" + "fixed-cidr-v6": "2001:db8:1::/64", + "insecure-registries" : ["dockerhub-proxy.dockerhub-proxy-zone:5000"], + "registry-mirrors" : ["http://dockerhub-proxy.dockerhub-proxy-zone:5000"] } EOT From f02a40bbdcbfebf03f06994534da6e577947d566 Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 17 Dec 2021 13:48:42 +0300 Subject: [PATCH 2/2] Rename script and add template for dockerhub proxy --- tests/ci/worker/dockerhub_proxy_template.sh | 8 ++++++++ .../{ubuntu_style_check.sh => ubuntu_ami_for_ci.sh} | 0 2 files changed, 8 insertions(+) create mode 100644 tests/ci/worker/dockerhub_proxy_template.sh rename tests/ci/worker/{ubuntu_style_check.sh => ubuntu_ami_for_ci.sh} (100%) diff --git a/tests/ci/worker/dockerhub_proxy_template.sh b/tests/ci/worker/dockerhub_proxy_template.sh new file mode 100644 index 00000000000..5ee63a05125 --- /dev/null +++ b/tests/ci/worker/dockerhub_proxy_template.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -xeuo pipefail + +mkdir /home/ubuntu/registrystorage + +sed -i 's/preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg + +docker run -d --network=host -p 5000:5000 -v /home/ubuntu/registrystorage:/var/lib/registry -e REGISTRY_HTTP_ADDR=0.0.0.0:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io --restart=always --name registry registry:2 diff --git a/tests/ci/worker/ubuntu_style_check.sh b/tests/ci/worker/ubuntu_ami_for_ci.sh similarity index 100% rename from tests/ci/worker/ubuntu_style_check.sh rename to tests/ci/worker/ubuntu_ami_for_ci.sh