Skip to content

Commit

Permalink
fix: fix install issue (#6037)
Browse files Browse the repository at this point in the history
Signed-off-by: Joan Fontanals Martinez <[email protected]>
  • Loading branch information
JoanFM authored Sep 5, 2023
1 parent 7123bca commit 034a7b1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ jobs:
pip install docarray==0.21.0
jina
export JINA_LOG_LEVEL="ERROR"
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test k8s Flow
Expand Down Expand Up @@ -228,6 +230,8 @@ jobs:
pip install docarray==0.21.0
jina
export JINA_LOG_LEVEL="ERROR"
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test k8s Deployment
Expand Down Expand Up @@ -268,6 +272,8 @@ jobs:
pip install docarray==0.21.0
jina
export JINA_LOG_LEVEL="ERROR"
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test graceful request handling on k8s
Expand Down Expand Up @@ -308,6 +314,8 @@ jobs:
pip install docarray==0.21.0
jina
export JINA_LOG_LEVEL="ERROR"
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test k8s failures
Expand Down Expand Up @@ -349,6 +357,8 @@ jobs:
pip install docarray==0.21.0
jina
export JINA_LOG_LEVEL="ERROR"
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test K8s with OpenTelemetry
Expand Down
2 changes: 1 addition & 1 deletion extra-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ opentelemetry-api>=1.12.0: core
opentelemetry-instrumentation-grpc>=0.35b0: core
uvloop: perf,standard,devel
prometheus_client>=0.12.0: perf,standard,devel
opentelemetry-sdk>=1.14.0: perf,standard,devel
opentelemetry-sdk>=1.14.0,<1.20.0: perf,standard,devel
opentelemetry-exporter-otlp>=1.12.0: perf,standard,devel
opentelemetry-exporter-prometheus>=1.12.0rc1: perf,standard,devel
opentelemetry-instrumentation-aiohttp-client>=0.33b0: perf,standard,devel
Expand Down
2 changes: 1 addition & 1 deletion jina/resources/extra-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ opentelemetry-api>=1.12.0: core
opentelemetry-instrumentation-grpc>=0.35b0: core
uvloop: perf,standard,devel
prometheus_client>=0.12.0: perf,standard,devel
opentelemetry-sdk>=1.14.0: perf,standard,devel
opentelemetry-sdk>=1.14.0,<1.20.0: perf,standard,devel
opentelemetry-exporter-otlp>=1.12.0: perf,standard,devel
opentelemetry-exporter-prometheus>=1.12.0rc1: perf,standard,devel
opentelemetry-instrumentation-aiohttp-client>=0.33b0: perf,standard,devel
Expand Down
8 changes: 4 additions & 4 deletions tests/k8s/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, kind_cluster: KindCluster, logger: JinaLogger) -> None:
)
self._log = logger
self._set_kube_config()
self._install_linkderd(kind_cluster)
self._install_linkerd(kind_cluster)
self._loaded_images = set()

def _linkerd_install_cmd(
Expand Down Expand Up @@ -69,7 +69,7 @@ def _linkerd_install_cmd(
if returncode is not None and returncode != 0:
raise Exception(f'Installing {tool_name} failed with {returncode}')

def _install_linkderd(self, kind_cluster: KindCluster) -> None:
def _install_linkerd(self, kind_cluster: KindCluster) -> None:
# linkerd < 2.12: only linkerd install is needed
# in later versions, linkerd install --crds will be needed
self._linkerd_install_cmd(
Expand All @@ -86,11 +86,11 @@ def _install_linkderd(self, kind_cluster: KindCluster) -> None:
print(f'linkerd check yields {out.decode() if out else "nothing"}')
except subprocess.CalledProcessError as e:
print(
f'linkerd check failed with error code { e.returncode } and output { e.output }'
f'linkerd check failed with error code { e.returncode } and output { e.output }, and stderr { e.stderr }'
)
raise

def install_linkderd_smi(self) -> None:
def install_linkerd_smi(self) -> None:
self._log.info('Installing Linkerd SMI to Cluster...')
proc = subprocess.Popen(
[f'{Path.home()}/.linkerd2/bin/linkerd-smi', 'install'],
Expand Down
2 changes: 1 addition & 1 deletion tests/k8s/test_k8s_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async def async_inputs(sent_ids: Set[int], sleep_time: float = 0.05):


def inject_failures(k8s_cluster, logger):
k8s_cluster.install_linkderd_smi()
k8s_cluster.install_linkerd_smi()
logger.info(f'Inject random failures into test cluster')
proc = subprocess.Popen(
[
Expand Down
12 changes: 8 additions & 4 deletions tests/k8s/test_k8s_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,17 +960,21 @@ async def test_flow_with_external_k8s_deployment(logger, docker_images, tmpdir):
@pytest.mark.asyncio
@pytest.mark.timeout(3600)
@pytest.mark.parametrize('grpc_metadata', [{}, {"key1": "value1"}])
async def test_flow_with_metadata_k8s_deployment(logger, grpc_metadata, tmpdir):
@pytest.mark.parametrize(
'docker_images',
[['jinaai/jina']],
indirect=True,
)
async def test_flow_with_metadata_k8s_deployment(logger, grpc_metadata, docker_images, tmpdir):
from kubernetes import client

namespace = 'test-flow-with-metadata-k8s-deployment'.lower()
api_client = client.ApiClient()
core_client = client.CoreV1Api(api_client=api_client)
app_client = client.AppsV1Api(api_client=api_client)
try:
docker_images = ['test-executor', 'jinaai/jina']

await _create_external_deployment(api_client, app_client, docker_images, tmpdir)
images = ['test-executor']
await _create_external_deployment(api_client, app_client, images, tmpdir)

flow = Flow(name='k8s_flow-with_metadata_deployment').add(
name='external_executor',
Expand Down

0 comments on commit 034a7b1

Please sign in to comment.