From 5d790ccf231a26b922fe5133773292b6f0e18f36 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 25 Nov 2024 19:47:28 -0500 Subject: [PATCH] fix: Update to MorphoCloud/MorphoCloudWorkflow@a09327d List of MorphoCloudWorkflow changes: ``` $ git shortlog b23226c..a09327d --no-merges Jean-Christophe Fillion-Robin (1): fix(create-instance): Check volume is effectively attached before copying ``` See https://github.com/MorphoCloud/MorphoCloudWorkflow/compare/b23226c...a09327d --- .github/workflows/create-instance.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index 78764417..bda0095f 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -446,6 +446,30 @@ jobs: - name: Copy installed files into attached volume id: copy_installed_files run: | + function check_mountpoint_ready { + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'mountpoint -q /media/volume/MyData' + } + max_attempts=5 + for attempt in $(seq 1 $max_attempts); do + echo "Checking if mount point is ready ($attempt/$max_attempts)" + check_mountpoint_ready + if check_mountpoint_ready; then + echo "Mount point /media/volume/MyData is ready." + break + else + echo "Mount point not ready. Retrying in 5 seconds..." + sleep 5 + fi + done + if ! check_mountpoint_ready; then + echo "::error ::Mount point /media/volume/MyData not ready after $((max_attempts * 5)) seconds." + exit 1 + fi ssh \ -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null \