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

CI build and tests added for Gaudi Notebook container #396

Merged
merged 4 commits into from
Sep 25, 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: 5 additions & 0 deletions enterprise/redhat/openshift-ai/gaudi/docker/.actions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"RHEL_OS": ["9.2"],
"experimental": [true],
"runner_label": ["gaudi2"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,6 @@ RUN cd ${APP_ROOT}/ && \
VLLM_TARGET_DEVICE=hpu pip install -e .

WORKDIR ${APP_ROOT}/src
ENV NOTEBOOK_SAMPLE_LINK="https://raw.githubusercontent.com/sharvil10/ai-containers/main/enterprise/redhat/openshift-ai/gaudi/demo/Getting-started.ipynb"
ENV NOTEBOOK_SAMPLES_LINK="https://raw.githubusercontent.com/intel/ai-containers/refs/heads/main/enterprise/redhat/openshift-ai/gaudi/demo/oneapi-sample.ipynb"

ENTRYPOINT ["bash", "-c", "/opt/app-root/builder/run"]
15 changes: 12 additions & 3 deletions enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ services:
context: .
target: gaudi-base
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
image: gaudi-base:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-base-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
entrypoint: ["/bin/bash", "-c"]
command: >
"hl-smi"
gaudi-pytorch:
build:
args:
Expand All @@ -44,7 +47,10 @@ services:
context: .
target: gaudi-pytorch
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
image: gaudi-pytorch:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-pytorch-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
entrypoint: ["/bin/bash", "-c"]
command: >
"python -c 'import torch'"
gaudi-notebooks:
build:
args:
Expand All @@ -61,4 +67,7 @@ services:
context: .
target: gaudi-notebooks
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
image: gaudi-notebooks:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-notebook-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
entrypoint: ["/bin/bash", "-c"]
command: >
"python -m jupyter notebook --version"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# 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.

set -e

apt-get -y update
apt-get -y install curl jq

echo 'Testing if server is running'
curl --fail -s -X GET http://localhost:8888/api/status
echo ''

echo 'Test if oneapi-sample was downloaded'
if [[ $(curl --fail -s -X GET http://localhost:8888/api/contents | jq -r '.content[] | select(.name=="oneapi-sample.ipynb")') ]]; then
echo 'oneapi-sample.ipynb was downloaded'
else
echo 'oneapi-sample.ipynb was not downloaded'
fi
26 changes: 26 additions & 0 deletions enterprise/redhat/openshift-ai/gaudi/docker/tests/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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.

test-jupyter-server:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-base-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
cmd: bash /opt/app-root/notebook-test.sh
serving: True
volumes:
- src: $PWD/enterprise/redhat/openshift-ai/gaudi/docker/tests/notebook-test.sh
dst: /opt/app-root/notebook-test.sh
env:
NOTEBOOK_ARGS: "--ServerApp.token='' --ServerApp.PasswordIdentityProvider.hashed_password=''"
NOTEBOOK_PORT: '8888'
NOTEBOOK_SAMPLES_LINK: 'https://raw.githubusercontent.com/intel/ai-containers/refs/heads/main/enterprise/redhat/openshift-ai/gaudi/demo/oneapi-sample.ipynb'
shm_size: 1g
Loading