From 934c75af4f14908ec9fb7db40553048d3806001d Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Wed, 3 Apr 2024 18:46:00 +0000 Subject: [PATCH 1/9] .github/workflows/ci: publish oci-tar-builder binary Signed-off-by: jiaxiao zhou --- .github/workflows/ci.yml | 4 ++-- Makefile | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 993de6be0..6e60ef0f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: strategy: matrix: os: ["ubuntu-22.04"] - runtime: ["common", "wasmtime", "wasmedge", "wasmer", "wamr"] + runtime: ["common", "wasmtime", "wasmedge", "wasmer", "wamr", "oci-tar-builder"] libc: ["musl", "gnu"] arch: ["x86_64", "aarch64"] uses: ./.github/workflows/action-build.yml @@ -71,7 +71,7 @@ jobs: strategy: matrix: os: ["windows-latest"] - runtime: ["common", "wasmtime", "wasmedge", "wasmer"] + runtime: ["common", "wasmtime", "wasmedge", "wasmer", "oci-tar-builder"] uses: ./.github/workflows/action-build.yml with: os: ${{ matrix.os }} diff --git a/Makefile b/Makefile index 310e83610..aae09e04f 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,10 @@ install-%: mkdir -p $(PREFIX)/bin $(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/containerd-shim-$*-v1 $(PREFIX)/bin/ +install-oci-tar-builder: build-oci-tar-builder + mkdir -p $(PREFIX)/bin + $(INSTALL) $(TARGET_DIR)/$(TARGET)/$(OPT_PROFILE)/oci-tar-builder $(PREFIX)/bin/ + .PHONY: dist dist-% dist: $(RUNTIMES:%=dist-%); From 6a6ad9c6a70ac73ef59dc482f5e8cf1c635f571e Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Wed, 3 Apr 2024 20:50:07 +0000 Subject: [PATCH 2/9] .github/workflows: move the oci-tar-builder build pipeline to action-build-oci-tar-builder.yml Signed-off-by: jiaxiao zhou --- .../action-build-oci-tar-builder.yml | 41 +++++++++++++++++++ .github/workflows/ci.yml | 13 +++++- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/action-build-oci-tar-builder.yml diff --git a/.github/workflows/action-build-oci-tar-builder.yml b/.github/workflows/action-build-oci-tar-builder.yml new file mode 100644 index 000000000..d232d324b --- /dev/null +++ b/.github/workflows/action-build-oci-tar-builder.yml @@ -0,0 +1,41 @@ +name: Build oci-tar-builder + +on: + workflow_call: + inputs: + os: + required: true + type: string + +jobs: + build: + name: build oci-tar-builder + runs-on: ${{ inputs.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + env: + RUST_CACHE_KEY_OS: rust-cache-${{ inputs.os }} + with: + rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile + - name: Build + run: make build-oci-tar-builder + - name: Run tests + timeout-minutes: 5 + run: | + make test-oci-tar-builder + - name: Package artifacts + shell: bash + run: | + make dist-oci-tar-builder + # Check if there's any files to archive as tar fails otherwise + if stat dist/bin/* >/dev/null 2>&1; then + tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -C dist/bin . + else + tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -T /dev/null + fi + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: oci-tar-builder-${{ inputs.os }} + path: dist/oci-tar-builder-${{ inputs.os }}.tar.gz diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e60ef0f3..6f5cb5dd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: strategy: matrix: os: ["ubuntu-22.04"] - runtime: ["common", "wasmtime", "wasmedge", "wasmer", "wamr", "oci-tar-builder"] + runtime: ["common", "wasmtime", "wasmedge", "wasmer", "wamr"] libc: ["musl", "gnu"] arch: ["x86_64", "aarch64"] uses: ./.github/workflows/action-build.yml @@ -71,12 +71,21 @@ jobs: strategy: matrix: os: ["windows-latest"] - runtime: ["common", "wasmtime", "wasmedge", "wasmer", "oci-tar-builder"] + runtime: ["common", "wasmtime", "wasmedge", "wasmer"] uses: ./.github/workflows/action-build.yml with: os: ${{ matrix.os }} runtime: ${{ matrix.runtime }} slug: "windows" + + build-oci-tar-builder: + name: oci-tar-builder-${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-22.04", "windows-latest", "macos-latest"] + uses: ./.github/workflows/action-build-oci-tar-builder.yml + with: + os: ${{ matrix.os }} smoke-tests: name: ${{ matrix.runtime }} From 10cac705445f4933865a2415fe864595d616ce10 Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Wed, 3 Apr 2024 21:04:17 +0000 Subject: [PATCH 3/9] added arm64 support for macos Signed-off-by: jiaxiao zhou --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f5cb5dd2..de86ca3e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: name: oci-tar-builder-${{ matrix.os }} strategy: matrix: - os: ["ubuntu-22.04", "windows-latest", "macos-latest"] + os: ["ubuntu-22.04", "windows-latest", "macos-14", "macos-12"] # macos-14 uses the arm64 architecture uses: ./.github/workflows/action-build-oci-tar-builder.yml with: os: ${{ matrix.os }} From 21f5f4b34f473a018cbb519722b37db7dd25e413 Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Sun, 17 Nov 2024 06:00:16 +0000 Subject: [PATCH 4/9] Makefile: fixed install-oci-tar-builder to use the correct path Signed-off-by: jiaxiao zhou --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index aae09e04f..cfb6b6115 100644 --- a/Makefile +++ b/Makefile @@ -146,9 +146,9 @@ install-%: mkdir -p $(PREFIX)/bin $(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/containerd-shim-$*-v1 $(PREFIX)/bin/ -install-oci-tar-builder: build-oci-tar-builder +install-oci-tar-builder: mkdir -p $(PREFIX)/bin - $(INSTALL) $(TARGET_DIR)/$(TARGET)/$(OPT_PROFILE)/oci-tar-builder $(PREFIX)/bin/ + $(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/oci-tar-builder $(PREFIX)/bin/ .PHONY: dist dist-% dist: $(RUNTIMES:%=dist-%); From 5181e5dd6bf52cd25aa5cd3a6aed87b40ec8a548 Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Sun, 17 Nov 2024 06:00:34 +0000 Subject: [PATCH 5/9] move action-build-oci-tar-builder to action-build Signed-off-by: jiaxiao zhou --- .../action-build-oci-tar-builder.yml | 41 ------------------- .github/workflows/action-build.yml | 15 +++++-- .github/workflows/ci.yml | 10 ++++- 3 files changed, 19 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/action-build-oci-tar-builder.yml diff --git a/.github/workflows/action-build-oci-tar-builder.yml b/.github/workflows/action-build-oci-tar-builder.yml deleted file mode 100644 index d232d324b..000000000 --- a/.github/workflows/action-build-oci-tar-builder.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build oci-tar-builder - -on: - workflow_call: - inputs: - os: - required: true - type: string - -jobs: - build: - name: build oci-tar-builder - runs-on: ${{ inputs.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - env: - RUST_CACHE_KEY_OS: rust-cache-${{ inputs.os }} - with: - rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile - - name: Build - run: make build-oci-tar-builder - - name: Run tests - timeout-minutes: 5 - run: | - make test-oci-tar-builder - - name: Package artifacts - shell: bash - run: | - make dist-oci-tar-builder - # Check if there's any files to archive as tar fails otherwise - if stat dist/bin/* >/dev/null 2>&1; then - tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -C dist/bin . - else - tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -T /dev/null - fi - - name: Upload artifacts - uses: actions/upload-artifact@master - with: - name: oci-tar-builder-${{ inputs.os }} - path: dist/oci-tar-builder-${{ inputs.os }}.tar.gz diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 566ef1348..49a6f9722 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -36,6 +36,13 @@ jobs: - name: describe runner run: | echo "::notice::Running job with os: '${{ inputs.os }}', arch: '${{ inputs.arch }}', slug: '${{ inputs.slug }}', runtime: '${{ inputs.runtime }}', target: '${{ inputs.target }}'" + - name: set runtime prefix + run: | + if [[ "${{ inputs.runtime }}" == "oci-tar-builder" ]]; then + echo "PREFIX=" >> $GITHUB_ENV + else + echo "PREFIX=containerd-shim-" >> $GITHUB_ENV + fi - uses: actions/checkout@v4 - name: Setup build env run: | @@ -73,13 +80,13 @@ jobs: make dist-${{ inputs.runtime }} # Check if there's any files to archive as tar fails otherwise if stat dist/bin/* >/dev/null 2>&1; then - tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . + tar -czf dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . else - tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null + tar -czf dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null fi - name: Upload artifacts if: ${{ inputs.runtime != 'common' }} uses: actions/upload-artifact@master with: - name: containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }} - path: dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz + name: ${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }} + path: dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de86ca3e8..6b290449d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,10 +82,16 @@ jobs: name: oci-tar-builder-${{ matrix.os }} strategy: matrix: - os: ["ubuntu-22.04", "windows-latest", "macos-14", "macos-12"] # macos-14 uses the arm64 architecture - uses: ./.github/workflows/action-build-oci-tar-builder.yml + os: ["ubuntu-22.04"] + arch: ["x86_64", "aarch64"] + uses: ./.github/workflows/action-build.yml with: os: ${{ matrix.os }} + runtime: "oci-tar-builder" + target: "${{ matrix.arch }}-unknown-linux-gnu" + slug: "${{ matrix.arch }}-linux-gnu" + arch: ${{ matrix.arch }} + sign: false smoke-tests: name: ${{ matrix.runtime }} From 45fe1036a15689191dc636a0e61a99e2a9707a72 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Mon, 18 Nov 2024 18:42:29 +0000 Subject: [PATCH 6/9] .github/workflows/action-build: force the script to use bash Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/action-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 49a6f9722..72cf09892 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -37,6 +37,7 @@ jobs: run: | echo "::notice::Running job with os: '${{ inputs.os }}', arch: '${{ inputs.arch }}', slug: '${{ inputs.slug }}', runtime: '${{ inputs.runtime }}', target: '${{ inputs.target }}'" - name: set runtime prefix + shell: bash run: | if [[ "${{ inputs.runtime }}" == "oci-tar-builder" ]]; then echo "PREFIX=" >> $GITHUB_ENV From 5d9c6544ceb44b4ae764301fe7fec1071e120d45 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Mon, 18 Nov 2024 20:44:54 +0000 Subject: [PATCH 7/9] .github/workflows/action-build: use '' Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/action-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 72cf09892..55812406d 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -81,13 +81,13 @@ jobs: make dist-${{ inputs.runtime }} # Check if there's any files to archive as tar fails otherwise if stat dist/bin/* >/dev/null 2>&1; then - tar -czf dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . + tar -czf dist/$PREFIX{{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . else - tar -czf dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null + tar -czf dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null fi - name: Upload artifacts if: ${{ inputs.runtime != 'common' }} uses: actions/upload-artifact@master with: - name: ${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }} - path: dist/${PREFIX}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz + name: $PREFIX${{ inputs.runtime }}-${{ inputs.slug }} + path: dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz From 574d020a309c1ca046623f73e3a61a55cbbcedd2 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Mon, 18 Nov 2024 22:22:58 +0000 Subject: [PATCH 8/9] .github/workflows/action-build: added the missing '$' Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/action-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 55812406d..73c7a8a01 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -81,7 +81,7 @@ jobs: make dist-${{ inputs.runtime }} # Check if there's any files to archive as tar fails otherwise if stat dist/bin/* >/dev/null 2>&1; then - tar -czf dist/$PREFIX{{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . + tar -czf dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . else tar -czf dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null fi From 2acf23f811eaa905aa79150dabbc451add91cb96 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Mon, 18 Nov 2024 23:32:26 +0000 Subject: [PATCH 9/9] .github/workflows: add a new input called binprefix Signed-off-by: Jiaxiao (mossaka) Zhou --- .github/workflows/action-build.yml | 20 ++++++++------------ .github/workflows/ci.yml | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 73c7a8a01..87cfdaf33 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -25,6 +25,10 @@ on: sign: default: false type: boolean + binprefix: + default: containerd-shim- + type: string + required: false jobs: build-sign-upload: @@ -36,14 +40,6 @@ jobs: - name: describe runner run: | echo "::notice::Running job with os: '${{ inputs.os }}', arch: '${{ inputs.arch }}', slug: '${{ inputs.slug }}', runtime: '${{ inputs.runtime }}', target: '${{ inputs.target }}'" - - name: set runtime prefix - shell: bash - run: | - if [[ "${{ inputs.runtime }}" == "oci-tar-builder" ]]; then - echo "PREFIX=" >> $GITHUB_ENV - else - echo "PREFIX=containerd-shim-" >> $GITHUB_ENV - fi - uses: actions/checkout@v4 - name: Setup build env run: | @@ -81,13 +77,13 @@ jobs: make dist-${{ inputs.runtime }} # Check if there's any files to archive as tar fails otherwise if stat dist/bin/* >/dev/null 2>&1; then - tar -czf dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . + tar -czf dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin . else - tar -czf dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null + tar -czf dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null fi - name: Upload artifacts if: ${{ inputs.runtime != 'common' }} uses: actions/upload-artifact@master with: - name: $PREFIX${{ inputs.runtime }}-${{ inputs.slug }} - path: dist/$PREFIX${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz + name: ${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }} + path: dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b290449d..a13d56ed7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,7 @@ jobs: slug: "${{ matrix.arch }}-linux-gnu" arch: ${{ matrix.arch }} sign: false + binprefix: "" smoke-tests: name: ${{ matrix.runtime }}