diff --git a/.github/workflows/build-images-ssh.yml b/.github/workflows/build-images-ssh.yml index d612314..5dee016 100644 --- a/.github/workflows/build-images-ssh.yml +++ b/.github/workflows/build-images-ssh.yml @@ -42,16 +42,20 @@ jobs: - name: Sync repository to server run: | ssh gpuserver "mkdir -p /tmp/repo-${{ github.run_id }}" + sleep 1 scp -r ./* gpuserver:/tmp/repo-${{ github.run_id }}/ - name: Install uv on server run: | + sleep 1 ssh gpuserver "mkdir -p /tmp/uv-${{ github.run_id }} && curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh && mv ~/.local/bin/uv ~/.local/bin/uvx /tmp/uv-${{ github.run_id }}/" - name: Build ${{ matrix.image-type }} image on remote server id: build run: | + sleep 1 ssh -t gpuserver "cd /tmp/repo-${{ github.run_id }} && make build-${{ matrix.image-type }} BUILD_DIR=/tmp/vm-images-build-${{ github.run_id }} UV=/tmp/uv-${{ github.run_id }}/uv" + sleep 1 IMAGE_NAME=$(ssh gpuserver "cd /tmp/vm-images-build-${{ github.run_id }}-${{ matrix.image-type }} && ls -1 *.qcow2 2>/dev/null | head -1 | sed 's/.qcow2$//'") echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT @@ -59,12 +63,14 @@ jobs: id: upload if: success() && github.ref == 'refs/heads/main' run: | + sleep 1 IMAGE_TAGS="--tag name=${{ steps.build.outputs.image_name }} --tag environment=ci --tag project=conda-forge-gpu-ci --tag image-type=${{ matrix.image-type }} --tag build-job-url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} --tag commit-hash=${{ github.sha }} --tag branch=${{ github.ref_name }} --tag build-timestamp=$(date -u +%Y%m%d-%H%M%S)" ssh gpuserver "cd /tmp/repo-${{ github.run_id }} && make upload-${{ matrix.image-type }} BUILD_DIR=/tmp/vm-images-build-${{ github.run_id }} UV=/tmp/uv-${{ github.run_id }}/uv IMAGE_TAGS='$IMAGE_TAGS'" - name: Cleanup temp directories on server if: always() run: | + sleep 1 ssh gpuserver "cd /tmp/repo-${{ github.run_id }} && make clean BUILD_DIR=/tmp/vm-images-build-${{ github.run_id }} && cd / && rm -rf /tmp/repo-${{ github.run_id }} /tmp/uv-${{ github.run_id }}" || true - name: Add job summary