-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into main-public
- Loading branch information
Showing
139 changed files
with
2,869 additions
and
1,040 deletions.
There are no files selected for viewing
This file contains 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,4 @@ | ||
.venv** | ||
.git** | ||
docker | ||
poetry.lock |
This file contains 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 |
---|---|---|
|
@@ -153,3 +153,8 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# poetry lock files | ||
poetry.lock | ||
**/poetry.lock | ||
**/**/poetry.lock |
This file contains 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
This file contains 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
This file contains 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,89 @@ | ||
# | ||
# Copyright (c) 2024 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
ARG IMAGE_NAME=ubuntu | ||
ARG IMAGE_TAG=22.04 | ||
|
||
# Clean base for Explainer | ||
FROM ${IMAGE_NAME}:${IMAGE_TAG} as base | ||
|
||
ARG PY_VER=3.10 | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get autoclean && \ | ||
apt-get autoremove -y && \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install --no-install-recommends --fix-missing -y \ | ||
graphviz \ | ||
libgl1 \ | ||
libglib2.0.0 \ | ||
python${PY_VER} \ | ||
python3-pip \ | ||
tzdata | ||
|
||
RUN ln -sf $( which python${PY_VER} ) /usr/bin/python | ||
|
||
# Development Explainer image | ||
FROM base as builder | ||
|
||
ARG PY_VER=3.10 | ||
ARG APP_DIR=/intel-xai | ||
|
||
ARG POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get autoclean && \ | ||
apt-get autoremove -y && \ | ||
apt-get install --no-install-recommends --fix-missing -y \ | ||
g++ \ | ||
python${PY_VER}-dev | ||
|
||
RUN python${PY_VER} -m pip install --no-cache-dir \ | ||
'poetry==1.8.2' | ||
|
||
COPY . ${APP_DIR} | ||
WORKDIR ${APP_DIR} | ||
|
||
RUN /usr/local/bin/poetry config virtualenvs.create false && \ | ||
poetry install --extras explainer --extras explainer-all && \ | ||
${APP_DIR}/.venv/bin/pip install --no-cache-dir -r notebooks/explainer/requirements.txt && \ | ||
rm -rf ${HOME}/.cache/pypoetry ${HOME}/.cache/pip | ||
|
||
# Production Explainer image | ||
FROM base as runtime | ||
|
||
ARG APP_DIR=/intel-xai | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
COPY --from=builder ${APP_DIR} ${APP_DIR} | ||
|
||
ENV VIRTUAL_ENV="${APP_DIR}/.venv" \ | ||
PATH="${APP_DIR}/.venv/bin:${PATH}" | ||
|
||
WORKDIR ${APP_DIR}/notebooks/explainer | ||
|
||
EXPOSE 8888 | ||
|
||
RUN echo "source activate ${VIRTUAL_ENV}" >> ~/.bashrc | ||
|
||
CMD ["bash", "-c", "source activate ${VIRTUAL_ENV} && jupyter notebook --port 8888 --ip 0.0.0.0 --no-browser --allow-root"] |
Oops, something went wrong.