Skip to content

Commit 4802b0d

Browse files
Merge pull request #787 from opendatahub-io/sync__main__2024b__20241128115346
Sync `2024b` branch with `main` branch
2 parents 055d157 + fb6e1b9 commit 4802b0d

File tree

130 files changed

+14535
-13668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+14535
-13668
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 262 additions & 41 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# https://tech.davis-hansson.com/p/make/
2+
SHELL := bash
3+
# todo: do not set .ONESHELL: for now
4+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
5+
#.SHELLFLAGS := -eu -o pipefail -c
6+
.DELETE_ON_ERROR:
7+
MAKEFLAGS += --warn-undefined-variables
8+
MAKEFLAGS += --no-builtin-rules
9+
10+
# todo: leave the default recipe prefix for now
11+
ifeq ($(origin .RECIPEPREFIX), undefined)
12+
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
13+
endif
14+
.RECIPEPREFIX =
15+
116
IMAGE_REGISTRY ?= quay.io/opendatahub/workbench-images
217
RELEASE ?= 2024b
318
# additional user-specified caching parameters for $(CONTAINER_ENGINE) build
@@ -16,6 +31,9 @@ else
1631
WHERE_WHICH ?= which
1732
endif
1833

34+
# linux/amd64 or darwin/arm64
35+
OS_ARCH=$(shell go env GOOS)/$(shell go env GOARCH)
36+
1937
IMAGE_TAG ?= $(RELEASE)_$(DATE)
2038
KUBECTL_BIN ?= bin/kubectl
2139
KUBECTL_VERSION ?= v1.23.11
@@ -404,7 +422,7 @@ rocm-runtime-tensorflow-ubi9-python-3.11: rocm-ubi9-python-3.11
404422
bin/kubectl:
405423
ifeq (,$(wildcard $(KUBECTL_BIN)))
406424
@mkdir -p bin
407-
@curl -sSL https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl > \
425+
@curl -sSL https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/$(OS_ARCH)/kubectl > \
408426
$(KUBECTL_BIN)
409427
@chmod +x $(KUBECTL_BIN)
410428
endif
@@ -520,6 +538,7 @@ validate-runtime-image: bin/kubectl
520538
$(info # Running tests for $(NOTEBOOK_NAME) runtime...)
521539
$(KUBECTL_BIN) wait --for=condition=ready pod runtime-pod --timeout=300s
522540
@required_commands=$(REQUIRED_RUNTIME_IMAGE_COMMANDS) ; \
541+
fail=0 ; \
523542
if [[ $$image == "" ]] ; then \
524543
echo "Usage: make validate-runtime-image image=<container-image-name>" ; \
525544
exit 1 ; \
@@ -534,11 +553,12 @@ validate-runtime-image: bin/kubectl
534553
fi; \
535554
if [ $$cmd == "python3" ]; then \
536555
echo "=> Checking notebook execution..." ; \
537-
$(KUBECTL_BIN) exec runtime-pod -- /bin/sh -c "python3 -m pip install -r /opt/app-root/elyra/requirements-elyra.txt && \
556+
$(KUBECTL_BIN) exec runtime-pod -- /bin/sh -c "curl https://raw.githubusercontent.com/opendatahub-io/elyra/refs/heads/main/etc/generic/requirements-elyra.txt --output req.txt && \
557+
python3 -m pip install -r req.txt > /dev/null && \
538558
curl https://raw.githubusercontent.com/nteract/papermill/main/papermill/tests/notebooks/simple_execute.ipynb --output simple_execute.ipynb && \
539559
python3 -m papermill simple_execute.ipynb output.ipynb > /dev/null" ; \
540560
if [ $$? -ne 0 ]; then \
541-
echo "ERROR: Image does not meet Python requirements criteria in requirements-elyra.txt" ; \
561+
echo "ERROR: Image does not meet Python requirements criteria in pipfile" ; \
542562
fail=1; \
543563
fi; \
544564
fi; \
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cniVersion": "1.0.0",
3+
"name": "crio",
4+
"plugins": [
5+
{
6+
"type": "bridge",
7+
"bridge": "cni0",
8+
"isGateway": true,
9+
"ipMasq": true,
10+
"hairpinMode": true,
11+
"ipam": {
12+
"type": "host-local",
13+
"routes": [
14+
{ "dst": "0.0.0.0/0" }
15+
],
16+
"ranges": [
17+
[{ "subnet": "10.85.0.0/16" }]
18+
]
19+
}
20+
}
21+
]
22+
}

ci/cached-builds/containers.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ retry=100
88
# supposedly these images are faster to pull
99
compression_format="zstd:chunked"
1010
compression_level=6
11+
1112
# defaults to /var/tmp, which is small
1213
image_copy_tmp_dir="storage"
14+
# setting image_copy_tmp_dir is not enough, it still can give me
15+
# Error: creating build container: writing blob: storing blob to file "/var/tmp/container_images_storage2384030476/20": write /var/tmp/container_images_storage2384030476/20: no space left on device
16+
# https://github.com/containers/podman/issues/5411, https://github.com/containers/podman/pull/5412
17+
# Set the TMPDIR env variable, https://github.com/containers/podman/blob/d85ac938e60938369ff1337dccaf0943b7405f48/cmd/podman/images/load.go#L96
1318

1419
[machine]
1520

ci/cached-builds/crio.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://github.com/cri-o/cri-o/blob/main/docs/crio.conf.5.md
2+
3+
[crio]
4+
storage_driver = "overlay"
5+
# storage_option = [ "overlay.mountopt=nodev,metacopy=on" ]
6+
7+
# reuse podman's container storage because we have huge images that don't fit on disk twice
8+
root = "/home/runner/.local/share/containers/storage"
9+
# has to be the same as root!
10+
runroot = "/home/runner/.local/share/containers/storage"
11+
12+
# https://stackoverflow.com/questions/62408028/kubelet-failed-to-createpodsandbox-for-coredns-failed-to-set-bridge-addr-c
13+
[crio.network]
14+
# the /etc/cni/net.d/11-crio-ipv4-bridge.conflist default IPs confilct with flannel,
15+
# older versions of kubernetes the kubelet was touching the cni, now only the container runtime touches
16+
# c.f. https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#installation
17+
#network_dir = "/etc/cni/net.d-kube/"

ci/cached-builds/gha_lvm_overlay.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ if [[ ${overprovision_lvm} == 'true' ]]; then
6464
else
6565
sudo mkfs.ext4 -Enodiscard -m0 "/dev/mapper/${VG_NAME}-buildlv"
6666
fi
67-
sudo mount "/dev/mapper/${VG_NAME}-buildlv" "${build_mount_path}"
67+
mkdir -p "${build_mount_path}"
68+
# https://www.alibabacloud.com/help/en/ecs/use-cases/mount-parameters-for-ext4-file-systems?spm=a2c63.p38356.help-menu-25365.d_5_10_12.48ce3be5RixoUB#8e740ed072m5o
69+
sudo mount -o defaults,noatime,nodiratime,nobarrier,nodelalloc,data=writeback "/dev/mapper/${VG_NAME}-buildlv" "${build_mount_path}"
6870
sudo chown -R "${build_mount_path_ownership}" "${build_mount_path}"
6971

7072
# if build mount path is a parent of $GITHUB_WORKSPACE, and has been deleted, recreate it

ci/cached-builds/has_tests.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env python3
2+
import argparse
3+
import json
4+
import os
5+
import pathlib
6+
import typing
7+
import unittest
8+
9+
import gha_pr_changed_files
10+
11+
"""Determines whether we have deploy Makefile tests for this target or not
12+
13+
https://github.com/openshift/release/blob/master/ci-operator/config/opendatahub-io/notebooks/opendatahub-io-notebooks-main.yaml#L1485
14+
"""
15+
16+
17+
class Args(argparse.Namespace):
18+
"""Type annotation to have autocompletion for args"""
19+
target: str
20+
21+
22+
def main() -> None:
23+
parser = argparse.ArgumentParser("make_test.py")
24+
parser.add_argument("--target", type=str)
25+
args = typing.cast(Args, parser.parse_args())
26+
27+
has_tests = check_tests(args.target)
28+
29+
if "GITHUB_ACTIONS" in os.environ:
30+
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
31+
print(f"tests={json.dumps(has_tests)}", file=f)
32+
33+
print(f"{has_tests=}")
34+
35+
36+
def check_tests(target: str) -> bool:
37+
if target.startswith("rocm-jupyter-minimal-") or target.startswith("rocm-jupyter-datascience-"):
38+
return False # we don't have specific tests for -minimal-, ... in ci-operator/config
39+
if '-intel-' in target:
40+
return False # RHOAIENG-8388: Intel tensorflow notebook failed to get tested on OCP-CI
41+
42+
has_tests = False
43+
dirs = gha_pr_changed_files.analyze_build_directories(target)
44+
for d in reversed(dirs): # (!)
45+
kustomization = pathlib.Path(gha_pr_changed_files.PROJECT_ROOT) / d / "kustomize/base/kustomization.yaml"
46+
has_tests = has_tests or kustomization.is_file()
47+
break # TODO: check only the last directory (the top level layer) for now
48+
return has_tests
49+
50+
51+
class TestCheckTests(unittest.TestCase):
52+
def test_has_tests(self):
53+
assert check_tests("base-c9s-python-3.11") is False
54+
assert check_tests("jupyter-minimal-ubi9-python-3.9") is True
55+
56+
57+
if __name__ == "__main__":
58+
main()

ci/cached-builds/homebrew.podman.service

Lines changed: 0 additions & 11 deletions
This file was deleted.

ci/cached-builds/kubeadm.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# kubeadm config print init-defaults > kubeadm.yaml
3+
# kubeadm init --cri-socket=/var/run/crio/crio.sock
4+
5+
# https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta3/
6+
# https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/
7+
apiVersion: kubeadm.k8s.io/v1beta3
8+
bootstrapTokens:
9+
- groups:
10+
- system:bootstrappers:kubeadm:default-node-token
11+
token: abcdef.0123456789abcdef
12+
ttl: 24h0m0s
13+
usages:
14+
- signing
15+
- authentication
16+
kind: InitConfiguration
17+
localAPIEndpoint:
18+
bindPort: 6443
19+
nodeRegistration:
20+
kubeletExtraArgs:
21+
# Need to have enough disk space for Kubelet, so move root-dir on the LVM volume
22+
# Note: the internets discourage from changing the default because storage plugins may then struggle
23+
# https://cep.dev/posts/adventure-trying-change-kubelet-rootdir/
24+
root-dir: "/home/runner/.local/share/containers/kubelet-root-dir"
25+
criSocket: unix:///var/run/crio/crio.sock
26+
imagePullPolicy: IfNotPresent
27+
taints: null
28+
---
29+
apiServer:
30+
timeoutForControlPlane: 4m0s
31+
apiVersion: kubeadm.k8s.io/v1beta3
32+
certificatesDir: /etc/kubernetes/pki
33+
clusterName: kubernetes
34+
controllerManager: {}
35+
dns: {}
36+
etcd:
37+
local:
38+
dataDir: /var/lib/etcd
39+
imageRepository: registry.k8s.io
40+
kind: ClusterConfiguration
41+
networking:
42+
dnsDomain: cluster.local
43+
# this matches the default in /etc/cni/net.d/11-crio-ipv4-bridge.conflist
44+
podSubnet: 10.85.0.0/16
45+
scheduler: {}

ci/cached-builds/podman.service

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://docs.podman.io/en/latest/markdown/podman-system-service.1.html
2+
# cat /usr/lib/systemd/system/podman.socket
3+
4+
[Unit]
5+
Description=Podman API Service
6+
Requires=podman.socket
7+
After=podman.socket
8+
Documentation=man:podman-system-service(1)
9+
StartLimitIntervalSec=0
10+
11+
[Service]
12+
Delegate=true
13+
Type=exec
14+
KillMode=process
15+
Environment="PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
16+
WorkingDirectory=/home/linuxbrew/.linuxbrew
17+
ExecStart=/home/linuxbrew/.linuxbrew/opt/podman/bin/podman --log-level=info system service
18+
19+
[Install]
20+
WantedBy=default.target

0 commit comments

Comments
 (0)