Skip to content
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

Multiple Version Images #37

Merged
merged 37 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
46b9582
support for multiple tool versions
kozlov721 Sep 27, 2024
0bd200d
cleaned up rvc2 dockerfile
kozlov721 Sep 27, 2024
47d65e5
fixed version in convert command
kozlov721 Sep 27, 2024
47ebbc1
fixed missing libraries
kozlov721 Sep 27, 2024
32e3878
multi-version support for rvc4
kozlov721 Sep 27, 2024
b24037c
cleaned dockerfiles
kozlov721 Sep 27, 2024
9f6172e
removed unused commands
kozlov721 Sep 27, 2024
4bbfec9
updated publish actions to use versions
kozlov721 Sep 27, 2024
fef09d0
typo
kozlov721 Sep 30, 2024
f55b194
updated readme
kozlov721 Sep 30, 2024
bc51b62
updated hailo image
kozlov721 Oct 9, 2024
6a313c6
updated actions
kozlov721 Oct 9, 2024
e517741
fix shell build
kozlov721 Oct 9, 2024
0848fcc
updated tag
kozlov721 Oct 9, 2024
82cd711
fixed env
kozlov721 Oct 9, 2024
1eb2c36
fix readme
kozlov721 Oct 9, 2024
0ecc9e2
updated hailo public image
kozlov721 Oct 9, 2024
96a0ccd
changed hailo base tag
kozlov721 Oct 9, 2024
785ceef
updated dockerfiles
kozlov721 Oct 10, 2024
f1f49b1
Merge branch 'main' into feature/version-images
kozlov721 Oct 10, 2024
f7f571f
updated version
kozlov721 Oct 10, 2024
8ecc889
fixed failing docker build due to dynamic version
kozlov721 Oct 10, 2024
6b5880c
fixed --version
kozlov721 Oct 10, 2024
6b7dcd2
fixed mean/scale
kozlov721 Oct 10, 2024
031b46a
added mo 2021.4 patch
kozlov721 Oct 10, 2024
73231e6
fixed nn archive export for rvc2 2021.4
kozlov721 Oct 10, 2024
b73c4de
updated actions
kozlov721 Oct 10, 2024
f3291a5
fixed test action
kozlov721 Oct 10, 2024
5433862
added --tool-version argument to pytest
kozlov721 Oct 10, 2024
9a2d90e
fix infer version for tests
kozlov721 Oct 10, 2024
7959256
patching rvc3 mo
kozlov721 Oct 10, 2024
5339e1d
fixed tests
kozlov721 Oct 10, 2024
f0b12a4
fixed unittests
kozlov721 Oct 10, 2024
ec40a4f
fix tests
kozlov721 Oct 11, 2024
a80049e
fix rvc2 docker
kozlov721 Oct 11, 2024
cb4aa58
remove removing whl files
kozlov721 Oct 11, 2024
efe56e3
changed snpe versions
kozlov721 Oct 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/hailo_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ on:

jobs:
hailo-publish:

strategy:
fail-fast: false
matrix:
version: ["2024.04", "2024.07"]

uses: ./.github/workflows/publish.yaml
secrets: inherit
with:
package: hailo
version: ${{ matrix.version }}

7 changes: 7 additions & 0 deletions .github/workflows/hailo_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ on:

jobs:
hailo-test:

strategy:
fail-fast: false
matrix:
version: ["2024.04", "2024.07"]

uses: ./.github/workflows/modelconverter_test.yaml
secrets: inherit
with:
package: hailo
version: ${{ matrix.version }}

30 changes: 21 additions & 9 deletions .github/workflows/modelconverter_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
type: string
description: Which package to test

version:
required: true
type: string
description: >
Which version of underlying conversion tools to use

permissions:
contents: read
packages: read
Expand All @@ -17,6 +23,7 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT_URL: ${{ secrets.AWS_S3_ENDPOINT_URL }}
PACKAGE: ${{ inputs.package }}
VERSION: ${{ inputs.version }}

jobs:
tests:
Expand Down Expand Up @@ -53,19 +60,24 @@ jobs:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
token_format: access_token

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Download file from GCS
- name: Download build files from GCS
if: ${{ inputs.package }} != hailo
env:
GS_BUILD_ARTIFACTS: gs://luxonis-test-bucket/modelconverter/build-artifacts
run: |
mkdir -p docker/extra_packages
cd docker/extra_packages
if [ "$PACKAGE" = "rvc4" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/snpe.zip .
elif [ "$PACKAGE" = "rvc2" ] || [ "$PACKAGE" = "rvc3" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/openvino_2022_3_vpux_drop_patched.tar.gz .
if [ "${PACKAGE}" = "rvc4" ]; then
gcloud storage cp \
"${GS_BUILD_ARTIFACTS}/snpe-${VERSION}.zip" \
"snpe-${VERSION}.zip"
elif [ "${PACKAGE}" = "rvc2" ] || [ "${PACKAGE}" = "rvc3" ]; then
gcloud storage cp \
"${GS_BUILD_ARTIFACTS}/openvino-${VERSION}.tar.gz" \
"openvino-${VERSION}.tar.gz"
fi

- name: Run Tests
run: |
pytest -s --verbose "tests/test_packages/test_$PACKAGE.py"
pytest -s --verbose "tests/test_packages/test_${PACKAGE}.py" --tool-version "${VERSION}"

122 changes: 53 additions & 69 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@ on:
type: string
description: Which package to publish

version:
required: true
type: string
description: >
Which version of underlying conversion tools to use

permissions:
contents: read
packages: write

env:
PROJECT_ID: easyml-394818
GAR_LOCATION: us-central1
DOCKERFILE: docker/${{ inputs.package }}/Dockerfile
PACKAGE: ${{ inputs.package }}
NAME: luxonis/modelconverter-${{ inputs.package }}
STEM: modelconverter-${{ inputs.package }}
VERSION: ${{ inputs.version }}
GS_BUILD_ARTIFACTS: gs://luxonis-test-bucket/modelconverter/build-artifacts
GAR_STEM: us-central1-docker.pkg.dev/easyml-394818

jobs:
ghcr-publish:
runs-on: ubuntu-latest
env:
LOCAL_NAME: ${NAME}:${VERSION}-latest

steps:
- name: Checkout code
Expand All @@ -35,58 +45,6 @@ jobs:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
token_format: access_token

- name: Docker login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get modelconverter version
id: commit
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Download file from GCS
run: |
cd docker/extra_packages
if [ "$PACKAGE" = "rvc4" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/snpe.zip snpe.zip
elif [ "$PACKAGE" = "rvc2" ] || [ "$PACKAGE" = "rvc3" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/openvino_2022_3_vpux_drop_patched.tar.gz openvino_2022_3_vpux_drop_patched.tar.gz
fi
- name: Publish latest
run: |
docker build -f $DOCKERFILE -t $NAME:latest .
docker tag $NAME:latest ghcr.io/$NAME:latest
docker push ghcr.io/$NAME:latest

- name: Publish tagged
run: |
VERSION=${{ steps.commit.outputs.sha }}
docker tag $NAME:latest ghcr.io/$NAME:$VERSION
docker push ghcr.io/$NAME:$VERSION

gar-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get modelconverter version
id: commit
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Authenticate to Google Cloud
id: google-auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
token_format: access_token

- name: Docker login to GAR
uses: docker/login-action@v3
with:
Expand All @@ -104,30 +62,56 @@ jobs:
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Download file from GCS
- name: Download build files from GCS
if: ${{ inputs.package }} != hailo
run: |
cd docker/extra_packages
if [ "$PACKAGE" = "rvc4" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/snpe.zip .
elif [ "$PACKAGE" = "rvc2" ] || [ "$PACKAGE" = "rvc3" ]; then
gsutil cp gs://luxonis-test-bucket/modelconverter/build-artifacts/openvino_2022_3_vpux_drop_patched.tar.gz .
gcloud storage cp \
"${GS_BUILD_ARTIFACTS}/snpe-${VERSION}.zip" \
"snpe-${VERSION}.zip"
elif [ "${PACKAGE}" = "rvc2" ] || [ "${PACKAGE}" = "rvc3" ]; then
gcloud storage cp \
"${GS_BUILD_ARTIFACTS}/openvino-${VERSION}.tar.gz" \
"openvino-${VERSION}.tar.gz"
fi

- name: Publish
- name: Build image
run: |
docker build -f "${DOCKERFILE}" -t "${LOCAL_NAME}" .

- name: GHCR publish latest
run: |
docker build -f $DOCKERFILE -t $NAME:latest .
GHCR_NAME="ghcr.io/${LOCAL_NAME}"
docker tag "${LOCAL_NAME}" "${GHCR_NAME}"
docker push "${GHCR_NAME}"

VERSION=${{ steps.commit.outputs.sha }}
GAR_NAME="$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/internal/$STEM"
- name: GHCR publish SHA
run: |
SHA=$(git rev-parse --short HEAD)
GHCR_NAME="ghcr.io/${NAME}:${VERSION}-${SHA}"
docker tag "${LOCAL_NAME}" "${GHCR_NAME}"
docker push "${GHCR_NAME}"

for tag in latest $VERSION; do
docker tag "$NAME:latest" "$GAR_NAME:$tag"
docker push "$GAR_NAME:$tag"
done
- name: GAR publish latest
run: |
GAR_NAME="${GAR_STEM}/internal/${STEM}:${VERSION}-latest"
docker tag "${LOCAL_NAME}" "${GAR_NAME}"
docker push "${GAR_NAME}"

- name: GAR publish SHA
run: |
SHA=$(git rev-parse --short HEAD)
GAR_NAME="${GAR_STEM}/internal/${STEM}:${VERSION}-${SHA}"
docker tag "${LOCAL_NAME}" "${GAR_NAME}"
docker push "${GAR_NAME}"

- name: GAR publish clients
run: |
read -r -a REPO_ARRAY <<< "${{ vars.EXTERNAL_CLIENTS }}"

IFS=' ' read -r -a REPO_ARRAY <<< "${{ vars.EXTERNAL_CLIENTS }}"
for REPO in "${REPO_ARRAY[@]}"; do
GAR_CLIENT_TAG="$GAR_LOCATION-docker.pkg.dev/$PROJECT_ID/$REPO/$STEM:$VERSION"
docker tag "$NAME:latest" "$GAR_CLIENT_TAG"
docker push "$GAR_CLIENT_TAG"
GAR_CLIENT_NAME="${GAR_STEM}/${REPO}/${STEM}:${VERSION}-${SHA}"
docker tag "${LOCAL_NAME}" "${GAR_CLIENT_NAME}"
docker push "${GAR_CLIENT_NAME}"
done
7 changes: 7 additions & 0 deletions .github/workflows/rvc2_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ on:

jobs:
rvc2-publish:

strategy:
fail-fast: false
matrix:
version: ["2021.4.0", "2022.3.0"]

uses: ./.github/workflows/publish.yaml
secrets: inherit
with:
package: rvc2
verison: ${{ matrix.version }}
7 changes: 7 additions & 0 deletions .github/workflows/rvc2_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ on:

jobs:
rvc2-test:

strategy:
fail-fast: false
matrix:
version: ["2021.4.0", "2022.3.0"]

uses: ./.github/workflows/modelconverter_test.yaml
secrets: inherit
with:
package: rvc2
version: ${{ matrix.version }}
1 change: 1 addition & 0 deletions .github/workflows/rvc3_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
secrets: inherit
with:
package: rvc3
version: "2022.3.0"
1 change: 1 addition & 0 deletions .github/workflows/rvc3_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
secrets: inherit
with:
package: rvc3
version: "2022.3.0"
12 changes: 12 additions & 0 deletions .github/workflows/rvc4_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ on:

jobs:
rvc4-publish:

strategy:
fail-fast: false
matrix:
version:
- "2.23.0"
- "2.24.0"
- "2.25.0"
- "2.26.2"
- "2.27.0"

uses: ./.github/workflows/publish.yaml
secrets: inherit
with:
package: rvc4
version: ${{ matrix.version }}
12 changes: 12 additions & 0 deletions .github/workflows/rvc4_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ on:

jobs:
rvc4-test:

strategy:
fail-fast: false
matrix:
version:
- "2.23.0"
- "2.24.0"
- "2.25.0"
- "2.26.2"
- "2.27.0"

uses: ./.github/workflows/modelconverter_test.yaml
secrets: inherit
with:
package: rvc4
version: ${{ matrix.version }}
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,33 @@ Otherwise follow the installation instructions for your OS from the [official we

`ModelConverter` is in an experimental public beta stage. Some parts might change in the future.

To build the images, you need to download additional packages depending on the selected target.
To build the images, you need to download additional packages depending on the selected target and the desired version of the underlying conversion tools.

**RVC2 and RVC3**
**RVC2**

Requires `openvino_2022_3_vpux_drop_patched.tar.gz` to be present in `docker/extra_packages`.
You can download the archive [here](https://drive.google.com/file/d/1IXtYi1Mwpsg3pr5cDXlEHdSUZlwJRTVP/view?usp=share_link).
Requires `openvino-<version>.tar.gz` to be present in `docker/extra_packages/`.

- Version `2023.2.0` archive can be downloaded from [here](https://drive.google.com/file/d/1IXtYi1Mwpsg3pr5cDXlEHdSUZlwJRTVP/view?usp=share_link).

- Version `2021.4.0` archive can be downloaded from [here](https://storage.openvinotoolkit.org/repositories/openvino/packages/2021.4/l_openvino_toolkit_dev_ubuntu20_p_2021.4.582.tgz)

You only need to rename the archive to either `openvino-2023.2.0.tar.gz` or `openvino-2021.4.0.tar.gz` and place it in the `docker/extra_packages` directory.

**RVC3**

Only the version `2023.2.0` of `OpenVino` is supported for `RVC3`. Follow the instructions for `RVC2` to use the correct archive.

**RVC4**

Requires `snpe.zip` archive to be present in `docker/extra_packages`. You can download an archive with the current version [here](https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.23.0.24.06.24.zip). You only need to rename it to `snpe.zip` and place it in the `docker/extra_packages` directory.
Requires `snpe-<version>.zip` archive to be present in `docker/extra_packages`. You can download version `2.23.0` from [here](https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.23.0.24.06.24.zip). You only need to rename it to `snpe-2.23.0.zip` and place it in the `docker/extra_packages` directory.

**HAILO**

Requires `hailo_ai_sw_suite_2024-04:1` docker image to be present on the system. You can download the image from the [Hailo website](https://developer.hailo.ai/developer-zone/sw-downloads/). Furthermore, you need to use the `docker/hailo/Dockerfile.public` file to build the image. The `docker/hailo/Dockerfile` is for internal use only.
Requires `hailo_ai_sw_suite_<version>:1` docker image to be present on the system. You can obtain the image by following the instructions on [Hailo website](https://developer.hailo.ai/developer-zone/sw-downloads/).

After you obtain the image, you need to rename it to `hailo_ai_sw_suite_<version>:1` using `docker tag <old_name> hailo_ai_sw_suite_<version>:1`.

Furthermore, you need to use the `docker/hailo/Dockerfile.public` file to build the image. The `docker/hailo/Dockerfile` is for internal use only.

### Instructions

Expand Down
Loading