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

Hub cleanup, token storage, readme #52

Merged
merged 7 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ permissions:

env:
GAR_LOCATION: us-central1
DOCKERFILE: docker/${{ inputs.package }}/Dockerfile
PACKAGE: ${{ inputs.package }}
NAME: luxonis/modelconverter-${{ inputs.package }}
STEM: modelconverter-${{ inputs.package }}
Expand Down Expand Up @@ -80,6 +79,10 @@ jobs:

- name: Build image
run: |
DOCKERFILE="docker/${PACKAGE}/Dockerfile"
if [ $PACKAGE = "hailo" ]; then
DOCKERFILE="${DOCKERFILE}.internal"
fi
docker build -f "${DOCKERFILE}" -t "${LOCAL_NAME}" . --build-arg VERSION="${VERSION}"

- name: GHCR publish latest
Expand Down
243 changes: 139 additions & 104 deletions README.md

Large diffs are not rendered by default.

55 changes: 41 additions & 14 deletions docker/hailo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,68 @@
# This Dockerfile is intended for internal use only.
# If you want to build the Model Converter Docker image,
# please use the Dockerfile.public file instead.
FROM hailo_ai_sw_suite_2024-07:1
USER root

ARG VERSION=2.23.0
RUN rm -rf \
/local/workspace/tappas \
/opt/google \
/local/workspace/doc \
/local/workspace/hailort_examples \
/usr/share \
/usr/bin/docker* \
/usr/bin/containerd* \
/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/hailo_tutorials

FROM ghcr.io/luxonis/modelconverter-hailo:${VERSION}-base

ENV IN_DOCKER=
ENV VERSION=${VERSION}

COPY requirements.txt requirements.txt
COPY requirements.txt .

RUN <<EOF

set -e

pip install --upgrade pip
pip install -r requirements.txt
pip install --extra-index-url
https://developer.download.nvidia.com/compute/redist \
nvidia-dali-cuda110
pip install --extra-index-url \
https://developer.download.nvidia.com/compute/redist \
nvidia-dali-tf-plugin-cuda110

EOF

RUN <<EOF

set -e

pip install pip-autoremove

pip-autoremove -y \
torch \
jupyter \
plotly \
matplotlib \
ipython \
tensorboard \
pip-autoremove

pip install psutil
rm -rf ~/.cache

EOF

WORKDIR /app

COPY --link docker/hailo/entrypoint.sh /app/entrypoint.sh
COPY docker/hailo/entrypoint.sh /app/entrypoint.sh
COPY --link modelconverter /app/modelconverter/
COPY --link pyproject.toml /app/pyproject.toml

RUN <<EOF

set -e

echo "export SSL_CERT_FILE=$(python -m certifi)" \
> /etc/profile.d/certifi.sh

pip install -e . --no-deps --no-cache-dir
echo "export SSL_CERT_FILE=$(python -m certifi)" > /etc/profile.d/certifi.sh
chmod +x /app/entrypoint.sh

EOF


ENTRYPOINT ["/app/entrypoint.sh"]
41 changes: 41 additions & 0 deletions docker/hailo/Dockerfile.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This Dockerfile is intended for internal use only.
# If you want to build the Model Converter Docker image,
# please use the Dockerfile.public file instead.

ARG VERSION=2.23.0

FROM ghcr.io/luxonis/modelconverter-hailo:${VERSION}-base

ENV IN_DOCKER=
ENV VERSION=${VERSION}

COPY requirements.txt requirements.txt

RUN <<EOF

set -e

pip install --upgrade pip
pip install -r requirements.txt

EOF

WORKDIR /app

COPY --link docker/hailo/entrypoint.sh /app/entrypoint.sh
COPY --link modelconverter /app/modelconverter/
COPY --link pyproject.toml /app/pyproject.toml

RUN <<EOF

set -e

echo "export SSL_CERT_FILE=$(python -m certifi)" \
> /etc/profile.d/certifi.sh

pip install -e . --no-deps --no-cache-dir
chmod +x /app/entrypoint.sh

EOF

ENTRYPOINT ["/app/entrypoint.sh"]
68 changes: 0 additions & 68 deletions docker/hailo/Dockerfile.public

This file was deleted.

4 changes: 2 additions & 2 deletions modelconverter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def convert(
logger = logging.getLogger(__name__)
try:
init_dirs()
cfg, archive_cfg, _main_stage = get_configs(str(path), opts)
cfg, archive_cfg, _main_stage = get_configs(path, opts)
main_stage = main_stage or _main_stage
is_multistage = len(cfg.stages) > 1
if is_multistage and main_stage is None:
Expand Down Expand Up @@ -360,7 +360,7 @@ def convert(
if output_dir is not None:
args.extend(["--output-dir", output_dir])
if path is not None:
args.extend(["--path", str(path)])
args.extend(["--path", path])
if opts is not None:
args.extend(opts)
docker_exec(
Expand Down
Loading