Skip to content

Commit

Permalink
Set higher resources in pod config file and submit with more parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
Deependra Patel committed Nov 8, 2024
1 parent c4f105e commit a1aae5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cloudbuild/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ determine_tests_to_run() {
}

run_tests() {
local -r max_parallel_tests=10
local -r max_parallel_tests=20
bazel test \
--jobs="${max_parallel_tests}" \
--local_test_jobs="${max_parallel_tests}" \
Expand Down
32 changes: 26 additions & 6 deletions cloudbuild/run-presubmit-on-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,32 @@ LOGS_SINCE_TIME=$(date --iso-8601=seconds)

# This kubectl sometimes fails because services have not caught up. Thread.yield()
sleep 10s
kubectl run "${POD_NAME}" \
--image="${IMAGE}" \
--restart=Never \
--env="COMMIT_SHA=${COMMIT_SHA}" \
--env="IMAGE_VERSION=${DATAPROC_IMAGE_VERSION}" \
--command -- bash /init-actions/cloudbuild/presubmit.sh

readonly POD_CONFIG="pod.yaml"
cat >$POD_CONFIG <<EOF
apiVersion: v1
kind: Pod
metadata:
name: "${POD_NAME}"
spec:
restartPolicy: Never
containers:
- name: "dataproc-test-runner"
image: "${IMAGE}"
resources:
requests:
memory: "4G"
cpu: "6000m"
env:
- name: COMMIT_SHA
value: "${COMMIT_SHA}"
- name: IMAGE_VERSION
value: "${DATAPROC_IMAGE_VERSION}"
command: ["bash"]
args: ["/init-actions/cloudbuild/presubmit.sh"]
EOF

kubectl apply -f $POD_CONFIG

# Delete POD on exit and describe it before deletion if exit was unsuccessful
trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT
Expand Down

0 comments on commit a1aae5b

Please sign in to comment.