-
Notifications
You must be signed in to change notification settings - Fork 179
DRAFT create workflow publishing onnx2circle debian package #15440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
162a442
Copy pub-circle-int-launchpad.yml for onnx2circle
shs-park c23f893
Upload the debian related files for onnx2circle package
shs-park dbd3de1
Workflow for onnx2circle package release
shs-park 62aef3d
Fix path of build
shs-park 27cae58
Disable test temporarily
shs-park d5958c8
Fix the formatting of trailer line
shs-park 3f4a09b
Fix path
shs-park 1ddf032
debug message
shs-park 7b8fc5c
Fix error in rules
shs-park d9cd21f
Install cmake
shs-park bbb137f
Enable jammy
shs-park cd1ee1b
Create PR after debian upload
shs-park e1fe46a
Re-format the trailer line
shs-park 5537c18
Move the location of circle-mlir's onnx2circle debian folder
shs-park 795ab4b
Delete the changelog file in the old path
shs-park 78a76d0
Enable test
shs-park 76c463a
Remove the link to the onnx2circle binary
shs-park 00e2cb3
Clean up env variable
shs-park File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,288 @@ | ||
| name: Publish onnx2circle to Launchpad | ||
|
|
||
| on: | ||
| # TODO turn on schedule | ||
| #schedule: | ||
| # # 05:00 AM (KST, UTC+9:00) Mon-Fri | ||
| # - cron: '00 20 * * 0-4' | ||
| workflow_dispatch: | ||
| inputs: | ||
| o2c_version: | ||
| description: 'The version of onnx2circle' | ||
| required: true | ||
| default: '0.2.0' | ||
| o2c_description: | ||
| description: 'Description of changelog for onnx2circle' | ||
| 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' | ||
| is_release: | ||
| description: 'Is this a release version? | ||
| Set to false to append date-based subversion. | ||
| (true/false)' | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| 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: | ||
| configure: | ||
| if: github.repository_owner == 'Samsung' || github.repository_owner == 'shs-park' | ||
| name: Set current date and time | ||
| # TODO change to the 'ubuntu-latest' | ||
| #runs-on: ubuntu-latest | ||
| runs-on: [ self-hosted, shs-park ] | ||
| outputs: | ||
| version: ${{ steps.set-datetime.outputs.version }} | ||
| br_version: ${{ steps.set-datetime.outputs.br_version }} | ||
| steps: | ||
| - name: Set date and time | ||
| id: set-datetime | ||
| run: | | ||
| base_version="${{ inputs.o2c_version }}" | ||
| is_release="${{ inputs.is_release }}" | ||
| if [[ "$is_release" == "true" ]]; then | ||
| version="${base_version}" | ||
| br_version="${base_version}" | ||
| else | ||
| release_date=$(date +%Y%m%d%H%M) | ||
| version="${base_version}~${release_date}" | ||
| br_version="${base_version}-${release_date}" | ||
| fi | ||
| echo "version=${version}" >> $GITHUB_OUTPUT | ||
| echo "br_version=${br_version}" >> $GITHUB_OUTPUT | ||
|
|
||
| debian-release: | ||
| needs: configure | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # TODO activate noble | ||
| - ubuntu_code: focal | ||
| ubuntu_vstr: u2004 | ||
| - ubuntu_code: jammy | ||
| ubuntu_vstr: u2204 | ||
| name: onnx2circle ubuntu ${{ matrix.ubuntu_code }} | ||
| # TODO change to the 'ubuntu-latest' | ||
| #runs-on: ubuntu-latest | ||
| runs-on: [ self-hosted, shs-park ] | ||
| container: | ||
| image: nnfw/circle-mlir-build-${{ matrix.ubuntu_vstr }}:latest | ||
| options: --user root | ||
| credentials: | ||
| username: ${{ secrets.NNFW_DOCKER_USERNAME }} | ||
| password: ${{ secrets.NNFW_DOCKER_TOKEN }} | ||
| env: | ||
| BUILD: build | ||
| INSTALL: build/Release.install | ||
| O2C_PREFIX: o2c | ||
| O2C_BUILDTYPE: Release | ||
| steps: | ||
| - name: Prepare, set distro versions | ||
| id: prepare | ||
| run: | | ||
| VERSION="${{ needs.configure.outputs.version }}~${{ matrix.ubuntu_code }}" | ||
| changes_file="onnx2circle_${VERSION}_source.changes" | ||
| tarball_file="onnx2circle_${VERSION}.orig.tar.xz" | ||
| echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||
| echo "changes_file=${changes_file}" >> $GITHUB_OUTPUT | ||
| echo "tarball_file=${tarball_file}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Install circle-interpreter | ||
| run: | | ||
| add-apt-repository ppa:circletools/nightly | ||
| apt update | ||
| apt install circle-interpreter | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # NOTE Docker image has pre-installed submodules in /workdir | ||
| # NOTE Docker image has pre-installed python packages | ||
| - name: Configure | ||
| run: | | ||
| cd circle-mlir | ||
| Python3_ROOT_DIR=/usr/bin cmake -B build/${{ env.O2C_BUILDTYPE }} -S ./ \ | ||
| -DCMAKE_INSTALL_PREFIX=build/${{ env.O2C_BUILDTYPE }}.install \ | ||
| -DCMAKE_BUILD_TYPE=${{ env.O2C_BUILDTYPE }} \ | ||
| -DCIRCLE_MLIR_WORKDIR=/workdir | ||
|
|
||
| - name: Build, test & install | ||
| env: | ||
| ONE_COMPILER_ROOT: /usr/share/circletools | ||
| run: | | ||
| cd circle-mlir | ||
| cmake --build build/${{ env.O2C_BUILDTYPE }} -j4 | ||
| # TODO enable test | ||
| # CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/${{ env.O2C_BUILDTYPE }} --verbose -- test | ||
| cmake --build build/${{ env.O2C_BUILDTYPE }} -j4 -- install | ||
|
|
||
| - name: Gather files | ||
| run: | | ||
| cd circle-mlir | ||
| mkdir -p ${{ env.O2C_PREFIX }} | ||
| cp -v ${{ env.INSTALL }}/bin/onnx2circle ./${{ env.O2C_PREFIX }}/. | ||
|
|
||
| - name: Update changelog | ||
| run: | | ||
| cd circle-mlir/${{ env.O2C_PREFIX }} | ||
| cp -rf ../infra/debian/onnx2circle ./debian | ||
| export DEBFULLNAME="${{ inputs.deb_fullname }}" | ||
| export DEBEMAIL="${{ inputs.deb_email }}" | ||
| dch -v "${{ steps.prepare.outputs.VERSION }}" \ | ||
| --distribution "${{ matrix.ubuntu_code }}" \ | ||
| "${{ inputs.o2c_description }}" -b | ||
|
|
||
| - name: Create original tarball | ||
| run: | | ||
| cd circle-mlir | ||
| tar -caf ${{ steps.prepare.outputs.tarball_file }} ${{ env.O2C_PREFIX }} | ||
|
|
||
| - name: Conditionally install cmake for debuild | ||
| run: | | ||
| if [ "${{ matrix.ubuntu_code }}" = "focal" ]; then | ||
| echo "Installing cmake for focal" | ||
| apt update | ||
| apt install -y cmake | ||
| fi | ||
|
|
||
| - name: Signing with debuild and debsign | ||
| run: | | ||
| cd circle-mlir/${{ env.O2C_PREFIX }} | ||
| rm -rf ~/.gnupg | ||
| echo -n "${{ secrets.GPG_NNFW_SIGNING_KEY }}" | base64 --decode | gpg --import | ||
| # get fingerprint | ||
| FPR=$(gpg --list-keys --with-colons | awk -F: '$1 == "fpr" { print $10; exit }') | ||
| echo "$FPR:6:" | gpg --import-ownertrust | ||
| debuild -S -us -uc | ||
| debsign -k${FPR} ../onnx2circle_*.changes | ||
|
|
||
| - name: Upload to Launchpad | ||
| run: | | ||
| cd circle-mlir | ||
| mkdir -p ~/.ssh | ||
| echo "${{ secrets.LAUNCHPAD_NNFW_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
| chmod 600 ~/.ssh/id_rsa | ||
| dput ppa:circletools/nightly ${{ steps.prepare.outputs.changes_file }} | ||
|
|
||
| - name: Upload artifact, onnx2circle | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: onnx2circle_${{ steps.prepare.outputs.VERSION }} | ||
| retention-days: 3 | ||
| path: | | ||
| circle-mlir/${{ steps.prepare.outputs.tarball_file }} | ||
|
|
||
| create-changelog-artifact: | ||
| needs: [ configure, debian-release ] | ||
| # TODO need to activate the branch condition | ||
| # if: ${{ success() && github.ref == 'refs/heads/master' }} | ||
| if: ${{ success() }} | ||
| # TODO change to the 'ubuntu-latest' | ||
| #runs-on: ubuntu-latest | ||
| runs-on: [ self-hosted, shs-park ] | ||
| env: | ||
| DEFAULT_DISTRO: jammy | ||
| steps: | ||
| - name: Download tarball, ${{ env.DEFAULT_DISTRO }} | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: onnx2circle_${{ needs.configure.outputs.version }}~${{ env.DEFAULT_DISTRO }} | ||
|
|
||
| - name: Copy changelogs | ||
| run: | | ||
| mkdir changelogs | ||
| mkdir ${{ env.DEFAULT_DISTRO }} | ||
| tar -axf onnx2circle_${{ needs.configure.outputs.version }}~${{ env.DEFAULT_DISTRO }}.orig.tar.xz \ | ||
| -C ${{ env.DEFAULT_DISTRO }} | ||
| cp ${{ env.DEFAULT_DISTRO }}/o2c/debian/changelog changelogs/changelog | ||
|
|
||
| - name: Upload artifact, changelogs | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: changelogs | ||
| retention-days: 3 | ||
| path: | | ||
| changelogs | ||
|
|
||
| create-pr-on-success: | ||
| needs: [ configure, create-changelog-artifact ] | ||
| # TODO need to activate the branch condition | ||
| # if: ${{ success() && github.ref == 'refs/heads/master' }} | ||
| if: ${{ success() }} | ||
| # TODO change to the 'ubuntu-latest' | ||
| #runs-on: ubuntu-latest | ||
| runs-on: [ self-hosted, shs-park ] | ||
| env: | ||
| BR_VERSION: ${{ needs.configure.outputs.br_version }} | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Prepare, set distro versions | ||
| id: prepare | ||
| run: | | ||
| VERSION="${{ needs.configure.outputs.version }}" | ||
| echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Git | ||
| run: | | ||
| git config --global user.name "Seungho Henry Park" | ||
| git config --global user.email "shs.park@samsung.com" | ||
|
|
||
| - name: Download tarball | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: changelogs | ||
|
|
||
| - name: Update the changelog file | ||
| run: | | ||
| cp changelog circle-mlir/infra/debian/onnx2circle/ | ||
|
|
||
| - name: Create PR branch and commit changelog | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| BRANCH=auto/update-o2c-changelog-${BR_VERSION} | ||
| git checkout -b ${BRANCH} | ||
| git add circle-mlir/infra/debian/onnx2circle/changelog | ||
| git commit -m "[circle-mlir/infra] Update changelog for onnx2circle" \ | ||
| -m "This updates the changelog for onnx2circle_${{ steps.prepare.outputs.VERSION }}." \ | ||
| -m "It is auto-generated PR from github workflow." \ | ||
| -m "" \ | ||
| -m "ONE-DCO-1.0-Signed-off-by: Seungho Henry Park <shs.park@samsung.com>" | ||
| git push origin ${BRANCH} | ||
|
|
||
| - name: Create PR | ||
| env: | ||
| GH_TOKEN: ${{ secrets.SHSPARK_GITHUB_TOKEN }} | ||
| run: | | ||
| BRANCH=auto/update-o2c-changelog-${BR_VERSION} | ||
| gh pr create \ | ||
| --title "[circle-mlir/infra] Update changelog for onnx2circle" \ | ||
| --body "$(cat <<EOF | ||
| This updates the changelog for onnx2circle_${{ steps.prepare.outputs.VERSION }}. | ||
| This PR includes updated changelog after successful debian build. | ||
| It is auto-generated PR from github workflow. | ||
|
|
||
| ONE-DCO-1.0-Signed-off-by: Seungho Henry Park <shs.park@samsung.com> | ||
| EOF | ||
| )" \ | ||
| --head "${BRANCH}" \ | ||
| --base "master" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| onnx2circle (0.2.0~202505190000~jammy) jammy; urgency=medium | ||
|
|
||
| * First onnx2circle Debian package release for developers. | ||
|
|
||
| -- On-device AI developers <nnfw@samsung.com> Mon, 26 May 2025 00:00:00 +0000 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 12 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| Source: onnx2circle | ||
| Section: devel | ||
| Priority: optional | ||
| Build-Depends: debhelper (>= 12), cmake | ||
| Maintainer: Neural Network Acceleration Solution Developers <nnfw@samsung.com> | ||
| Standards-Version: 4.5.0 | ||
| Homepage: https://github.com/Samsung/ONE | ||
|
|
||
| Package: onnx2circle | ||
| Architecture: amd64 | ||
| Depends: ${shlibs:Depends}, ${misc:Depends} | ||
| Description: ONNX to Circle model converter | ||
| Converts ONNX models into Samsung's Circle format. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
| Upstream-Name: onnx2circle | ||
| Source: https://github.com/Samsung/ONE | ||
| Comment: These binaries are built from the ONE project. | ||
|
|
||
| Files: * | ||
| Copyright: 2025 Samsung Electronics., Ltd. | ||
| License: Apache-2.0 | ||
| This package is licensed under the Apache License, Version 2.0. | ||
| . | ||
| On Debian systems, the full text of the Apache License Version 2.0 | ||
| can be found in: | ||
| /usr/share/common-licenses/Apache-2.0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # {FILES_TO_INSTALL} {DEST_DIR} | ||
| # bin | ||
| bin/onnx2circle usr/share/circletools/bin/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # bin | ||
| usr/share/circletools/bin/onnx2circle usr/bin/onnx2circle |
1 change: 1 addition & 0 deletions
1
circle-mlir/infra/debian/onnx2circle/onnx2circle.lintian-overrides
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| onnx2circle: binary-without-manpage |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/usr/bin/make -f | ||
|
|
||
| export NNCC_INSTALL_PREFIX=$(CURDIR) | ||
| export DEBIAN_PREFIX=$(CURDIR)/debian/tmp | ||
|
|
||
| %: | ||
| dh $@ | ||
|
|
||
| override_dh_auto_clean: | ||
| # Nothing to clean | ||
| true | ||
|
|
||
| override_dh_auto_configure: | ||
| # No configure step needed | ||
| true | ||
|
|
||
| override_dh_auto_build: | ||
| # No build step needed | ||
| true | ||
|
|
||
| override_dh_auto_test: | ||
| # No test step needed | ||
| true | ||
|
|
||
| override_dh_auto_install: | ||
| # copy the bin file | ||
| mkdir -p ${DEBIAN_PREFIX}/bin | ||
| cp ${NNCC_INSTALL_PREFIX}/onnx2circle ${DEBIAN_PREFIX}/bin/ | ||
|
|
||
| override_dh_shlibdeps: | ||
| dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info | ||
|
|
||
| override_dh_strip: | ||
| dh_strip --no-automatic-dbgsym | ||
|
|
||
| override_dh_builddeb: | ||
| dh_builddeb |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.0 (quilt) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| onnx2circle source: source-is-missing onnx2circle |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can increase the minor version as
0.3.0Internal repo released 0.2.0 but now we have higher llvm-project and onnx-mlir :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I will update the version to
0.3.0right after all PRs are landed.