Skip to content

Commit

Permalink
fix: Create zutils Artifact Registry repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nkemnitz committed Oct 22, 2024
1 parent 9f17ef2 commit fa21109
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/gcp/create_corgie_igneous_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
&& gcloud iam service-accounts add-iam-policy-binding {CLUSTER_NAME}-worker@{PROJECT_NAME}.iam.gserviceaccount.com --role roles/iam.workloadIdentityUser --member "serviceAccount:{PROJECT_NAME}.svc.id.goog[default/default]" --project {PROJECT_NAME}
&& kubectl annotate serviceaccount default --namespace default iam.gke.io/gcp-service-account={CLUSTER_NAME}-worker@{PROJECT_NAME}.iam.gserviceaccount.com"""

CREATE_ARTIFACT_REGISTRY_REPO_TMPL = "gcloud artifacts repositories create zutils --repository-format=docker --location={REGION} --project={PROJECT_NAME}"

CONFIGURE_DRIVERS_COMMAND_TMPL = "gcloud container clusters get-credentials {CLUSTER_NAME} --region {REGION} --project {PROJECT_NAME}; kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container-engine-accelerators/master/nvidia-driver-installer/cos/daemonset-preloaded-latest.yaml"


Expand Down Expand Up @@ -71,6 +73,9 @@ def main(): # pylint: disable=too-many-statements
)
parser.add_argument("--add_cpu", action="store_true", help="Add CPU node pool.")
parser.add_argument("--add_gpu", action="store_true", help="Add GPU node pool.")
parser.add_argument(
"--add-repo", action="store_true", help="Add Artifact Registry Repository."
)

args = parser.parse_args()
# cluster_version = args.cluster_version
Expand Down Expand Up @@ -138,6 +143,13 @@ def main(): # pylint: disable=too-many-statements
print(f"Running: \n{add_wi_command}")
subprocess.call(add_wi_command, shell=True)

if args.add_repo:
create_repo_command = CREATE_ARTIFACT_REGISTRY_REPO_TMPL
create_repo_command = create_repo_command.replace("{REGION}", args.region)
create_repo_command = create_repo_command.replace("{PROJECT_NAME}", args.project_name)
print(f"Running: \n{create_repo_command}")
subprocess.call(create_repo_command, shell=True)


if __name__ == "__main__":
main()

0 comments on commit fa21109

Please sign in to comment.