From d38faa1f30a7516f9c561ee039c8ffb1a74b0363 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sun, 15 Dec 2024 18:29:35 -0500 Subject: [PATCH] fix: Update to MorphoCloud/MorphoCloudWorkflow@15ca13a List of MorphoCloudWorkflow changes: ``` $ git shortlog 2dbdd12..15ca13a --no-merges Jean-Christophe Fillion-Robin (1): fix(create-instance): Reboot to ensure correct torch version is installed ``` See https://github.com/MorphoCloud/MorphoCloudWorkflow/compare/2dbdd12...15ca13a --- .github/workflows/create-instance.yml | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index ce531511..87d0fd28 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -515,6 +515,62 @@ jobs: See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: Reboot instance + id: reboot_instance + run: | + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'sudo shutdown -r now || true' + + sleep 10 + function check_instance_ready { + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'true' + } + set +e + max_attempts=3 + instance_ready=false + for attempt in $(seq 1 $max_attempts); do + echo "Checking if instance is ready ($attempt/$max_attempts)" + if check_instance_ready; then + instance_ready=true + echo "Instance '$INSTANCE_NAME' is ready." + break + else + echo "Instance '$INSTANCE_NAME' is not ready. Retrying in 5 seconds..." + sleep 10 + fi + done + if ! $instance_ready; then + echo "::error ::Instance '$INSTANCE_NAME' is not ready after $max_attempts attempts to connect." + exit 1 + fi + set -e + env: + INSTANCE_IP: ${{ steps.ip_create.outputs.floating_ip_address }} + INSTANCE_NAME: ${{ steps.define.outputs.instance_name }} + + - name: comment (failed to install Slicer extension dependencies) + if: + ${{ steps.slicer_install_extension_dependencies.outcome == 'failure' + && failure() }} + uses: peter-evans/create-or-update-comment@v4.0.0 + with: + issue-number: ${{ github.event.issue.number }} + body: | + ### Instance Creation Results ❌ + + Failed to install Slicer extension dependencies on instance **${{ steps.define.outputs.instance_name }}**. + + See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: Update Request Status Label id: update-request-status-label uses: ./.github/actions/update-request-status-label