From fbaa1e83347cdbb782f8587fcec5e65c23de9853 Mon Sep 17 00:00:00 2001 From: Bryan Beaudreault Date: Wed, 27 Mar 2024 09:09:32 -0400 Subject: [PATCH 1/2] HBASE-28455 do-release-docker fails to setup gpg agent proxy if proxy container is slow to start --- dev-support/create-release/do-release-docker.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dev-support/create-release/do-release-docker.sh b/dev-support/create-release/do-release-docker.sh index 4dcf0b2f1e26..245373f387a2 100755 --- a/dev-support/create-release/do-release-docker.sh +++ b/dev-support/create-release/do-release-docker.sh @@ -300,9 +300,22 @@ if [ "${HOST_OS}" == "DARWIN" ]; then "type=bind,src=${HOME}/.ssh/id_rsa.pub,dst=/home/${USER}/.ssh/authorized_keys,readonly" \ "${GPG_PROXY_MOUNT[@]}" \ "org.apache.hbase/gpg-agent-proxy:${IMGTAG}" + + KEYSCAN_OUTPUT_PATH="${WORKDIR}/gpg-agent-proxy.ssh-keyscan" + if [ -f "${KEYSCAN_OUTPUT_PATH}" ]; then + # cleanup first so that the below checks will work, in case this is a rerun. + rm $KEYSCAN_OUTPUT_PATH + fi + + log "Waiting for port 62222 to be available" + while [ ! -s "${KEYSCAN_OUTPUT_PATH}" ]; do + sleep 5 + ssh-keyscan -p 62222 localhost 2>/dev/null | sort > "${KEYSCAN_OUTPUT_PATH}" + done + log "Done - port 62222 is ready" + # gotta trust the container host - ssh-keyscan -p 62222 localhost 2>/dev/null | sort > "${WORKDIR}/gpg-agent-proxy.ssh-keyscan" - sort "${HOME}/.ssh/known_hosts" | comm -1 -3 - "${WORKDIR}/gpg-agent-proxy.ssh-keyscan" \ + sort "${HOME}/.ssh/known_hosts" | comm -1 -3 - "${KEYSCAN_OUTPUT_PATH}" \ > "${WORKDIR}/gpg-agent-proxy.known_hosts" if [ -s "${WORKDIR}/gpg-agent-proxy.known_hosts" ]; then log "Your ssh known_hosts does not include the entries for the gpg-agent proxy container." From f0234446e13a3be941fc478c2972cd15c5c33612 Mon Sep 17 00:00:00 2001 From: Bryan Beaudreault Date: Wed, 27 Mar 2024 09:50:15 -0400 Subject: [PATCH 2/2] fix shellcheck --- dev-support/create-release/do-release-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-support/create-release/do-release-docker.sh b/dev-support/create-release/do-release-docker.sh index 245373f387a2..d7fd8af31ec6 100755 --- a/dev-support/create-release/do-release-docker.sh +++ b/dev-support/create-release/do-release-docker.sh @@ -304,7 +304,7 @@ if [ "${HOST_OS}" == "DARWIN" ]; then KEYSCAN_OUTPUT_PATH="${WORKDIR}/gpg-agent-proxy.ssh-keyscan" if [ -f "${KEYSCAN_OUTPUT_PATH}" ]; then # cleanup first so that the below checks will work, in case this is a rerun. - rm $KEYSCAN_OUTPUT_PATH + rm "${KEYSCAN_OUTPUT_PATH}" fi log "Waiting for port 62222 to be available"