Skip to content

Commit

Permalink
Fix get-credentials; To support debugging of the test worker image de…
Browse files Browse the repository at this point in the history
…ploy a stateful set that is in sync with the worker image (kubeflow#713)

* To support debugging of the test worker image deploy a stateful set that
is in sync with the worker image

* Fix get-credentials in notebook tasks

* Related to GoogleCloudPlatform/kubeflow-distribution#65
  • Loading branch information
jlewi authored Jul 2, 2020
1 parent 43d2dbb commit 6fd81e2
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test-pod
namespace: auto-deploy
spec:
replicas: 1
selector:
matchLabels:
app: test-pod
serviceName: test-pod
template:
metadata:
labels:
app: test-pod
spec:
containers:
- command:
- tail
- -f
- /dev/null
image: gcr.io/kubeflow-ci/test-worker-py3:fb970ef@sha256:804c6cc8a73face69d79c60bcd85b93fa04218db9ee31127fb529b41fcab43ac
name: worker
ports:
- containerPort: 80
name: web
serviceAccount: kf-ci
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- get-credentials
- --pattern=$(inputs.params.testing-cluster-pattern)
- --location=$(inputs.params.testing-cluster-location)
- get-credentials
- --output=/workspace/cluster.info.yaml
command:
- python
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: test-pod
name: test-pod
namespace: auto-deploy
spec:
clusterIP: None
ports:
- name: web
port: 80
selector:
app: test-pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test-pod
namespace: kf-ci
spec:
replicas: 1
selector:
matchLabels:
app: test-pod
serviceName: test-pod
template:
metadata:
labels:
app: test-pod
spec:
containers:
- command:
- tail
- -f
- /dev/null
image: gcr.io/kubeflow-ci/test-worker-py3:fb970ef@sha256:804c6cc8a73face69d79c60bcd85b93fa04218db9ee31127fb529b41fcab43ac
name: worker
ports:
- containerPort: 80
name: web
serviceAccount: kf-ci
terminationGracePeriodSeconds: 10
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- get-credentials
- --pattern=$(inputs.params.testing-cluster-pattern)
- --location=$(inputs.params.testing-cluster-location)
- get-credentials
- --output=/workspace/cluster.info.yaml
command:
- python
env:
Expand Down
14 changes: 14 additions & 0 deletions acm-repos/kf-ci-v1/namespaces/kf-ci/~g_v1_service_test-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: test-pod
name: test-pod
namespace: kf-ci
spec:
clusterIP: None
ports:
- name: web
port: 80
selector:
app: test-pod
1 change: 1 addition & 0 deletions tekton/templates/pipelines/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources:
- gcp-kf-ready.yaml
- go-test-pipeline.yaml
- notebook-test-pipeline.yaml
- test-pod.yaml
45 changes: 45 additions & 0 deletions tekton/templates/pipelines/test-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is a bit of a hack
# This is a stateful set that starts a pod using the worker image.
# It is primarily useful for inspecting what's in the image
apiVersion: v1
kind: Service
metadata:
name: test-pod
labels:
app: test-pod
spec:
ports:
- port: 80
name: web
clusterIP: None
selector:
app: test-pod
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: test-pod
spec:
selector:
matchLabels:
app: test-pod # has to match .spec.template.metadata.labels
serviceName: "test-pod"
replicas: 1 # by default is 1
template:
metadata:
labels:
app: test-pod # has to match .spec.selector.matchLabels
spec:
terminationGracePeriodSeconds: 10
containers:
- name: worker
image: gcr.io/kubeflow-ci/test-worker-py3:fb970ef@sha256:804c6cc8a73face69d79c60bcd85b93fa04218db9ee31127fb529b41fcab43ac # {"type":"string","x-kustomize":{"setBy":"kpt","partialSetters":[{"name":"test-image","value":"gcr.io/kubeflow-ci/test-worker-py3:fb970ef@sha256:804c6cc8a73face69d79c60bcd85b93fa04218db9ee31127fb529b41fcab43ac"}]}}
command:
- tail
- -f
- /dev/null
ports:
- containerPort: 80
name: web
# Bind to a service account with workload identity
serviceAccount: kf-ci
2 changes: 1 addition & 1 deletion tekton/templates/tasks/notebook-test-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- get-credentials
- --pattern=$(inputs.params.testing-cluster-pattern)
- --location=$(inputs.params.testing-cluster-location)
- get-credentials
- --output=/workspace/cluster.info.yaml
env:
- name: PYTHONPATH
value: /srcCache/kubeflow/testing/py
Expand Down

0 comments on commit 6fd81e2

Please sign in to comment.