Skip to content

Commit 97d2b5a

Browse files
authored
Publish the docker image with tar/zip files (#1808)
And fix issue found in fast jit call indirect.
1 parent ca0b5cf commit 97d2b5a

File tree

4 files changed

+89
-38
lines changed

4 files changed

+89
-38
lines changed

.github/workflows/build_docker_images.yml

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ name: Create and publish Docker images
66
on:
77
workflow_call:
88
inputs:
9+
upload_url:
10+
description: upload binary assets to the URL of release
11+
type: string
12+
required: true
913
ver_num:
1014
description: a semantic version number.
1115
type: string
@@ -14,35 +18,72 @@ on:
1418
jobs:
1519
build-and-push-images:
1620
runs-on: ubuntu-22.04
17-
permissions:
18-
contents: read
19-
packages: write
2021

2122
steps:
2223
- name: Checkout repository
2324
uses: actions/checkout@v3
2425

25-
- name: Downcase github actor
26-
id: downcase_github_actor
27-
uses: ASzc/change-string-case-action@v2
26+
- name: Build and save Docker image(wasm-debug-server:${{ inputs.ver_num }}) to tar file
27+
run: |
28+
docker build -t wasm-debug-server:${{ inputs.ver_num }} .
29+
docker save -o wasm-debug-server.tar wasm-debug-server:${{ inputs.ver_num }}
30+
working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
31+
32+
- name: compress the tar file
33+
run: |
34+
tar czf wasm-debug-server-${{ inputs.ver_num }}.tar.gz wasm-debug-server.tar
35+
zip wasm-debug-server-${{ inputs.ver_num }}.zip wasm-debug-server.tar
36+
working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
37+
38+
- name: upload release tar.gz
39+
uses: actions/upload-release-asset@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2842
with:
29-
string: ${{ github.actor }}
43+
upload_url: ${{ inputs.upload_url }}
44+
asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.tar.gz
45+
asset_name: wasm-debug-server-${{ inputs.ver_num }}.tar.gz
46+
asset_content_type: application/x-gzip
3047

31-
- name: Login to the Container registry
32-
uses: docker/login-action@v2
48+
- name: upload release zip
49+
uses: actions/upload-release-asset@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3352
with:
34-
registry: ghcr.io
35-
username: ${{ steps.downcase_github_actor.outputs.lowercase }}
36-
password: ${{ secrets.GITHUB_TOKEN }}
53+
upload_url: ${{ inputs.upload_url }}
54+
asset_path: test-tools/wamr-ide/WASM-Debug-Server/Docker/wasm-debug-server-${{ inputs.ver_num }}.zip
55+
asset_name: wasm-debug-server-${{ inputs.ver_num }}.zip
56+
asset_content_type: application/zip
3757

38-
- name: Build and push Docker image(wasm-toolchain:${{ inputs.ver_num }}) to Container registry
58+
- name: Build and save Docker image(wasm-toolchain:${{ inputs.ver_num }}) to tar file
3959
run: |
40-
docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }} .
41-
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-toolchain:${{ inputs.ver_num }}
60+
docker build -t wasm-toolchain:${{ inputs.ver_num }} .
61+
docker save -o wasm-toolchain.tar wasm-toolchain:${{ inputs.ver_num }}
4262
working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
4363

44-
- name: Build and push Docker image(wasm-debug-server:${{ inputs.ver_num }}) to Container registry
64+
- name: compress the tar file
4565
run: |
46-
docker build -t ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }} .
47-
docker push ghcr.io/${{ steps.downcase_github_actor.outputs.lowercase }}/wasm-debug-server:${{ inputs.ver_num }}
48-
working-directory: test-tools/wamr-ide/WASM-Debug-Server/Docker
66+
tar czf wasm-toolchain-${{ inputs.ver_num }}.tar.gz wasm-toolchain.tar
67+
zip wasm-toolchain-${{ inputs.ver_num }}.zip wasm-toolchain.tar
68+
working-directory: test-tools/wamr-ide/WASM-Toolchain/Docker
69+
70+
- name: upload release tar.gz
71+
uses: actions/upload-release-asset@v1
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
upload_url: ${{ inputs.upload_url }}
76+
asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.tar.gz
77+
asset_name: wasm-toolchain-${{ inputs.ver_num }}.tar.gz
78+
asset_content_type: application/x-gzip
79+
80+
- name: upload release zip
81+
uses: actions/upload-release-asset@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
upload_url: ${{ inputs.upload_url }}
86+
asset_path: test-tools/wamr-ide/WASM-Toolchain/Docker/wasm-toolchain-${{ inputs.ver_num }}.zip
87+
asset_name: wasm-toolchain-${{ inputs.ver_num }}.zip
88+
asset_content_type: application/zip
89+

.github/workflows/release_process.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ jobs:
3737
echo "${extract_result}" >> $GITHUB_ENV
3838
echo "EOF" >> $GITHUB_ENV
3939
40-
- name: check output
41-
run: echo 'the release note is "${{ env.RELEASE_NOTE }}"'
42-
4340
- name: create a release
4441
id: create_release
4542
uses: actions/create-release@v1
@@ -163,8 +160,9 @@ jobs:
163160
needs: [create_tag, create_release]
164161
uses: ./.github/workflows/build_docker_images.yml
165162
with:
163+
upload_url: ${{ needs.create_release.outputs.upload_url }}
166164
ver_num: ${{ needs.create_tag.outputs.new_ver }}
167-
165+
168166
#
169167
# WAMR_LLDB
170168
release_wamr_lldb_on_ubuntu_2004:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,19 +624,19 @@ jit_compile_op_call_indirect(JitCompContext *cc, uint32 type_idx,
624624
NEW_CONST(I32, offset_of_local(n)));
625625
break;
626626
case VALUE_TYPE_I64:
627-
res = jit_cc_new_reg_I32(cc);
627+
res = jit_cc_new_reg_I64(cc);
628628
GEN_INSN(LDI64, res, argv, NEW_CONST(I32, 0));
629629
GEN_INSN(STI64, res, cc->fp_reg,
630630
NEW_CONST(I32, offset_of_local(n)));
631631
break;
632632
case VALUE_TYPE_F32:
633-
res = jit_cc_new_reg_I32(cc);
633+
res = jit_cc_new_reg_F32(cc);
634634
GEN_INSN(LDF32, res, argv, NEW_CONST(I32, 0));
635635
GEN_INSN(STF32, res, cc->fp_reg,
636636
NEW_CONST(I32, offset_of_local(n)));
637637
break;
638638
case VALUE_TYPE_F64:
639-
res = jit_cc_new_reg_I32(cc);
639+
res = jit_cc_new_reg_F64(cc);
640640
GEN_INSN(LDF64, res, argv, NEW_CONST(I32, 0));
641641
GEN_INSN(STF64, res, cc->fp_reg,
642642
NEW_CONST(I32, offset_of_local(n)));

test-tools/wamr-ide/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,35 @@ under `resource/debug/bin`.
3737
- Ubuntu Bionic 18.04(LTS)
3838
```
3939

40-
#### 3. Pull docker images from the registry(recommended) or build docker images on the host
40+
#### 3. Load docker images from the release tar file or build docker images on the host
4141

42-
##### 3.1 Pull docker images from registry
42+
##### 3.1 Load docker images from the release tar file
4343

44-
From now on, for each release, we have the same version tagged docker image pushed to GitHub package.
44+
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.
4545

46-
You could simply pull a certain version of docker images using the following commands:
46+
You could download the tar archive files for docker images from the release, and then load them using the following commands:
4747

4848
```sh
49-
# pull and retag wasm-toolchain
50-
docker pull ghcr.io/bytecodealliance/wasm-toolchain:{version number}
51-
docker tag ghcr.io/bytecodealliance/wasm-toolchain:{version number} wasm-toolchain:{version number}
52-
docker rmi ghcr.io/bytecodealliance/wasm-toolchain:{version number}
53-
# pull and retag wasm-debug-server
54-
docker pull ghcr.io/bytecodealliance/wasm-debug-server:{version number}
55-
docker tag ghcr.io/bytecodealliance/wasm-debug-server:{version number} wasm-debug-server:{version number}
56-
docker rmi ghcr.io/bytecodealliance/wasm-debug-server:{version number}
49+
# download the zip or tar.gz from release depending on your platform
50+
# decompress and get the tar file
51+
52+
# on Linux/MacOS, you could use tar
53+
tar xf wasm-toolchain-{version number}.tar.gz
54+
tar xf wasm-debug-server-{version number}.tar.gz
55+
# or you could use unzip
56+
unzip wasm-toolchain-{version number}.zip
57+
unzip wasm-debug-server-{version number}.zip
58+
# load wasm-toolchain
59+
docker load --input wasm-toolchain.tar
60+
# load wasm-debug-server
61+
docker load --input wasm-debug-server.tar
62+
63+
# on Windows, you could use any unzip software you like
64+
# then loading docker images using powershell or git bash
65+
# load wasm-toolchain
66+
docker load --input ./wasm-toolchain.tar
67+
# load wasm-debug-server
68+
docker load --input ./wasm-debug-server.tar
5769
```
5870

5971
##### 3.2 Build docker images on host

0 commit comments

Comments
 (0)