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

Integrate GenAI into OV Docker images #312

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ed11740
Initial commit
artanokhov Aug 26, 2024
9d1eb46
arg_parser: Fixed regex for new GenAI archives
artanokhov Aug 26, 2024
b809b30
Add more debug for arg_parser
artanokhov Aug 26, 2024
f6015ec
Replaced f-string with format because of old py version.
artanokhov Aug 26, 2024
28d2c30
Reworked regex. Updated debug info
artanokhov Aug 26, 2024
29c7a73
Fixed regex. Reworked whole script with black linter
artanokhov Aug 26, 2024
e95af96
Updated copy.dockerfile with possible tar.gz extension instead of tgz
artanokhov Aug 26, 2024
f438fb0
Fixed wheels version install for openvino-tokenizers & openvino-genai
artanokhov Aug 26, 2024
207d37d
arg_parser: Fixed regex for build_id
artanokhov Aug 30, 2024
6140efc
Reset changes for RHEL
artanokhov Sep 3, 2024
b93e772
Fixed installing OV wheels for RHEL8 dev image in case of OPENVINO_WH…
artanokhov Sep 3, 2024
aaddd2b
Fixed find cmd for installing from archive
artanokhov Sep 3, 2024
6929317
arg_parser.py: Fixed bandit scan
artanokhov Sep 3, 2024
ed4adfe
arg_parser: Bandit scan fix
artanokhov Sep 3, 2024
a649a42
Added ignoring errors B603 B607 for subprocess.call
artanokhov Sep 3, 2024
5a7bf4d
Actualized test_arg_parser.py
artanokhov Sep 11, 2024
5e13551
Updated GH workflows with upload-artifact@v4
artanokhov Sep 11, 2024
493d9ed
test_arg_parser.py: Added passing OS
artanokhov Sep 11, 2024
c4797fd
test_arg_parser.py: Added distribution
artanokhov Sep 11, 2024
041fbd6
codestyle.yml: Make unique name for the artifacts workflow
artanokhov Sep 11, 2024
446d021
test_arg_parser.py: Fixed old URL names
artanokhov Sep 11, 2024
dbedc8d
arg_parser.py: Fixed code style checks
artanokhov Sep 11, 2024
b79e569
arg_parser.py: Fixed regex
artanokhov Sep 11, 2024
3eb0437
Rollback quotes via black.exe and ignore it in flake8
artanokhov Sep 11, 2024
988d83c
disabled C812
artanokhov Sep 11, 2024
3dd5907
Linter fix. Updated messages in tests
artanokhov Sep 11, 2024
404e2d7
arg_parser.py: Fixed regex
artanokhov Sep 11, 2024
c2072f2
test_arg_parser.py: Switched from python38 to python310
artanokhov Sep 11, 2024
b2eb620
test_arg_parser.py: Fixed dockerfile_name
artanokhov Sep 11, 2024
aa4a054
Fixed tests
artanokhov Sep 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
2 changes: 1 addition & 1 deletion .github/workflows/build_test_lin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: docker images
- name: Collecting artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: docker images
- name: Collecting artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:

- name: Collecting codestyle artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: codestyle_checks
name: codestyle_checks_${{ matrix.os }}
path: |
./utils_unittests.html
2 changes: 1 addition & 1 deletion .github/workflows/hadolint_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
done < <(find dockerfiles/ \( -name '*.dockerfile' -o -name 'Dockerfile' \) -print0)
exit "$has_issues"
- name: Collecting artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: hadolint_results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images_build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: docker images
- name: Collecting artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: docker logout openvino.azurecr.io
- name: Collecting artifacts
if: ${{ matrix.os == github.event.inputs.host_os }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
echo "Pull Request URL - ${{ steps.create_pr.outputs.pull-request-url }}"
echo "Pull Request Operation - ${{ steps.create_pr.outputs.pull-request-operation }}"
- name: Collecting artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: logs
path: |
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ignore = DAR101, DAR201, DAR401, D107, D415, I201, T001, S404, S603, G004, B009,
enable-extensions=G
per-file-ignores =
tests/*: D100,D101,D102,D104,S108,CFQ004,PT023
utils/*: Q000,C812
tests/conftest.py: D100,D101,D102,D103,D104,CFQ004

[pydocstyle]
Expand Down
7 changes: 4 additions & 3 deletions templates/rhel8/dist/dev.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ ARG OPENVINO_WHEELS_URL
# hadolint ignore=SC2102,DL3033
RUN yum install -y cmake git && yum clean all && \
if [ -z "$OPENVINO_WHEELS_URL" ]; then \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --extra-index-url https://download.pytorch.org/whl/cpu; \
${PYTHON_VER} -m pip install --no-cache-dir openvino=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --extra-index-url https://download.pytorch.org/whl/cpu; \
else \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu ; \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu ; \
fi

# download source for PyPi LGPL packages
Expand Down
4 changes: 2 additions & 2 deletions templates/ubuntu18/install/copy.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV INTEL_OPENVINO_DIR /opt/intel/openvino
# Creating user openvino and adding it to groups"users"
RUN useradd -ms /bin/bash -G users openvino

RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
RUN find "${TEMP_DIR}" -name "*.tgz" -o -name "*.tar.gz" -exec tar -xzf {} \; && \
OV_BUILD="$(find . -maxdepth 1 -type d -name "*openvino*" | grep -oP '(?<=_)\d+.\d+.\d.\d+')" && \
OV_YEAR="$(echo $OV_BUILD | grep -oP '^[^\d]*(\d+)')" && \
OV_FOLDER="$(find . -maxdepth 1 -type d -name "*openvino*")" && \
Expand All @@ -14,7 +14,7 @@ RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
rm -rf "${TEMP_DIR:?}"/"$OV_FOLDER" && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino_"$OV_YEAR" && \
rm -rf ${INTEL_OPENVINO_DIR}/tools/workbench && rm -rf ${TEMP_DIR} && \
rm -rf ${TEMP_DIR} && \
chown -R openvino /opt/intel/openvino_"$OV_BUILD"
{% if no_samples is defined or 'dev_no_samples' == distribution %}
RUN rm -rf ${INTEL_OPENVINO_DIR}/samples
Expand Down
12 changes: 8 additions & 4 deletions templates/ubuntu20/dist/dev.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ ARG OPENVINO_WHEELS_URL
# hadolint ignore=SC2102
RUN apt-get update && apt-get install -y --no-install-recommends cmake make git && rm -rf /var/lib/apt/lists/* && \
if [ -z "$OPENVINO_WHEELS_URL" ]; then \
${PYTHON_VER} -m pip install --no-cache-dir openvino=="$OPENVINO_WHEELS_VERSION" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --extra-index-url https://download.pytorch.org/whl/cpu; \
${PYTHON_VER} -m pip install --no-cache-dir openvino=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino-tokenizers=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino-genai=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --extra-index-url https://download.pytorch.org/whl/cpu; \
else \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu; \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino-tokenizers=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino-genai=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu; \
fi

WORKDIR ${INTEL_OPENVINO_DIR}/licensing
Expand Down
1 change: 1 addition & 0 deletions templates/ubuntu20/env/dev_env.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ ENV TBB_DIR=/opt/intel/openvino/runtime/3rdparty/tbb/cmake
ENV ngraph_DIR=/opt/intel/openvino/runtime/cmake
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
ENV OV_TOKENIZER_PREBUILD_EXTENSION_PATH=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
ENV PKG_CONFIG_PATH=/opt/intel/openvino/runtime/lib/intel64/pkgconfig
1 change: 1 addition & 0 deletions templates/ubuntu20/env/runtime_env.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ ENV TBB_DIR=/opt/intel/openvino/runtime/3rdparty/tbb/cmake
ENV ngraph_DIR=/opt/intel/openvino/runtime/cmake
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
ENV OV_TOKENIZER_PREBUILD_EXTENSION_PATH=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
ENV PKG_CONFIG_PATH=/opt/intel/openvino/runtime/lib/intel64/pkgconfig
4 changes: 2 additions & 2 deletions templates/ubuntu20/install/copy.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
# Creating user openvino and adding it to groups"users"
RUN useradd -ms /bin/bash -G users openvino

RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
RUN find "${TEMP_DIR}" \( -name "*.tgz" -o -name "*.tar.gz" \) -exec tar -xzf {} \; && \
OV_BUILD="$(find . -maxdepth 1 -type d -name "*openvino*" | grep -oP '(?<=_)\d+.\d+.\d.\d+')" && \
OV_YEAR="$(echo "$OV_BUILD" | grep -oP '^[^\d]*(\d+)')" && \
OV_FOLDER="$(find . -maxdepth 1 -type d -name "*openvino*")" && \
Expand All @@ -14,7 +14,7 @@ RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
rm -rf "${TEMP_DIR:?}"/"$OV_FOLDER" && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino_"$OV_YEAR" && \
rm -rf "${INTEL_OPENVINO_DIR}/tools/workbench" && rm -rf "${TEMP_DIR}" && \
rm -rf "${TEMP_DIR}" && \
chown -R openvino /opt/intel/openvino_"$OV_BUILD"
{% if no_samples is defined or 'dev_no_samples' == distribution %}
RUN rm -rf "${INTEL_OPENVINO_DIR}/samples"
Expand Down
12 changes: 8 additions & 4 deletions templates/ubuntu22/dist/dev.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ ARG OPENVINO_WHEELS_URL
# hadolint ignore=SC2102
RUN apt-get update && apt-get install -y --no-install-recommends cmake make git && rm -rf /var/lib/apt/lists/* && \
if [ -z "$OPENVINO_WHEELS_URL" ]; then \
${PYTHON_VER} -m pip install --no-cache-dir openvino=="$OPENVINO_WHEELS_VERSION" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --extra-index-url https://download.pytorch.org/whl/cpu; \
${PYTHON_VER} -m pip install --no-cache-dir openvino=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino-tokenizers=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino-genai=="${OPENVINO_WHEELS_VERSION}" && \
${PYTHON_VER} -m pip install --no-cache-dir openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --extra-index-url https://download.pytorch.org/whl/cpu; \
else \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="$OPENVINO_WHEELS_VERSION" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu; \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino-tokenizers=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino-genai=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" && \
${PYTHON_VER} -m pip install --no-cache-dir --pre openvino_dev[caffe,kaldi,mxnet,onnx,pytorch,tensorflow2]=="${OPENVINO_WHEELS_VERSION}" --trusted-host=* --find-links "$OPENVINO_WHEELS_URL" --extra-index-url https://download.pytorch.org/whl/cpu; \
fi

WORKDIR ${INTEL_OPENVINO_DIR}/licensing
Expand Down
1 change: 1 addition & 0 deletions templates/ubuntu22/env/dev_env.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ ENV TBB_DIR=/opt/intel/openvino/runtime/3rdparty/tbb/cmake
ENV ngraph_DIR=/opt/intel/openvino/runtime/cmake
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
ENV OV_TOKENIZER_PREBUILD_EXTENSION_PATH=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
ENV PKG_CONFIG_PATH=/opt/intel/openvino/runtime/lib/intel64/pkgconfig
1 change: 1 addition & 0 deletions templates/ubuntu22/env/runtime_env.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ ENV TBB_DIR=/opt/intel/openvino/runtime/3rdparty/tbb/cmake
ENV ngraph_DIR=/opt/intel/openvino/runtime/cmake
ENV OpenVINO_DIR=/opt/intel/openvino/runtime/cmake
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
ENV OV_TOKENIZER_PREBUILD_EXTENSION_PATH=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
ENV PKG_CONFIG_PATH=/opt/intel/openvino/runtime/lib/intel64/pkgconfig
4 changes: 2 additions & 2 deletions templates/ubuntu22/install/copy.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV INTEL_OPENVINO_DIR=/opt/intel/openvino
# Creating user openvino and adding it to groups"users"
RUN useradd -ms /bin/bash -G users openvino

RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
RUN find "${TEMP_DIR}" \( -name "*.tgz" -o -name "*.tar.gz" \) -exec tar -xzf {} \; && \
OV_BUILD="$(find . -maxdepth 1 -type d -name "*openvino*" | grep -oP '(?<=_)\d+.\d+.\d.\d+')" && \
OV_YEAR="$(echo "$OV_BUILD" | grep -oP '^[^\d]*(\d+)')" && \
OV_FOLDER="$(find . -maxdepth 1 -type d -name "*openvino*")" && \
Expand All @@ -14,7 +14,7 @@ RUN tar -xzf "${TEMP_DIR}"/*.tgz && \
rm -rf "${TEMP_DIR:?}"/"$OV_FOLDER" && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino && \
ln --symbolic /opt/intel/openvino_"$OV_BUILD"/ /opt/intel/openvino_"$OV_YEAR" && \
rm -rf "${INTEL_OPENVINO_DIR}/tools/workbench" && rm -rf "${TEMP_DIR}" && \
rm -rf "${TEMP_DIR}" && \
chown -R openvino /opt/intel/openvino_"$OV_BUILD"
{% if no_samples is defined or 'dev_no_samples' == distribution %}
RUN rm -rf "${INTEL_OPENVINO_DIR}/samples"
Expand Down
Loading
Loading