Skip to content

Commit a27286e

Browse files
committed
Lint errors fiex
Signed-off-by: sharvil10 <sharvil.shah@intel.com>
1 parent 6a5d998 commit a27286e

20 files changed

+260
-360
lines changed

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,11 @@ updates:
9595
package-ecosystem: pip
9696
schedule:
9797
interval: weekly
98+
- directory: enterprise/redhat/openshift-ai/gaudi/docker
99+
groups:
100+
preset:
101+
patterns:
102+
- "requirements.txt"
103+
package-ecosystem: pip
104+
schedule:
105+
interval: weekly

classical-ml/.actions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"PACKAGE_OPTION": ["idp", "pip"],
33
"experimental": [true],
4-
"runner_label": ["PVC"]
4+
"runner_label": ["clx"]
55
}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ ARG REVISION
88
LABEL vendor="Intel Corporation"
99
LABEL release="${VERSION}-${REVISION}"
1010

11-
COPY licenses /licenses
12-
1311
ENV HOME="/opt/app-root/src"
1412
WORKDIR /opt/app-root/src
1513

@@ -63,6 +61,9 @@ RUN dnf install -y \
6361
dnf update -y && \
6462
dnf clean all && rm -rf /var/cache/yum
6563

64+
RUN mkdir -p /licenses && \
65+
wget -O /licenses/LICENSE https://raw.githubusercontent.com/intel/ai-containers/main/LICENSE
66+
6667
ENV PYTHON_VERSION=3.10
6768
COPY install-python310.sh .
6869
RUN ./install-python310.sh rhel9.2 && rm install-python310.sh

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ ARG REVISION
88
LABEL vendor="Intel Corporation"
99
LABEL release="${VERSION}-${REVISION}"
1010

11-
COPY licenses /licenses
12-
1311
ENV HOME="/opt/app-root/src"
1412
WORKDIR /opt/app-root/src
1513

@@ -74,6 +72,9 @@ RUN dnf install -y \
7472
dnf update -y && \
7573
dnf clean all && rm -rf /var/cache/yum
7674

75+
RUN mkdir -p /licenses && \
76+
wget -O /licenses/LICENSE https://raw.githubusercontent.com/intel/ai-containers/main/LICENSE
77+
7778
RUN alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 && \
7879
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
7980
alternatives --set python3 /usr/bin/python3.11 && \

enterprise/redhat/openshift-ai/gaudi/docker/builder/run

+25-25
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ set -eo pipefail
44

55
set -x
66

7-
APP_ROOT=${APP_ROOT:-/workspace}
7+
APP_ROOT=${APP_ROOT:-/opt/app-root}
88

99
# Pre-clone repositories defined in JUPYTER_PRELOAD_REPOS
1010
if [ -n "${JUPYTER_PRELOAD_REPOS}" ]; then
11-
for repo in `echo ${JUPYTER_PRELOAD_REPOS} | tr ',' ' '`; do
12-
# Check for the presence of "@branch" in the repo string
13-
REPO_BRANCH=$(echo ${repo} | cut -s -d'@' -f2)
14-
if [[ -n ${REPO_BRANCH} ]]; then
15-
# Remove the branch from the repo string and convert REPO_BRANCH to git clone arg
16-
repo=$(echo ${repo} | cut -d'@' -f1)
17-
REPO_BRANCH="-b ${REPO_BRANCH}"
18-
fi
19-
echo "Checking if repository $repo exists locally"
20-
REPO_DIR=$(basename ${repo})
21-
if [ -d "${REPO_DIR}" ]; then
22-
pushd ${REPO_DIR}
23-
# Do nothing if the repo already exists
24-
echo "The ${repo} has already been cloned"
25-
:
26-
popd
27-
else
28-
GIT_SSL_NO_VERIFY=true git clone ${repo} ${REPO_DIR} ${REPO_BRANCH}
29-
fi
30-
done
11+
for repo in $(echo "${JUPYTER_PRELOAD_REPOS}" | tr ',' ' '); do
12+
# Check for the presence of "@branch" in the repo string
13+
REPO_BRANCH=$(echo "${repo}" | cut -s -d'@' -f2)
14+
if [[ -n ${REPO_BRANCH} ]]; then
15+
# Remove the branch from the repo string and convert REPO_BRANCH to git clone arg
16+
repo=$(echo "${repo}" | cut -d'@' -f1)
17+
REPO_BRANCH="-b ${REPO_BRANCH}"
18+
fi
19+
echo "Checking if repository $repo exists locally"
20+
REPO_DIR=$(basename "${repo}")
21+
if [ -d "${REPO_DIR}" ]; then
22+
pushd "${REPO_DIR}"
23+
# Do nothing if the repo already exists
24+
echo "The ${repo} has already been cloned"
25+
:
26+
popd
27+
else
28+
GIT_SSL_NO_VERIFY=true git clone "${repo}" "${REPO_DIR}" "${REPO_BRANCH}"
29+
fi
30+
done
3131
fi
3232

3333
if [ -n "${NOTEBOOK_SAMPLES_LINK}" ]; then
34-
for link in `echo ${NOTEBOOK_SAMPLES_LINK} | tr ',' ' '`; do
35-
wget ${link}
36-
done
34+
for link in $(echo "${NOTEBOOK_SAMPLES_LINK}" | tr ',' ' '); do
35+
wget "${link}"
36+
done
3737
fi
3838

39-
${APP_ROOT}/bin/start-notebook.sh "$@"
39+
"${APP_ROOT}"/bin/start-notebook.sh "$@"

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

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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+
115
services:
216
gaudi-base:
317
build:

enterprise/redhat/openshift-ai/gaudi/docker/install-python310.sh

+77-64
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,66 @@
11
#!/bin/bash
2+
# Copyright (c) 2024 Intel Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
216
set -e
317

418
_BASE_NAME=${1:-"ubuntu22.04"}
519
_SSL_LIB=""
620

721
# preinstall dependencies and define variables
822
case "${_BASE_NAME}" in
9-
*ubuntu22.04*)
10-
echo "Skip install Python3.10 from source on Ubuntu22.04"
11-
exit 0;
12-
;;
13-
*debian* | *ubuntu*)
14-
apt update
15-
apt install -y libsqlite3-dev libreadline-dev
16-
;;
17-
*rhel*)
18-
yum install -y sqlite-devel readline-devel xz-devel
19-
;;
20-
*tencentos3.1*)
21-
dnf install -y sqlite-devel readline-devel zlib-devel xz-devel bzip2-devel libffi-devel
22-
wget -nv -O /opt/openssl-1.1.1w.tar.gz https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz && \
23-
cd /opt/ && \
24-
tar xzf openssl-1.1.1w.tar.gz && \
25-
rm -rf openssl-1.1.1w.tar.gz && \
26-
cd openssl-1.1.1w && \
27-
./config --prefix=/usr/local/openssl-1.1.1w shared zlib && \
28-
make && make install
29-
ln -s /etc/pki/tls/cert.pem /usr/local/openssl-1.1.1w/ssl/cert.pem
23+
*ubuntu22.04*)
24+
echo "Skip install Python3.10 from source on Ubuntu22.04"
25+
exit 0
26+
;;
27+
*debian* | *ubuntu*)
28+
apt update
29+
apt install -y libsqlite3-dev libreadline-dev
30+
;;
31+
*rhel*)
32+
yum install -y sqlite-devel readline-devel xz-devel
33+
;;
34+
*tencentos3.1*)
35+
dnf install -y sqlite-devel readline-devel zlib-devel xz-devel bzip2-devel libffi-devel
36+
wget -nv -O /opt/openssl-1.1.1w.tar.gz https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz &&
37+
cd /opt/ &&
38+
tar xzf openssl-1.1.1w.tar.gz &&
39+
rm -rf openssl-1.1.1w.tar.gz &&
40+
cd openssl-1.1.1w &&
41+
./config --prefix=/usr/local/openssl-1.1.1w shared zlib &&
42+
make && make install
43+
ln -s /etc/pki/tls/cert.pem /usr/local/openssl-1.1.1w/ssl/cert.pem
3044

31-
PATH=$PATH:/usr/local/protoc/bin:/usr/local/openssl-1.1.1w/bin
32-
LD_LIBRARY_PATH=/usr/local/openssl-1.1.1w/lib:$LD_LIBRARY_PATH
33-
_SSL_LIB="--with-openssl=/usr/local/openssl-1.1.1w"
34-
;;
35-
*amzn2*)
36-
yum install -y sqlite-devel readline-devel
37-
wget -nv -O /opt/openssl-1.1.1w.tar.gz https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz && \
38-
cd /opt/ && \
39-
tar xzf openssl-1.1.1w.tar.gz && \
40-
rm -rf openssl-1.1.1w.tar.gz && \
41-
cd openssl-1.1.1w && \
42-
./config --prefix=/usr/local/openssl-1.1.1w shared zlib && \
43-
make && make install
44-
ln -s /etc/pki/tls/cert.pem /usr/local/openssl-1.1.1w/ssl/cert.pem
45+
PATH=$PATH:/usr/local/protoc/bin:/usr/local/openssl-1.1.1w/bin
46+
LD_LIBRARY_PATH=/usr/local/openssl-1.1.1w/lib:$LD_LIBRARY_PATH
47+
_SSL_LIB="--with-openssl=/usr/local/openssl-1.1.1w"
48+
;;
49+
*amzn2*)
50+
yum install -y sqlite-devel readline-devel
51+
wget -nv -O /opt/openssl-1.1.1w.tar.gz https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz &&
52+
cd /opt/ &&
53+
tar xzf openssl-1.1.1w.tar.gz &&
54+
rm -rf openssl-1.1.1w.tar.gz &&
55+
cd openssl-1.1.1w &&
56+
./config --prefix=/usr/local/openssl-1.1.1w shared zlib &&
57+
make && make install
58+
ln -s /etc/pki/tls/cert.pem /usr/local/openssl-1.1.1w/ssl/cert.pem
4559

46-
PATH=$PATH:/usr/local/protoc/bin:/usr/local/openssl-1.1.1w/bin
47-
LD_LIBRARY_PATH=/usr/local/openssl-1.1.1w/lib:$LD_LIBRARY_PATH
48-
_SSL_LIB="--with-openssl=/usr/local/openssl-1.1.1w"
49-
;;
60+
PATH=$PATH:/usr/local/protoc/bin:/usr/local/openssl-1.1.1w/bin
61+
LD_LIBRARY_PATH=/usr/local/openssl-1.1.1w/lib:$LD_LIBRARY_PATH
62+
_SSL_LIB="--with-openssl=/usr/local/openssl-1.1.1w"
63+
;;
5064
esac
5165

5266
# install Python
@@ -60,31 +74,30 @@ make -j && make altinstall
6074

6175
# post install
6276
case "${_BASE_NAME}" in
63-
*rhel9*)
64-
alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 2 && \
65-
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
66-
alternatives --set python3 /usr/local/bin/python3.10
67-
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
68-
;;
69-
*tencentos3.1*)
70-
alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 4 && \
71-
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 3 && \
72-
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 && \
73-
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 && \
74-
alternatives --set python3 /usr/local/bin/python3.10
75-
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
76-
;;
77-
*amzn2*)
78-
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 3 && \
79-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 && \
80-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
81-
;;
82-
*debian*)
83-
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 3
84-
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 2
85-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
86-
;;
77+
*rhel9*)
78+
alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 2 &&
79+
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 &&
80+
alternatives --set python3 /usr/local/bin/python3.10
81+
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
82+
;;
83+
*tencentos3.1*)
84+
alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 4 &&
85+
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 3 &&
86+
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 &&
87+
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 &&
88+
alternatives --set python3 /usr/local/bin/python3.10
89+
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
90+
;;
91+
*amzn2*)
92+
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 3 &&
93+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 &&
94+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
95+
;;
96+
*debian*)
97+
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.10 3
98+
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 2
99+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
100+
;;
87101
esac
88102

89103
python3 -m pip install --upgrade pip setuptools
90-
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
11
#!/bin/bash -ex
22

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+
317
DEFAULT_EFA_INSTALLER_VER=1.29.0
418
efa_installer_version=${1:-$DEFAULT_EFA_INSTALLER_VER}
519

620
tmp_dir=$(mktemp -d)
7-
wget -nv https://efa-installer.amazonaws.com/aws-efa-installer-$efa_installer_version.tar.gz -P $tmp_dir
8-
tar -xf $tmp_dir/aws-efa-installer-$efa_installer_version.tar.gz -C $tmp_dir
9-
pushd $tmp_dir/aws-efa-installer
10-
case $(. /etc/os-release ; echo -n $ID) in
11-
rhel)
12-
# we cannot install dkms packages on RHEL images due to OCP rules
13-
rm -f RPMS/RHEL8/x86_64/dkms*.rpm
14-
;;
15-
tencentos)
16-
dnf install -y RPMS/ROCKYLINUX8/x86_64/rdma-core/libibverbs-46.0-1.el8.x86_64.rpm RPMS/ROCKYLINUX8/x86_64/rdma-core/libibverbs-utils-46.0-1.el8.x86_64.rpm
17-
patch -f -p1 -i /tmp/tencentos_efa_patch.txt --reject-file=tencentos_efa_patch.rej --no-backup-if-mismatch
18-
;;
21+
wget -nv https://efa-installer.amazonaws.com/aws-efa-installer-"$efa_installer_version".tar.gz -P "$tmp_dir"
22+
tar -xf "$tmp_dir"/aws-efa-installer-"$efa_installer_version".tar.gz -C "$tmp_dir"
23+
pushd "$tmp_dir"/aws-efa-installer
24+
# shellcheck disable=SC1091
25+
case $(
26+
. /etc/os-release
27+
echo -n "$ID"
28+
) in
29+
rhel)
30+
# we cannot install dkms packages on RHEL images due to OCP rules
31+
rm -f RPMS/RHEL8/x86_64/dkms*.rpm
32+
;;
33+
tencentos)
34+
dnf install -y RPMS/ROCKYLINUX8/x86_64/rdma-core/libibverbs-46.0-1.el8.x86_64.rpm RPMS/ROCKYLINUX8/x86_64/rdma-core/libibverbs-utils-46.0-1.el8.x86_64.rpm
35+
patch -f -p1 -i /tmp/tencentos_efa_patch.txt --reject-file=tencentos_efa_patch.rej --no-backup-if-mismatch
36+
;;
1937
esac
2038
./efa_installer.sh -y --skip-kmod --skip-limit-conf --no-verify
2139
popd
22-
rm -rf $tmp_dir
40+
rm -rf "$tmp_dir"

0 commit comments

Comments
 (0)