Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ isort==5.12.0
types-requests==0.1.9
types-setuptools==57.4.3
types-psutil==5.8.0
grpcio-tools==1.43.0
grpcio-tools==1.53.0
types-dataclasses==0.6.6
backoff-stubs~=1.10
pytest~=7.0.1
Expand Down
8 changes: 5 additions & 3 deletions granulate_utils/containers/cri.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under the AGPL3 License. See LICENSE.md in the project root for license information.
#
import json
import os
from typing import List, Optional, Union

import grpc # type: ignore # no types-grpc sadly
Expand Down Expand Up @@ -38,9 +39,10 @@ class CriClient(ContainersClientInterface):
def __init__(self) -> None:
self._runtimes = {}
for rt, path in RUNTIMES:
path = "unix://" + ns.resolve_host_root_links(path)
if self._is_cri_available(path):
self._runtimes[rt] = path
if os.path.exists(path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what better we can do about it.
It seems reasonable to put this check here, and prevent grpc from retrying connection to unavailable unix socket.

path = "unix://" + ns.resolve_host_root_links(path)
if self._is_cri_available(path):
self._runtimes[rt] = path

if not self._runtimes:
raise CriNotAvailableError(f"CRI is not available at any of {RUNTIMES}")
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
psutil~=5.8.0
requests~=2.27.1
grpcio~=1.43.0
grpcio~=1.53.0
protobuf~=3.19.4
docker~=5.0.0
dataclasses~=0.8; python_version < '3.7'
typing-extensions>=4.1.0
pyelftools~=0.28
packaging~=23.1
Expand Down