Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP: Updated install flow and managed infra #185

Merged
merged 57 commits into from
Aug 16, 2023
Merged

Conversation

samos123
Copy link
Contributor

@samos123 samos123 commented Aug 11, 2023

  • Changes the Service Account that the controller-manager and gcpmanager use to `substratus
  • Removed all terraform except parts related to cluster and nodepool creation
  • Updated gcp-up.sh to create bucket, gar, GSA and required permissions
  • Add skaffold support gcp for both the controller-manager and csi

The GCP branch is working very good so far. Here is what I tested:

  • New installation flow brings up cluster and script with gcloud commands adds required permissions
    make dev-run-gcp and verifying workload identity things got installed
  • in-cluster deployment by using make dev-skaffold-gcp and doing the following in a new namespace:
    • Load a model
    • Finetune a model
    • Load a dataset
    • Serve a model
    • Run a notebook using upload

Issue has been resolved by retrying and sleeping for 5 seconds during initial startup of sci-gcp. There was a long delay after annotating the K8s SA for it to be able to utilize the GSA. As a result the sci-gcp container will restart many times until GKE workload identity finally starts working. You would originally see the following error message:

ERROR   setup   failed to validate server       {"error": "Post \"https://iam.googleapis.com/v1/projects/sam-XX/serviceAccounts/substratus@sam-XX.iam.gserviceaccount.com:getIamPolicy?alt=json&prettyPrint=false\": compute: Received 403 `Unable to generate access token; IAM returned 403 Forbidden: Permission 'iam.serviceAccounts.getAccessToken' denied on resource (or it may not exist).\nThis error could be caused by a missing IAM policy binding on the target IAM service account.\nFor more information, refer to the Workload Identity documentation:\n\thttps://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity#authenticating_to\n\n`"}

Issue: Kaniko builder gets stuck when creating a new namespace

error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "us-central1-docker.pkg.de...

Solved by running an initContainer that validates GKE metadata is ready for the pod: https://cloud.google.com/kubernetes-engine/docs/troubleshooting/troubleshooting-security#workload-identity

@samos123 samos123 marked this pull request as draft August 11, 2023 05:37
config/gcpmanager/gcp-manager.yaml Outdated Show resolved Hide resolved
@samos123 samos123 force-pushed the gcp-managed-infra branch 3 times, most recently from 34c1935 to 519f445 Compare August 13, 2023 06:15
@samos123 samos123 requested a review from nstogner August 13, 2023 08:40
@samos123 samos123 marked this pull request as ready for review August 13, 2023 08:40
@samos123 samos123 marked this pull request as draft August 13, 2023 08:44
@samos123 samos123 marked this pull request as ready for review August 13, 2023 08:48
Copy link
Contributor

@nstogner nstogner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove config/sci-kind and config/install-kind? These will cause merge conflicts later. Other than that, I dont see blockers to merge.

internal/sci/gcp/manager_test.go Outdated Show resolved Hide resolved
internal/sci/gcp/manager_test.go Outdated Show resolved Hide resolved
internal/sci/gcp/manager_test.go Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected to see a companion gcp-down.sh. What, do you work for Google or something? 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right I hadn't gotten to it. Good catch!

Copy link
Contributor

@brandonjbjelland brandonjbjelland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is fully working, awesome work and ship it when you're ready.

Makefile Outdated Show resolved Hide resolved
internal/controller/utils.go Outdated Show resolved Hide resolved
internal/controller/utils.go Outdated Show resolved Hide resolved
internal/sci/gcp/manager.go Outdated Show resolved Hide resolved
internal/sci/gcp/manager_test.go Show resolved Hide resolved
internal/sci/gcp/manager_test.go Show resolved Hide resolved
@samos123 samos123 requested a review from nstogner August 16, 2023 05:24
@samos123 samos123 merged commit 4eb846e into main Aug 16, 2023
4 checks passed
@samos123 samos123 deleted the gcp-managed-infra branch August 16, 2023 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants