diff --git a/enterprise/redhat/openshift-ai/gaudi/docker/.actions.json b/enterprise/redhat/openshift-ai/gaudi/docker/.actions.json new file mode 100644 index 00000000..948da843 --- /dev/null +++ b/enterprise/redhat/openshift-ai/gaudi/docker/.actions.json @@ -0,0 +1,5 @@ +{ + "RHEL_OS": ["9.2"], + "experimental": [true], + "runner_label": ["gaudi2"] +} diff --git a/enterprise/redhat/openshift-ai/gaudi/docker/Dockerfile.rhel9.2 b/enterprise/redhat/openshift-ai/gaudi/docker/Dockerfile.rhel9.2 index d1449fd8..a8c818e1 100644 --- a/enterprise/redhat/openshift-ai/gaudi/docker/Dockerfile.rhel9.2 +++ b/enterprise/redhat/openshift-ai/gaudi/docker/Dockerfile.rhel9.2 @@ -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"] diff --git a/enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml b/enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml index d2901e32..5c8c53e3 100644 --- a/enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml +++ b/enterprise/redhat/openshift-ai/gaudi/docker/docker-compose.yaml @@ -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: @@ -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: @@ -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" diff --git a/enterprise/redhat/openshift-ai/gaudi/docker/tests/notebook-test.sh b/enterprise/redhat/openshift-ai/gaudi/docker/tests/notebook-test.sh new file mode 100644 index 00000000..7692372d --- /dev/null +++ b/enterprise/redhat/openshift-ai/gaudi/docker/tests/notebook-test.sh @@ -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 diff --git a/enterprise/redhat/openshift-ai/gaudi/docker/tests/tests.yaml b/enterprise/redhat/openshift-ai/gaudi/docker/tests/tests.yaml new file mode 100644 index 00000000..46acb510 --- /dev/null +++ b/enterprise/redhat/openshift-ai/gaudi/docker/tests/tests.yaml @@ -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