ci: clean up and fixes (#5054)

* ci: remove unused helper script

* ci: update CI machine images

Try to fix error a la:

```text
error: failed to solve: failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: failed to copy: httpReadSeeker: failed open: failed to do request: Get "https://docker-images-prod.s3.dualstack.us-east-1.amazonaws.com/registry-v2/docker/registry/v2/blobs/sha256/...": dial tcp 52.216.28.112:443: i/o timeout
```

See https://discuss.circleci.com/t/increased-rate-of-errors-when-pulling-docker-images-on-machine-executor/42094/9
pull/24376/head
Marco Neumann 2022-07-06 16:47:50 +02:00 committed by GitHub
parent 425b8a63cf
commit e84e1f3de2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 59 deletions

View File

@ -342,7 +342,7 @@ jobs:
# need a machine executor to have a full-powered docker daemon (the `setup_remote_docker` system just provides a
# kinda small node)
machine:
image: ubuntu-2004:202111-01
image: ubuntu-2004:202201-02
resource_class: xlarge # use of a smaller executor tends crashes on link
environment:
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
@ -442,7 +442,7 @@ jobs:
# - we only run this job once a day, so the additional startup delay of 30-60s doesn't really matter
machine:
# https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
image: ubuntu-2004:202107-02
image: ubuntu-2004:202201-02
resource_class: xlarge
steps:
- checkout

View File

@ -1,57 +0,0 @@
#!/usr/bin/env bash
#
# Produce a deploy JSON file for a docker image on the host.
#
# Usage:
# ./get-deploy-tags DOCKER_TAG_NAME
#
# For example, if building a docker image with a tag set:
# docker build -t infuxdata.io/iox:awesome
# or manually tagged:
# docker tag infuxdata.io/iox:build infuxdata.io/iox:awesome:awesome
#
# And the image is on the host, executing this script with:
# ./get-deploy-tags "awesome"
#
# Will generate the deployment JSON file and output it to stdout. If
# IMAGE_PROMOTION_COMMAND is set in the environment, the deployment JSON file is
# piped to it at the end of execution.
#
set -euo pipefail
DOCKER_IMAGE_TAG=${1}
DOCKER_IMAGE="quay.io/influxdb/iox"
APP_NAME="IOx"
DOCKER_IMAGE_DIGEST="$(docker image inspect "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}" --format '{{ if eq (len .RepoDigests) 1 }}{{index .RepoDigests 0}}{{ end }}')"
# validate that only one image with same git sha as tag is present, if not,
# write an error out and request developers to manually re-run the workflow
if [ "${DOCKER_IMAGE_DIGEST}" = "" ] ; then
echo >&2 "Unable to determine unique SHA256 checksum of images."
echo >&2 ""
echo >&2 "Please re-run the workflow in CircleCI."
exit 1
fi
jq --null-input --sort-keys \
--arg imgTag "${DOCKER_IMAGE}:${DOCKER_IMAGE_TAG}" \
--arg imgDigest "${DOCKER_IMAGE_DIGEST}" \
--arg appKey "$APP_NAME" \
'{
Images: {
($appKey): {
Tag: $imgTag,
Digest: $imgDigest,
},
},
PublishedAt: (now | todateiso8601)
}' | tee deploy.json
echo ""
if [[ -z "${IMAGE_PROMOTION_COMMAND}" ]]; then
echo "Skipping image promotion (IMAGE_PROMOTION_COMMAND not set)"
else
echo "Triggering image promotion"
eval "${IMAGE_PROMOTION_COMMAND}" < deploy.json
fi