Skip to content

Commit 9f1bd60

Browse files
sharvil10Tyler Titsworth
and
Tyler Titsworth
authored
CI build and tests added for Gaudi Notebook container (#396)
Signed-off-by: sharvil10 <sharvil.shah@intel.com> Co-authored-by: Tyler Titsworth <tyler.titsworth@intel.com>
1 parent 8d46a64 commit 9f1bd60

File tree

5 files changed

+75
-4
lines changed

5 files changed

+75
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"RHEL_OS": ["9.2"],
3+
"experimental": [true],
4+
"runner_label": ["gaudi2"]
5+
}

enterprise/redhat/openshift-ai/gaudi/docker/Dockerfile.rhel9.2

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,6 @@ RUN cd ${APP_ROOT}/ && \
231231
VLLM_TARGET_DEVICE=hpu pip install -e .
232232

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

236236
ENTRYPOINT ["bash", "-c", "/opt/app-root/builder/run"]

enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ services:
2727
context: .
2828
target: gaudi-base
2929
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
30-
image: gaudi-base:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
30+
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-base-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
31+
entrypoint: ["/bin/bash", "-c"]
32+
command: >
33+
"hl-smi"
3134
gaudi-pytorch:
3235
build:
3336
args:
@@ -44,7 +47,10 @@ services:
4447
context: .
4548
target: gaudi-pytorch
4649
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
47-
image: gaudi-pytorch:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
50+
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-pytorch-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
51+
entrypoint: ["/bin/bash", "-c"]
52+
command: >
53+
"python -c 'import torch'"
4854
gaudi-notebooks:
4955
build:
5056
args:
@@ -61,4 +67,7 @@ services:
6167
context: .
6268
target: gaudi-notebooks
6369
dockerfile: Dockerfile.rhel${RHEL_OS:-9.2}
64-
image: gaudi-notebooks:${RHEL_OS:-9.2}-${VERSION:-1.17.0}-${REVISION:-495}
70+
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-notebook-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
71+
entrypoint: ["/bin/bash", "-c"]
72+
command: >
73+
"python -m jupyter notebook --version"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2024 Intel Corporation
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
apt-get -y update
20+
apt-get -y install curl jq
21+
22+
echo 'Testing if server is running'
23+
curl --fail -s -X GET http://localhost:8888/api/status
24+
echo ''
25+
26+
echo 'Test if oneapi-sample was downloaded'
27+
if [[ $(curl --fail -s -X GET http://localhost:8888/api/contents | jq -r '.content[] | select(.name=="oneapi-sample.ipynb")') ]]; then
28+
echo 'oneapi-sample.ipynb was downloaded'
29+
else
30+
echo 'oneapi-sample.ipynb was not downloaded'
31+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2024 Intel Corporation
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
test-jupyter-server:
16+
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-gaudi-base-${VERSION:-1.17.0}-${REVISION:-495}-rhel-${RHEL_OS:-9.2}
17+
cmd: bash /opt/app-root/notebook-test.sh
18+
serving: True
19+
volumes:
20+
- src: $PWD/enterprise/redhat/openshift-ai/gaudi/docker/tests/notebook-test.sh
21+
dst: /opt/app-root/notebook-test.sh
22+
env:
23+
NOTEBOOK_ARGS: "--ServerApp.token='' --ServerApp.PasswordIdentityProvider.hashed_password=''"
24+
NOTEBOOK_PORT: '8888'
25+
NOTEBOOK_SAMPLES_LINK: 'https://raw.githubusercontent.com/intel/ai-containers/refs/heads/main/enterprise/redhat/openshift-ai/gaudi/demo/oneapi-sample.ipynb'
26+
shm_size: 1g

0 commit comments

Comments
 (0)