@@ -515,6 +515,87 @@ jobs:
515
515
516
516
See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
517
517
518
+ - name : Reboot instance
519
+ id : reboot_instance
520
+ run : |
521
+ ssh \
522
+ -o StrictHostKeyChecking=no \
523
+ -o UserKnownHostsFile=/dev/null \
524
+ -o LogLevel=ERROR \
525
+ exouser@$INSTANCE_IP \
526
+ 'sudo restart -r now'
527
+ sleep 5
528
+ function check_instance_ready {
529
+ ssh \
530
+ -o StrictHostKeyChecking=no \
531
+ -o UserKnownHostsFile=/dev/null \
532
+ -o LogLevel=ERROR \
533
+ exouser@$INSTANCE_IP \
534
+ 'true'
535
+ }
536
+ set +e
537
+ max_attempts=3
538
+ instance_ready=false
539
+ for attempt in $(seq 1 $max_attempts); do
540
+ echo "Checking if instance is ready ($attempt/$max_attempts)"
541
+ if check_instance_ready; then
542
+ instance_ready=true
543
+ echo "Instance '$INSTANCE_NAME' is ready."
544
+ break
545
+ else
546
+ echo "Instance '$INSTANCE_NAME' is not ready. Retrying in 5 seconds..."
547
+ sleep 5
548
+ fi
549
+ done
550
+ if ! $instance_ready; then
551
+ echo "::error ::Instance '$INSTANCE_NAME' is not ready after $max_attempts attempts to connect."
552
+ exit 1
553
+ fi
554
+ set -e
555
+ env :
556
+ INSTANCE_IP : ${{ steps.ip_create.outputs.floating_ip_address }}
557
+ INSTANCE_NAME : ${{ steps.define.outputs.instance_name }}
558
+
559
+ - name : comment (failed to create reboot instance)
560
+ if : ${{ steps.reboot_instance.outcome == 'failure' && failure() }}
561
+ uses :
peter-evans/[email protected]
562
+ with :
563
+ issue-number : ${{ github.event.issue.number }}
564
+ body : |
565
+ ### Instance Creation Results ❌
566
+
567
+ Failed to reboot instance **${{ steps.define.outputs.instance_name }}**.
568
+
569
+ See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
570
+
571
+ - name : Install Slicer extension dependencies
572
+ id : slicer_install_extension_dependencies
573
+ run : |
574
+ support_install_dir=/opt/instance-config-support
575
+ slicer_install_dir=/media/volume/MyData
576
+ ssh \
577
+ -o StrictHostKeyChecking=no \
578
+ -o UserKnownHostsFile=/dev/null \
579
+ -o LogLevel=ERROR \
580
+ exouser@$INSTANCE_IP \
581
+ 'DISPLAY=:1.0 $slicer_install_dir/Slicer/Slicer --disable-modules --python-script $support_install_dir/dist/slicer-install-extension-dependencies.py'
582
+ env :
583
+ INSTANCE_IP : ${{ steps.ip_create.outputs.floating_ip_address }}
584
+
585
+ - name : comment (failed to install Slicer extension dependencies)
586
+ if :
587
+ ${{ steps.slicer_install_extension_dependencies.outcome == 'failure'
588
+ && failure() }}
589
+ uses :
peter-evans/[email protected]
590
+ with :
591
+ issue-number : ${{ github.event.issue.number }}
592
+ body : |
593
+ ### Instance Creation Results ❌
594
+
595
+ Failed to install Slicer extension dependencies on instance **${{ steps.define.outputs.instance_name }}**.
596
+
597
+ See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
598
+
518
599
- name : Update Request Status Label
519
600
id : update-request-status-label
520
601
uses : ./.github/actions/update-request-status-label
0 commit comments