Skip to content

Commit

Permalink
Remove mentions of crictl dependency
Browse files Browse the repository at this point in the history
New slot reconciliation system doesn't need crictl anymore,
removing everything related to that

Signed-off-by: Nicolas Belouin <[email protected]>
  • Loading branch information
diconico07 committed Jul 31, 2024
1 parent b92efd4 commit 605f9b4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 72 deletions.
5 changes: 1 addition & 4 deletions build/containers/Dockerfile.rust
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ ARG AKRI_COMPONENT
RUN PROFILE=$(echo "${EXTRA_CARGO_ARGS}" | grep -q -- --release && echo "release" || echo "debug"); \
xx-verify ./target/$(xx-cargo --print-target-triple)/${PROFILE}/${AKRI_COMPONENT}\
&& cp ./target/$(xx-cargo --print-target-triple)/${PROFILE}/${AKRI_COMPONENT} /build/bin/akri
# Prepare crictl for agent
RUN VERSION=v1.25.0; if [ "x${AKRI_COMPONENT}" = "xagent" ]; then wget \
"https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-$(xx-info arch).tar.gz" -O crictl.tar.gz\
&& tar zxvf crictl.tar.gz -C /build/bin; fi



FROM scratch
Expand Down
25 changes: 0 additions & 25 deletions deployment/helm/templates/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ spec:
- name: DEBUG_ECHO_INSTANCES_SHARED
value: {{ .Values.debugEcho.configuration.shared | quote }}
{{- end }}
- name: HOST_CRICTL_PATH
value: /usr/local/bin/crictl
- name: HOST_RUNTIME_ENDPOINT
value: unix:///host/run/containerd/containerd.sock
- name: HOST_IMAGE_ENDPOINT
value: unix:///host/run/containerd/containerd.sock
- name: AGENT_NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -86,8 +80,6 @@ spec:
mountPath: /var/lib/kubelet/device-plugins
- name: pod-resources
mountPath: /var/lib/kubelet/pod-resources
- name: var-run-dockershim
mountPath: /host/run/containerd/containerd.sock
{{- if .Values.agent.host.udev }}
- name: devices
mountPath: /run/udev
Expand All @@ -111,23 +103,6 @@ spec:
- name: pod-resources
hostPath:
path: "{{ .Values.agent.host.kubeletPodResources }}"
- name: var-run-dockershim
hostPath:
{{- if ne "" .Values.agent.host.containerRuntimeSocket }}
path: {{.Values.agent.host.containerRuntimeSocket }}
{{- else if eq .Values.kubernetesDistro "microk8s" }}
path: "/var/snap/microk8s/common/run/containerd.sock"
{{- else if eq .Values.kubernetesDistro "k3s" }}
path: "/run/k3s/containerd/containerd.sock"
{{- else if eq .Values.kubernetesDistro "k8s" }}
path: "/run/containerd/containerd.sock"
{{- else }}
# Please set container runtime socket by either selecting the appropriate K8s distro `kubernetesDistro=<k8s|k3s|microk8s>`
# or setting `agent.host.containerRuntimeSocket=/container/runtime.sock`.
# See https://docs.akri.sh/user-guide/cluster-setup for more information.
# Using K8s default "/run/containerd/containerd.sock" for now.
path: "/run/containerd/containerd.sock"
{{- end }}
{{- if .Values.agent.host.udev }}
- name: devices
hostPath:
Expand Down
9 changes: 0 additions & 9 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ useDevelopmentContainers: true
# This can be set from the helm command line using `--set imagePullSecrets[0].name="mysecret"`
imagePullSecrets: []

# kubernetesDistro describes the Kubernetes distro Akri is running on. It is used to conditionally set
# distribution specific values such as container runtime socket. Options: microk8s | k3s | k8s
kubernetesDistro: ""

# generalize references to `apiGroups` and `apiVersion` values for Akri CRDs
crds:
group: akri.sh
Expand Down Expand Up @@ -109,11 +105,6 @@ agent:
kubeletDevicePlugins: /var/lib/kubelet/device-plugins
# kubeletPodResources is the location of the kubelet pod-resources socket
kubeletPodResources: /var/lib/kubelet/pod-resources
# containerRuntimeSocket is the default node path of the container runtime socket.
# For MicroK8s, set to "/var/snap/microk8s/common/run/containerd.sock"
# For K3s, set to "/run/k3s/containerd/containerd.sock"
# For standard K8s, set to "/run/containerd/containerd.sock"
containerRuntimeSocket: ""
# udev is the node path of udev, usually at `/run/udev`
udev:
# allowDebugEcho dictates whether the Akri Agent will allow DebugEcho Configurations
Expand Down
3 changes: 0 additions & 3 deletions scripts/end_to_end_microk8s_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ echo "--allow-privileged=true" | sudo tee -a /var/snap/microk8s/current/args/kub

sudo microk8s stop && microk8s start

KUBERNETES_DISTRO="--set kubernetesDistro=microk8s"

sudo apt update
sudo apt -y install linux-modules-extra-$(uname -r)
sudo apt -y install dkms
Expand All @@ -30,7 +28,6 @@ sudo gst-launch-1.0 -v videotestsrc pattern=smpte horizontal-speed=1 ! "video/x-

sudo microk8s.helm3 repo add akri-helm-charts https://project-akri.github.io/akri/
sudo microk8s.helm3 install akri akri-helm-charts/akri-dev \
$KUBERNETES_DISTRO \
--set useLatestContainers=true \
--set udev.enabled=true \
--set udev.name=akri-udev-video \
Expand Down
34 changes: 3 additions & 31 deletions test/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,9 @@ def pytest_addoption(parser):
parser.addoption("--release", action="store_true", help="use released helm chart")


@dataclass
class Distribution:
name: str
kubeconfig: Path
kubectl: str


@pytest.fixture(scope="session")
def distribution_config(pytestconfig):
distribution = pytestconfig.getoption("--distribution", None)
if distribution == "k3s":
yield Distribution("k3s", Path.home() / ".kube/config", "kubectl")
elif distribution == "k8s":
yield Distribution("k8s", Path.home() / ".kube/config", "kubectl")
elif distribution == "microk8s":
yield Distribution("microk8s", Path.home() / ".kube/config", "kubectl")
elif distribution is None:
pytest.exit(
"Please provide a kubernetes distribution via '--distribution' flag"
)
else:
pytest.exit(
"Wrong distribution provided, valid values are 'k3s', 'k8s' or 'microk8s'"
)


@pytest.fixture(scope="session", autouse=True)
def kube_client(distribution_config):
kubernetes.config.load_kube_config(str(distribution_config.kubeconfig))
def kube_client():
kubernetes.config.load_kube_config(str(Path.home() / ".kube/config"))
return kubernetes.client.ApiClient()


Expand All @@ -61,7 +35,7 @@ def akri_version(pytestconfig):


@pytest.fixture(scope="module", autouse=True)
def install_akri(request, distribution_config, pytestconfig, akri_version):
def install_akri(request, pytestconfig, akri_version):
discovery_handlers = getattr(request.module, "discovery_handlers", [])

release = pytestconfig.getoption("--release", False)
Expand Down Expand Up @@ -116,8 +90,6 @@ def install_akri(request, distribution_config, pytestconfig, akri_version):
)
helm_install_command.extend(
[
"--set",
f"kubernetesDistro={distribution_config.name}",
"--debug",
"--atomic",
]
Expand Down

0 comments on commit 605f9b4

Please sign in to comment.