Просмотр исходного кода

Publish the docker image with tar/zip files (#1808)

And fix issue found in fast jit call indirect.
Wenyong Huang 3 лет назад
Родитель
Сommit
97fda83c94

+ 60 - 19
.github/workflows/build_docker_images.yml

@@ -6,6 +6,10 @@ name: Create and publish Docker images
 on:
 on:
   workflow_call:
   workflow_call:
     inputs:
     inputs:
+      upload_url:
+        description: upload binary assets to the URL of release
+        type: string
+        required: true
       ver_num:
       ver_num:
         description: a semantic version number.
         description: a semantic version number.
         type: string
         type: string
@@ -14,35 +18,72 @@ on:
 jobs:
 jobs:
   build-and-push-images:
   build-and-push-images:
     runs-on: ubuntu-22.04
     runs-on: ubuntu-22.04
-    permissions:
-      contents: read
-      packages: write
 
 
     steps:
     steps:
       - name: Checkout repository
       - name: Checkout repository
         uses: actions/checkout@v3
         uses: actions/checkout@v3
 
 
-      - name: Downcase github actor
-        id: downcase_github_actor
-        uses: ASzc/change-string-case-action@v2
+      - name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
+        run: |
+          docker build -t wasm-debug-server:${{ inputs.ver_num }} .
+          docker save -o wasm-debug-server.tar wasm-debug-server:${{ inputs.ver_num }}
+        working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
+      
+      - name: compress the tar file
+        run: |
+          tar czf wasm-debug-server-${{ inputs.ver_num }}.tar.gz wasm-debug-server.tar
+          zip wasm-debug-server-${{ inputs.ver_num }}.zip wasm-debug-server.tar
+        working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
+
+      - name: upload release tar.gz
+        uses: actions/upload-release-asset@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
         with:
-          string: ${{ github.actor }}
+          upload_url: ${{ inputs.upload_url }}
+          asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.tar.gz
+          asset_name: wasm-debug-server-${{ inputs.ver_num }}.tar.gz
+          asset_content_type: application/x-gzip
 
 
-      - name: Login to the Container registry
-        uses: docker/login-action@v2
+      - name: upload release zip
+        uses: actions/upload-release-asset@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
         with:
-          registry: ghcr.io
-          username: ${{ steps.downcase_github_actor.outputs.lowercase }}
-          password: ${{ secrets.GITHUB_TOKEN }}
+          upload_url: ${{ inputs.upload_url }}
+          asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.zip
+          asset_name: wasm-debug-server-${{ inputs.ver_num }}.zip
+          asset_content_type: application/zip
 
 
-      - name: Build and push Docker image(wasm-toolchain:${{ inputs.ver_num }}) to Container registry
+      - name: Build and save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
         run: |
         run: |
-          docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }} .
-          docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }}
+          docker build -t wasm-toolchain:${{ inputs.ver_num }} .
+          docker save -o wasm-toolchain.tar wasm-toolchain:${{ inputs.ver_num }}
         working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
         working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
 
 
-      - name: Build and push Docker image(wasm-debug-server:${{ inputs.ver_num }}) to Container registry
+      - name: compress the tar file
         run: |
         run: |
-          docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }} .
-          docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }}
-        working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
+          tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
+          zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
+        working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
+
+      - name: upload release tar.gz
+        uses: actions/upload-release-asset@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          upload_url: ${{ inputs.upload_url }}
+          asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.tar.gz
+          asset_name: wasm-toolchain-${{ inputs.ver_num }}.tar.gz
+          asset_content_type: application/x-gzip
+
+      - name: upload release zip
+        uses: actions/upload-release-asset@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          upload_url: ${{ inputs.upload_url }}
+          asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.zip
+          asset_name: wasm-toolchain-${{ inputs.ver_num }}.zip
+          asset_content_type: application/zip
+          

+ 2 - 4
.github/workflows/release_process.yml

@@ -37,9 +37,6 @@ jobs:
           echo "${extract_result}" >> $GITHUB_ENV
           echo "${extract_result}" >> $GITHUB_ENV
           echo "EOF"               >> $GITHUB_ENV
           echo "EOF"               >> $GITHUB_ENV
 
 
-      - name: check output
-        run: echo 'the release note is "${{ env.RELEASE_NOTE }}"'
-
       - name: create a release
       - name: create a release
         id: create_release
         id: create_release
         uses: actions/create-release@v1
         uses: actions/create-release@v1
@@ -163,8 +160,9 @@ jobs:
     needs: [create_tag, create_release]
     needs: [create_tag, create_release]
     uses: ./.github/workflows/build_docker_images.yml
     uses: ./.github/workflows/build_docker_images.yml
     with:
     with:
+      upload_url: ${{ needs.create_release.outputs.upload_url }}
       ver_num: ${{ needs.create_tag.outputs.new_ver }}
       ver_num: ${{ needs.create_tag.outputs.new_ver }}
-    
+
   #
   #
   # WAMR_LLDB
   # WAMR_LLDB
   release_wamr_lldb_on_ubuntu_2004:
   release_wamr_lldb_on_ubuntu_2004:

+ 3 - 3
core/iwasm/fast-jit/fe/jit_emit_function.c

@@ -624,19 +624,19 @@ jit_compile_op_call_indirect(JitCompContext *cc, uint32 type_idx,
                          NEW_CONST(I32, offset_of_local(n)));
                          NEW_CONST(I32, offset_of_local(n)));
                 break;
                 break;
             case VALUE_TYPE_I64:
             case VALUE_TYPE_I64:
-                res = jit_cc_new_reg_I32(cc);
+                res = jit_cc_new_reg_I64(cc);
                 GEN_INSN(LDI64, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(LDI64, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(STI64, res, cc->fp_reg,
                 GEN_INSN(STI64, res, cc->fp_reg,
                          NEW_CONST(I32, offset_of_local(n)));
                          NEW_CONST(I32, offset_of_local(n)));
                 break;
                 break;
             case VALUE_TYPE_F32:
             case VALUE_TYPE_F32:
-                res = jit_cc_new_reg_I32(cc);
+                res = jit_cc_new_reg_F32(cc);
                 GEN_INSN(LDF32, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(LDF32, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(STF32, res, cc->fp_reg,
                 GEN_INSN(STF32, res, cc->fp_reg,
                          NEW_CONST(I32, offset_of_local(n)));
                          NEW_CONST(I32, offset_of_local(n)));
                 break;
                 break;
             case VALUE_TYPE_F64:
             case VALUE_TYPE_F64:
-                res = jit_cc_new_reg_I32(cc);
+                res = jit_cc_new_reg_F64(cc);
                 GEN_INSN(LDF64, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(LDF64, res, argv, NEW_CONST(I32, 0));
                 GEN_INSN(STF64, res, cc->fp_reg,
                 GEN_INSN(STF64, res, cc->fp_reg,
                          NEW_CONST(I32, offset_of_local(n)));
                          NEW_CONST(I32, offset_of_local(n)));

+ 24 - 12
test-tools/wamr-ide/README.md

@@ -37,23 +37,35 @@ under `resource/debug/bin`.
        - Ubuntu Bionic 18.04(LTS)
        - Ubuntu Bionic 18.04(LTS)
        ```
        ```
 
 
-#### 3. Pull docker images from the registry(recommended) or build docker images on the host
+#### 3. Load docker images from the release tar file or build docker images on the host
 
 
-##### 3.1 Pull docker images from registry
+##### 3.1 Load docker images from the release tar file
 
 
-From now on, for each release, we have the same version tagged docker image pushed to GitHub package.
+From now on, for each release, we have the same version tagged docker image saved as a tar file, which you can find and download in the release.
 
 
-You could simply pull a certain version of docker images using the following commands:
+You could download the tar archive files for docker images from the release, and then load them using the following commands:
 
 
 ```sh
 ```sh
-# pull and retag wasm-toolchain 
-docker pull ghcr.io/bytecodealliance/wasm-toolchain:{version number}
-docker tag ghcr.io/bytecodealliance/wasm-toolchain:{version number} wasm-toolchain:{version number}
-docker rmi ghcr.io/bytecodealliance/wasm-toolchain:{version number} 
-# pull and retag wasm-debug-server
-docker pull ghcr.io/bytecodealliance/wasm-debug-server:{version number}
-docker tag ghcr.io/bytecodealliance/wasm-debug-server:{version number} wasm-debug-server:{version number}
-docker rmi ghcr.io/bytecodealliance/wasm-debug-server:{version number}
+# download the zip or tar.gz from release depending on your platform 
+# decompress and get the tar file
+
+# on Linux/MacOS, you could use tar
+tar xf wasm-toolchain-{version number}.tar.gz
+tar xf wasm-debug-server-{version number}.tar.gz
+# or you could use unzip
+unzip wasm-toolchain-{version number}.zip
+unzip wasm-debug-server-{version number}.zip
+# load wasm-toolchain 
+docker load --input wasm-toolchain.tar
+# load wasm-debug-server
+docker load --input wasm-debug-server.tar
+
+# on Windows, you could use any unzip software you like 
+# then loading docker images using powershell or git bash
+# load wasm-toolchain 
+docker load --input ./wasm-toolchain.tar
+# load wasm-debug-server
+docker load --input ./wasm-debug-server.tar
 ```
 ```
 
 
 ##### 3.2 Build docker images on host
 ##### 3.2 Build docker images on host