Skip to content

Commit

Permalink
Updates from testing
Browse files Browse the repository at this point in the history
  • Loading branch information
arueth committed Nov 4, 2024
1 parent 291a8a9 commit 894ab1d
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 130 deletions.
114 changes: 55 additions & 59 deletions best-practices/gke-batch-refarch/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"
[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Jobs with compact placement
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' < ./workloads/${team}/${team}-compact-job-${job_id}.yaml | kubectl apply -f - && \
sleep 0.5
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Jobs with compact placement
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' <./workloads/${team}/${team}-compact-job-${job_id}.yaml | kubectl apply -f - &&
sleep 0.5
done
sleep 1
done
sleep 1
done
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Delete compact placement Jobs
kubectl delete -f workloads/ --recursive
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Delete compact placement Jobs
kubectl delete -f workloads/ --recursive
17 changes: 8 additions & 9 deletions best-practices/gke-batch-refarch/dws/create_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"
[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# DWS Jobs
for job_id in 0; do
for team in team-a team-b; do
envsubst '$REGION, $PROJECT_ID' < ./workloads/${team}/${team}-dws-job-${job_id}.yaml | kubectl apply -f - && \
sleep 0.5
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# DWS Jobs
for job_id in 0; do
for team in team-a team-b; do
envsubst '$REGION, $PROJECT_ID' <./workloads/${team}/${team}-dws-job-${job_id}.yaml | kubectl apply -f - &&
sleep 0.5
done
sleep 1
done
sleep 1
done
8 changes: 3 additions & 5 deletions best-practices/gke-batch-refarch/dws/delete_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Delete high priority Jobs
kubectl delete -f workloads/ --recursive
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Delete high priority Jobs
kubectl delete -f workloads/ --recursive
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"
[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# High priority Jobs
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' < ./workloads/${team}/${team}-high-priority-job-${job_id}.yaml | kubectl apply -f - && \
sleep 0.5
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# High priority Jobs
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' <./workloads/${team}/${team}-high-priority-job-${job_id}.yaml | kubectl apply -f - &&
sleep 0.5
done
sleep 1
done
sleep 1
done
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Delete high priority Jobs
kubectl delete -f workloads/ --recursive
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Delete high priority Jobs
kubectl delete -f workloads/ --recursive
17 changes: 8 additions & 9 deletions best-practices/gke-batch-refarch/jobset/create_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"
[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# JobSets
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' < ./workloads/${team}/${team}-jobset-${job_id}.yaml | kubectl apply -f - && \
sleep 0.5
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# JobSets
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' <./workloads/${team}/${team}-jobset-${job_id}.yaml | kubectl apply -f - &&
sleep 0.5
done
sleep 1
done
sleep 1
done
8 changes: 3 additions & 5 deletions best-practices/gke-batch-refarch/jobset/delete_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Delete JobSets
kubectl delete -f workloads/ --recursive
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Delete JobSets
kubectl delete -f workloads/ --recursive
18 changes: 8 additions & 10 deletions best-practices/gke-batch-refarch/low_priority/create_workloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} && \

# Low priority Jobs
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' < ./workloads/${team}/${team}-low-priority-job-${job_id}.yaml | kubectl apply -f - && \
sleep 0.5
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Low priority Jobs
for job_id in 0 1 2 3; do
for team in team-a team-b team-c team-d; do
envsubst '$REGION, $PROJECT_ID' <./workloads/${team}/${team}-low-priority-job-${job_id}.yaml | kubectl apply -f - &&
sleep 0.5
done
sleep 1
done
sleep 1
done
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.


[[ ! "${PROJECT_ID}" ]] && echo -e "Please export PROJECT_ID variable (\e[95mexport PROJECT_ID=<YOUR POROJECT ID>\e[0m)\nExiting." && exit 0
echo -e "\e[95mPROJECT_ID is set to ${PROJECT_ID}\e[0m"

[[ ! "${REGION}" ]] && echo -e "Please export REGION variable (\e[95mexport REGION=<YOUR REGION, eg: us-central1>\e[0m)\nExiting." && exit 0
echo -e "\e[95mREGION is set to ${REGION}\e[0m"

gcloud container clusters get-credentials gke-batch-refarch --region ${REGION} --project ${PROJECT_ID} && \

# Delete low priority Jobs
kubectl delete -f workloads/ --recursive
gcloud container clusters get-credentials batch-dev --region ${REGION} --project ${PROJECT_ID} &&
# Delete low priority Jobs
kubectl delete -f workloads/ --recursive

0 comments on commit 894ab1d

Please sign in to comment.