יצירת מכונה עם Confidential Computing

במאמר הזה מוסבר איך ליצור מכונת עבודה של Gemini Enterprise Agent Platform עם הפעלה של Confidential Computing.

סקירה כללית

‏Confidential Computing הוא הגנה על נתונים בשימוש באמצעות סביבת מחשוב אמינה (TEE) שמבוססת על חומרה. סביבות מחשוב אמינות (TEE) הן סביבות מאובטחות ומבודדות שמונעות גישה לא מורשית לאפליקציות ולנתונים בזמן שמשתמשים בהם, או שינוי שלהם. תקן האבטחה הזה מוגדר על ידי Confidential Computing Consortium.

כשיוצרים מופע של Agent Platform Workbench עם Confidential Computing מופעל, המופע החדש של Agent Platform Workbench הוא מופע של מכונה וירטואלית חסויה. מידע נוסף על מכונות וירטואליות חסויות זמין במאמר סקירה כללית על מכונות וירטואליות חסויות.

לפני שמתחילים

  1. נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Compute Engine and Notebooks APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Compute Engine and Notebooks APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

התפקידים הנדרשים

כדי לקבל את ההרשאות שנדרשות ליצירת מופע של Agent Platform Workbench, צריך לבקש מהאדמין להקצות לכם את תפקיד ה-IAM‏ Notebooks Runner (roles/notebooks.runner) בפרויקט. כדי לקרוא הסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.

יכול להיות שאפשר לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש.

יצירת מופע

אפשר ליצור מכונה עם הפעלת Confidential Computing באמצעות Google Cloud המסוף, ה-CLI של gcloud או API בארכיטקטורת REST:

המסוף

כדי ליצור מכונה של Agent Platform Workbench עם הפעלת Confidential Computing:

  1. נכנסים לדף Instances במסוף Google Cloud .

    כניסה לדף Instances

  2. לוחצים על  יצירת פריט חדש.

  3. בתיבת הדו-שיח New instance, לוחצים על Advanced options.

  4. בתיבת הדו-שיח Create instance, בקטע Machine type, בוחרים סוג מכונה N2D. יש תמיכה רק בסוגי מכונות N2D.

  5. בקטע Confidential VM service, בוחרים באפשרות Enable Confidential Computing.

  6. בתיבת הדו-שיח הפעלת Confidential Computing, לוחצים על הפעלה.

  7. לוחצים על יצירה.

    הכלי Agent Platform Workbench יוצר מופע ומתחיל אותו באופן אוטומטי. כשהמופע מוכן לשימוש, מופעל קישור Open JupyterLab ב-Agent Platform Workbench.

gcloud

כדי ליצור מכונת Agent Platform Workbench עם Confidential Computing מופעל, משתמשים בפקודה gcloud workbench instances create ומגדירים את --confidential-compute-type ל-SEV.

לפני השימוש בנתוני הפקודה הבאים, צריך להחליף את הנתונים הבאים:

  • INSTANCE_NAME: השם של מופע Agent Platform Workbench. השם צריך להתחיל באות, ואחריה יכולים להיות עד 62 אותיות קטנות, מספרים או מקפים (-). השם לא יכול להסתיים במקף.
  • PROJECT_ID: מזהה הפרויקט
  • LOCATION: האזור שבו רוצים למקם את המכונה
  • MACHINE_TYPE: ‏סוג המכונה של מכונת ה-VM של המופע, לדוגמה: n2d-standard-2

מריצים את הפקודה הבאה:

‫Linux,‏ macOS או Cloud Shell

gcloud workbench instances create INSTANCE_NAME \
    --project=PROJECT_ID \
    --location=LOCATION \
    --machine-type=MACHINE_TYPE \
    --confidential-compute-type=SEV

‏Windows (PowerShell)

gcloud workbench instances create INSTANCE_NAME `
    --project=PROJECT_ID `
    --location=LOCATION `
    --machine-type=MACHINE_TYPE `
    --confidential-compute-type=SEV

Windows‏ (cmd.exe)

gcloud workbench instances create INSTANCE_NAME ^
    --project=PROJECT_ID ^
    --location=LOCATION ^
    --machine-type=MACHINE_TYPE ^
    --confidential-compute-type=SEV

הכלי Agent Platform Workbench יוצר מופע ומתחיל אותו באופן אוטומטי. כשהמופע מוכן לשימוש, קישור Open JupyterLab מופעל ב Google Cloud מסוף Agent Platform Workbench.

REST

כדי ליצור מופע של Agent Platform Workbench עם הפעלה של Confidential Computing, משתמשים בשיטה projects.locations.instances.create וכוללים את confidentialInstanceConfig ב-GceSetup.

לפני שמשתמשים בנתוני הבקשה, צריך להחליף את הנתונים הבאים:

  • PROJECT_ID: מזהה הפרויקט
  • LOCATION: האזור שבו רוצים למקם את המכונה
  • MACHINE_TYPE: ‏סוג המכונה של מכונת ה-VM של המופע, לדוגמה: n2d-standard-2

ה-method של ה-HTTP וכתובת ה-URL:

POST https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances

גוף בקשת JSON:

{
  "gce_setup": {
    "machine_type": "MACHINE_TYPE",
    "confidentialInstanceConfig": {
      "confidentialInstanceType": SEV
    }
  }
}

כדי לשלוח את הבקשה עליכם לבחור אחת מהאפשרויות הבאות:

curl

שומרים את גוף הבקשה בקובץ בשם request.json ומריצים את הפקודה הבאה:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances"

PowerShell

שומרים את גוף הבקשה בקובץ בשם request.json ומריצים את הפקודה הבאה:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://notebooks.googleapis.com/v2/projects/PROJECT_ID/locations/LOCATION/instances" | Select-Object -Expand Content

הכלי Agent Platform Workbench יוצר מופע ומתחיל אותו באופן אוטומטי. כשהמופע מוכן לשימוש, קישור Open JupyterLab מופעל ב Google Cloud מסוף Agent Platform Workbench.

בדיקה אם מופעלת במופע Confidential Computing

כדי לבדוק אם Confidential Computing מופעל במופע של Agent Platform Workbench:

  1. נכנסים לדף Instances במסוף Google Cloud .

    כניסה לדף Instances

  2. בעמודה Instance name (שם המכונה), לוחצים על שם המכונה שרוצים לבדוק.

    ייפתח הדף פרטי המופע.

  3. לצד פרטי המכונה הווירטואלית, לוחצים על הצגה ב-Compute Engine.

  4. בדף הפרטים של Compute Engine, הערך של Confidential VM service הוא Enabled או Disabled.

מגבלות

כשיוצרים מופע של Agent Platform Workbench עם הפעלת Confidential Computing או משתמשים בו, חלות המגבלות הבאות:

  • יש תמיכה רק בסוגי מכונות N2D. סוגי מכונות N2D

  • יש תמיכה רק בטכנולוגיית המחשוב הסודי של AMD SEV. מידע נוסף זמין במאמר בנושא AMD SEV.

  • אי אפשר להפעיל או להשבית את Confidential Computing אחרי שיוצרים את מופע Agent Platform Workbench.

חיוב

כשמשתמשים במופעים של Agent Platform Workbench עם Confidential Computing, מחויבים על הפעולות הבאות:

המאמרים הבאים