-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: k8s failure testing #4743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c7c6f21
feat: k8s failure testing
jacobowitz 7db9c65
fix: fault file path
jacobowitz 33d10e3
feat: separate k8s tests
jacobowitz 6b0f391
fix: use correct docker image in tst
jacobowitz 84e6484
fix: test issue
jacobowitz 94e976b
fix: more log output
jacobowitz c695c3f
fix: docker image name
jacobowitz 0d7161e
fix: fixtures
jacobowitz 071510f
fix: delete issue
jacobowitz 8a64f54
fix: async sleep
jacobowitz eade619
fix: various fixes
jacobowitz d19507a
fix: smi install
jacobowitz 92ecebb
fix: linkerd smi usage
jacobowitz fcf1ca2
fix: set stop event for failure testing
jacobowitz 490699c
fix: add test to cd
jacobowitz e52ac13
feat: remove exception retry check
jacobowitz b93d630
fix: success all steps depends on new k8s test
jacobowitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: error-injector | ||
namespace: test-failure-scenarios | ||
data: | ||
nginx.conf: |- | ||
events {} | ||
http { | ||
server { | ||
listen 9090; | ||
location / { | ||
return 500; | ||
} | ||
} | ||
} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: error-injector | ||
namespace: test-failure-scenarios | ||
labels: | ||
app: error-injector | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: error-injector | ||
replicas: 1 | ||
template: | ||
metadata: | ||
annotations: | ||
linkerd.io/inject: enabled | ||
labels: | ||
app: error-injector | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:alpine | ||
volumeMounts: | ||
- name: nginx-config | ||
mountPath: /etc/nginx/nginx.conf | ||
subPath: nginx.conf | ||
volumes: | ||
- name: nginx-config | ||
configMap: | ||
name: error-injector | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: error-injector | ||
namespace: test-failure-scenarios | ||
spec: | ||
ports: | ||
- name: service | ||
port: 9090 | ||
selector: | ||
app: error-injector | ||
--- | ||
apiVersion: split.smi-spec.io/v1alpha1 | ||
kind: TrafficSplit | ||
metadata: | ||
name: error-split | ||
namespace: test-failure-scenarios | ||
spec: | ||
service: executor0 | ||
backends: | ||
- service: executor0 | ||
weight: 950m | ||
- service: error-injector | ||
weight: 50m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.git | ||
.venv | ||
.github | ||
.pytest_cache | ||
tests | ||
__pycache__ | ||
scripts | ||
env | ||
executor-clip-deployment.yml | ||
gateway-deployment.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# TODO use fixed jina version for deterministic execution | ||
FROM jinaai/jina:test-pip | ||
|
||
# setup the workspace | ||
COPY . /workspace | ||
WORKDIR /workspace | ||
|
||
ENTRYPOINT ["jina", "executor", "--uses", "config.yml"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
jtype: TagTextExecutor | ||
metas: | ||
py_modules: | ||
- debug_executor.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import time | ||
|
||
from jina import DocumentArray, Executor, requests | ||
|
||
|
||
class TagTextExecutor(Executor): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.pod_uid = os.environ['POD_UID'] | ||
|
||
@requests | ||
def process(self, docs: DocumentArray, *args, **kwargs): | ||
for doc in docs: | ||
doc.tags['replica_uid'] = self.pod_uid | ||
doc.tags['time'] = time.time() | ||
doc.text += f'_{self.pod_uid}' | ||
|
||
return docs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.