Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7224 Pull images parallel during deployment #1129

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

### Improvements

- Auth token, ip address, remote address, mobile number, email redacted/masked from server log
- Auth token, ip address, remote address, mobile number, email redacted/masked from server log.
- Improved deployment time by images download faster.

### Infrastructure breaking changes

Expand Down
27 changes: 14 additions & 13 deletions infrastructure/deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,23 @@ docker_stack_deploy() {
IMAGE_TAGS_TO_DOWNLOAD=$(get_docker_tags_from_compose_files "$COMPOSE_FILES_USED")

for tag in ${IMAGE_TAGS_TO_DOWNLOAD[@]}; do
if [[ $EXISTING_IMAGES == *"$tag"* ]]; then
echo "$tag already exists on the machine. Skipping..."
continue
fi

echo "Downloading $tag"

until configured_ssh "cd /opt/opencrvs && docker pull $tag"
do
echo "Server failed to download $tag. Retrying..."
sleep 5
done
{
if [[ $EXISTING_IMAGES == *"$tag"* ]]; then
echo "$tag already exists on the machine. Skipping..."
continue
fi
echo "Downloading $tag"
until configured_ssh "cd /opt/opencrvs && docker pull $tag"
do
echo "Server failed to download $tag. Retrying..."
sleep 5
done
} &
done
echo "Images download in process"
wait

echo "Updating docker swarm stack with new compose files"

configured_ssh 'cd /opt/opencrvs && \
docker stack deploy --prune -c '$(split_and_join " " " -c " "$(to_remote_paths $COMPOSE_FILES_USED)")' --with-registry-auth opencrvs'
}
Expand Down
Loading