Build circle-interpreter #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build circle-interpreter | |
| on: | |
| # TODO turn on schedule | |
| #schedule: | |
| # # 05:00 AM (KST, UTC+9:00) Mon-Fri | |
| # - cron: '00 20 * * 0-4' | |
| workflow_dispatch: | |
| inputs: | |
| cirint_version: | |
| description: 'The version of circle-interpreter' | |
| required: true | |
| default: '1.30.0' | |
| cirint_description: | |
| description: 'Description of changelog for circle-interpreter' | |
| required: true | |
| deb_fullname: | |
| description: 'Full name of Debian package author' | |
| required: false | |
| default: 'On-device AI developers' | |
| deb_email: | |
| description: 'Email address of Debian package author' | |
| required: false | |
| default: 'nnfw@samsung.com' | |
| defaults: | |
| run: | |
| shell: bash | |
| # Cancel previous running jobs when pull request is updated | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| onecc-test: | |
| if: github.repository_owner == 'Samsung' || github.repository_owner == 'shs-park' | |
| strategy: | |
| matrix: | |
| # TODO activate jammy | |
| include: | |
| - ubuntu_code: focal | |
| ubuntu_ver: 2004 | |
| # TODO update comment ID, these are experimental IDs of issue #14669 | |
| comment_id: 2658267907 | |
| # - ubuntu_code: jammy | |
| # ubuntu_ver: 2204 | |
| # comment_id: 2658268060 | |
| # TODO change to the 'ubuntu-latest' | |
| #runs-on: ubuntu-latest | |
| runs-on: [ self-hosted, shs-park ] | |
| container: | |
| image: nnfw/one-devtools:${{ matrix.ubuntu_code }} | |
| options: --user root | |
| env: | |
| NNCC_BUILD: build | |
| NNCC_WORKSPACE: build/release | |
| NNCC_INSTALL_PREFIX: ${{ github.workspace }}/build/release.install | |
| CIRINTP_PREFIX: cirintp | |
| name: circle-interpreter ubuntu ${{ matrix.ubuntu_ver }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install required packages | |
| run: | | |
| apt-get update | |
| apt-get install curl | |
| - name: Build without test | |
| run: | | |
| CIR_INTP_ITEMS="angkor;cwrap;pepper-str;pepper-strcast;pepper-csv2vec;pp" | |
| CIR_INTP_ITEMS="${CIR_INTP_ITEMS};oops;loco;logo-core;logo;locop" | |
| CIR_INTP_ITEMS="${CIR_INTP_ITEMS};hermes;hermes-std;safemain;mio-circle08" | |
| CIR_INTP_ITEMS="${CIR_INTP_ITEMS};luci-compute;luci;luci-interpreter" | |
| CIR_INTP_ITEMS="${CIR_INTP_ITEMS};foder;arser;vconone;circle-interpreter" | |
| echo ${CIR_INTP_ITEMS} | |
| ./nncc configure \ | |
| -DENABLE_STRICT_BUILD=ON \ | |
| -DENABLE_TEST=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DEXTERNALS_BUILD_THREADS=$(nproc) \ | |
| -DCMAKE_INSTALL_PREFIX=${NNCC_INSTALL_PREFIX} \ | |
| -DBUILD_WHITELIST="${CIR_INTP_ITEMS}" | |
| ./nncc build -j$(nproc) | |
| cmake --build ${NNCC_WORKSPACE} -- install | |
| - name: Gather files | |
| run: | | |
| cd ${NNCC_BUILD} | |
| mkdir -p ${CIRINTP_PREFIX} | |
| cp -v ${NNCC_INSTALL_PREFIX}/bin/circle-interpreter ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libloco.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_env.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_import.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_interpreter.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_lang.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_logex.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_log.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_plan.so ./${CIRINTP_PREFIX}/. | |
| cp -v ${NNCC_INSTALL_PREFIX}/lib/libluci_profile.so ./${CIRINTP_PREFIX}/. | |
| # Doesn't actually need this step | |
| - name: Upload Artifact | |
| id: step-upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: circle_intp_${{ matrix.ubuntu_ver }} | |
| retention-days: 3 | |
| path: | | |
| ${{ env.NNCC_BUILD }}/${{ env.CIRINTP_PREFIX }}/ | |
| - name: Create debian package | |
| run: | | |
| cd ${{ env.NNCC_BUILD }}/${{ env.CIRINTP_PREFIX }} | |
| cp -rf ../../infra/debian/circle-interpreter ./debian | |
| release_date=$(date +%Y%m%d) | |
| version=${{ inputs.cirint_version }}~${release_date} | |
| export DEBFULLNAME="${{ inputs.deb_fullname }}" | |
| export DEBEMAIL="${{ inputs.deb_email }}" | |
| dch -v "${version}" --distribution "${{ matrix.ubuntu_code }}" "${{ inputs.cirint_description }}" -b | |
| cat debian/changelog # TODO remove this | |
| cd ../ | |
| tar -caf circle-interpreter_${version}.orig.tar.xz ${{ env.CIRINTP_PREFIX }} | |
| cd ${{ env.CIRINTP_PREFIX }} | |
| debuild -S -sa | |
| cd ../ | |
| ls -alh # TODO remove this | |
| mkdir -p ~/.ssh | |
| echo "${{ secrets.LAUNCHPAD_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| cat ~/.ssh/id_rsa | |
| # dput ppa:circletools/nightly circle-interpreter_${version}_source.changes | |
| # refer https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment | |
| # TODO update comment id from experiment to official | |
| # TODO enable update URL when key is available | |
| - name: Update URL | |
| if: false | |
| run: | | |
| exit(1) # TODO enable posting comments | |
| echo "Artifact URL is ${{ steps.step-upload.outputs.artifact-url }}" | |
| COMMENT_ADDR=https://api.github.com/repos/Samsung/ONE/issues/comments/${{ matrix.comment_id }} | |
| curl -L \ | |
| -X PATCH \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.COMMENT_UPDATE_KEY }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| ${COMMENT_ADDR} \ | |
| -d '{"body":"${{ steps.step-upload.outputs.artifact-url }}"}' |