From 1cd661b76001710402c39915e7decaa9c431e1ca Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 25 Nov 2024 16:43:55 -0500 Subject: [PATCH] fix: Update to MorphoCloud/MorphoCloudWorkflow@b23226c List of MorphoCloudWorkflow changes: ``` $ git shortlog 057c707..b23226c --no-merges Jean-Christophe Fillion-Robin (1): fix(create-instance): Ensure installed files are moved into attached volume ``` See https://github.com/MorphoCloud/MorphoCloudWorkflow/compare/057c707...b23226c --- .github/workflows/create-instance.yml | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/create-instance.yml b/.github/workflows/create-instance.yml index 66280583..78764417 100644 --- a/.github/workflows/create-instance.yml +++ b/.github/workflows/create-instance.yml @@ -376,6 +376,30 @@ jobs: attach_volume: ⏳ send_email: "" + - name: Rename MyData directory to MyData-tmp + id: rename_mydata + run: | + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'mv /media/volume/MyData /media/volume/MyData-tmp' + env: + INSTANCE_IP: ${{ steps.ip_create.outputs.floating_ip_address }} + + - name: comment (failed to rename MyData) + if: ${{ steps.rename_mydata.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 rename `/media/volume/MyData` to `/media/volume/MyData-tmp` for instance **${{ steps.define.outputs.instance_name }}**. + + See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: Attach Volume id: attach_volume run: | @@ -419,6 +443,30 @@ jobs: See details at https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + - name: Copy installed files into attached volume + id: copy_installed_files + run: | + ssh \ + -o StrictHostKeyChecking=no \ + -o UserKnownHostsFile=/dev/null \ + -o LogLevel=ERROR \ + exouser@$INSTANCE_IP \ + 'mv /media/volume/MyData-tmp/Slicer /media/volume/MyData/Slicer && mv /media/volume/MyData-tmp/dist /media/volume/MyData/dist' + env: + INSTANCE_IP: ${{ steps.ip_create.outputs.floating_ip_address }} + + - name: comment (failed to copy installed files from MyData-tmp to MyData) + if: ${{ steps.copy_installed_files.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 copy installed files from `/media/volume/MyData-tmp` to `/media/volume/MyData` for 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