Skip to content

Commit

Permalink
Update cronjob to deploy testing clusters to kubeflow-ci-deployment (k…
Browse files Browse the repository at this point in the history
…ubeflow#352)

* fix cronjob config

* change name

* set up CLIENT_ID/CLIENT_SECRET and use kubeflow-ci-deployment

* update labels on cluster

* update docker tags

* create oauth secret

* update img tag
  • Loading branch information
gabrielwen authored and k8s-ci-robot committed Apr 5, 2019
1 parent 76f5c1d commit 98b8fb9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
7 changes: 7 additions & 0 deletions py/kubeflow/testing/create_kf_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ def main(): # pylint: disable=too-many-locals,too-many-statements
"--update-labels", ",".join(label_args)],
cwd=app_dir)

# Set labels on the cluster. Labels on the deployment is not shown on
# Pantheon - it's easier for users to read if cluster also has labels.
util.run(["gcloud", "container", "clusters", "update", name,
"--zone", args.zone,
"--update-labels", ",".join(label_args)],
cwd=app_dir)

# To work around lets-encrypt certificate uses create a self-signed
# certificate
util.run(["kubectl", "config", "use-context", name])
Expand Down
5 changes: 4 additions & 1 deletion test-infra/auto-deploy/auto_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ required_args=(data_dir repos project job_labels base_name max_num_cluster zone)
parseArgs $*
validateRequiredArgs ${required_args}

export CLIENT_ID=$(cat /secret/oauth-secret/CLIENT_ID)
export CLIENT_SECRET=$(cat /secret/oauth-secret/CLIENT_SECRET)

# Activate service account auth.
if [ ! -z ${GOOGLE_APPLICATION_CREDENTIALS} ]; then
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}
Expand Down Expand Up @@ -68,4 +71,4 @@ python -m kubeflow.testing.create_kf_instance \
--snapshot_file=${data_dir}/snapshot.json \
--zone=${zone}

# TODO(gabrielwen): Push changes to app folders to git.
# TODO(gabrielwen): Push changes to app folders to git.
10 changes: 8 additions & 2 deletions test-infra/auto-deploy/deploy-cron-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ spec:
spec:
containers:
- name: deploy-worker
image: gcr.io/kubeflow-ci/deploy-worker:v20190302-afc8ef8-dirty-201fe5
image: gcr.io/kubeflow-ci/deploy-worker:v20190404-cda5cee-e3b0c4
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/gcp-credentials/key.json
command:
- /usr/local/bin/auto_deploy.sh
- --repos=kubeflow/kubeflow;kubeflow/testing
- --project=kubeflow-ci
- --project=kubeflow-ci-deployment
- --job_labels=/etc/pod-info/labels
- --data_dir=/mnt/test-data-volume/auto_deploy
- --base_name=kf-vmaster
Expand All @@ -32,6 +32,9 @@ spec:
- name: gcp-credentials
mountPath: /secret/gcp-credentials
readOnly: true
- name: oauth-secret
mountPath: /secret/oauth-secret
readOnly: true
- name: pod-info
mountPath: /etc/pod-info
readOnly: true
Expand All @@ -46,6 +49,9 @@ spec:
- name: gcp-credentials
secret:
secretName: gcp-credentials
- name: oauth-secret
secret:
secretName: kubeflow-ci-deployment-iap-testing-oauth
- name: github-token
secret:
secretName: github-token
Expand Down
12 changes: 9 additions & 3 deletions test-infra/auto-deploy/deploy-cron-v0-5.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: auto-deploy-v0-4
name: auto-deploy-v0-5
clusterName: kubeflow-testing
namespace: kubeflow-test-infra
spec:
Expand All @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: deploy-worker
image: gcr.io/kubeflow-ci/deploy-worker:v20190302-afc8ef8-dirty-201fe5
image: gcr.io/kubeflow-ci/deploy-worker:v20190404-cda5cee-e3b0c4
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/gcp-credentials/key.json
Expand All @@ -24,14 +24,17 @@ spec:
- --project=kubeflow-ci-deployment
- --job_labels=/etc/pod-info/labels
- --data_dir=/mnt/test-data-volume/auto_deploy
- --base_name=kf-vmaster
- --base_name=kf-v0-5
- --max_num_cluster=5
- --zone=us-east1-b
- --github_token_file=/secret/github-token/github_token
volumeMounts:
- name: gcp-credentials
mountPath: /secret/gcp-credentials
readOnly: true
- name: oauth-secret
mountPath: /secret/oauth-secret
readOnly: true
- name: pod-info
mountPath: /etc/pod-info
readOnly: true
Expand All @@ -46,6 +49,9 @@ spec:
- name: gcp-credentials
secret:
secretName: gcp-credentials
- name: oauth-secret
secret:
secretName: kubeflow-ci-deployment-iap-testing-oauth
- name: github-token
secret:
secretName: github-token
Expand Down

0 comments on commit 98b8fb9

Please sign in to comment.