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

And fix issue found in fast jit call indirect.
This commit is contained in:
Wenyong Huang 2022-12-14 09:42:03 +08:00 committed by GitHub
parent ca0b5cf816
commit 97d2b5a060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 93 additions and 42 deletions

View File

@ -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 - name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
id: downcase_github_actor
uses: ASzc/change-string-case-action@v2
with:
string: ${{ github.actor }}
- name: Login to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ steps.downcase_github_actor.outputs.lowercase }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image(wasm-toolchain:${{ inputs.ver_num }}) to Container registry
run: | run: |
docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }} . docker build -t wasm-debug-server:${{ inputs.ver_num }} .
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ 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:
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: 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-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 save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
run: |
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 }} . tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }} zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker 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

View File

@ -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,6 +160,7 @@ 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 }}
# #

View File

@ -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)));

View File

@ -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 # download the zip or tar.gz from release depending on your platform
docker pull ghcr.io/bytecodealliance/wasm-toolchain:{version number} # decompress and get the tar file
docker tag ghcr.io/bytecodealliance/wasm-toolchain:{version number} wasm-toolchain:{version number}
docker rmi ghcr.io/bytecodealliance/wasm-toolchain:{version number} # on Linux/MacOS, you could use tar
# pull and retag wasm-debug-server tar xf wasm-toolchain-{version number}.tar.gz
docker pull ghcr.io/bytecodealliance/wasm-debug-server:{version number} tar xf wasm-debug-server-{version number}.tar.gz
docker tag ghcr.io/bytecodealliance/wasm-debug-server:{version number} wasm-debug-server:{version number} # or you could use unzip
docker rmi ghcr.io/bytecodealliance/wasm-debug-server:{version number} 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