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:
workflow_call:
inputs:
upload_url:
description: upload binary assets to the URL of release
type: string
required: true
ver_num:
description: a semantic version number.
type: string
@ -14,35 +18,72 @@ on:
jobs:
build-and-push-images:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Downcase github actor
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
- name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
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-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:
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
- name: Build and push Docker image(wasm-debug-server:${{ inputs.ver_num }}) to Container registry
- name: compress the tar file
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

View File

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

View File

@ -624,19 +624,19 @@ jit_compile_op_call_indirect(JitCompContext *cc, uint32 type_idx,
NEW_CONST(I32, offset_of_local(n)));
break;
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(STI64, res, cc->fp_reg,
NEW_CONST(I32, offset_of_local(n)));
break;
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(STF32, res, cc->fp_reg,
NEW_CONST(I32, offset_of_local(n)));
break;
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(STF64, res, cc->fp_reg,
NEW_CONST(I32, offset_of_local(n)));

View File

@ -37,23 +37,35 @@ under `resource/debug/bin`.
- 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
# 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