Mulai 29 April 2025, model Gemini 1.5 Pro dan Gemini 1.5 Flash tidak tersedia di project yang belum pernah menggunakan model ini, termasuk project baru. Untuk mengetahui detailnya, lihat Versi dan siklus proses model.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Pada langkah ini, Anda akan membuat layanan Cloud Run untuk men-deploy aplikasi dari
repositori yang Anda buat fork pada langkah sebelumnya. Anda juga menyiapkan pemicu Cloud Build otomatis, sehingga aplikasi di-build dan di-deploy ke Google Cloudsetiap kali Anda mendorong commit baru ke repositori.
Membuat layanan Cloud Run dengan build berkelanjutan
Dalam daftar Repositori, pilih repositori GitHub yang di-fork yang Anda buat untuk aplikasi.
Jika repositori Anda tidak tercantum, klik Kelola repositori yang terhubung.
Saat menyelesaikan langkah ini, lakukan hal berikut, jika diminta:
Lakukan autentikasi ke GitHub.
Instal Cloud Build di akun GitHub Anda.
Jika Anda memilih repositori untuk pertama kalinya untuk digunakan dengan Cloud Build dalam project, centang kotak untuk menyetujui kebijakan persyaratan penggunaan.
Klik Berikutnya.
Di bagian Build configuration, masukkan detail berikut:
Cabang: Cabang default-nya adalah ^main$. Jangan perbarui ini.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["# Step 2: Create a Cloud Run service\n\nIn this step, you create a Cloud Run service to deploy the app from the\nrepository that you forked in the previous step. You also set up an automatic\nCloud Build trigger, so that the app is built and deployed to Google Cloud\nwhenever you push a new commit to the repository.\n\nCreate a Cloud Run service with continuous build\n------------------------------------------------\n\n1. In the Google Cloud console, navigate to Cloud Run.\n\n [Go to Cloud Run](https://console.cloud.google.com/run)\n2. Click **Create service**.\n\n3. Select **Continuously deploy from a repository**.\n\n4. Click **Set up with Cloud Build**.\n\n5. In the **Repository** list, select the forked GitHub repository that you created\n for your app.\n\n If your repository isn't listed, click **Manage connected repositories**.\n While completing this step, do the following, if prompted:\n - Authenticate to GitHub.\n\n - Install Cloud Build on your GitHub account.\n\n6. If you're selecting a repository for the first time for use with\n Cloud Build in your project, select the checkbox to agree to the terms of\n use policy.\n\n7. Click **Next**.\n\n8. In the **Build configuration** section, enter the following details:\n\n - **Branch** : The default branch is `^main$`. Don't update this.\n\n - **Build type** : Click **Dockerfile**.\n\n - **Source location**: Enter the following:\n\n /gemini/sample-apps/gemini-streamlit-cloudrun/Dockerfile\n\n9. Click **Save**.\n\n10. On the **Create service** page, enter the following details in the **Configure** section:\n\n - **Service name** : Enter `gemini-streamlit-cloudrun`.\n\n - **Authentication** : Click **Allow unauthenticated invocations**.\n\n - **Service autoscaling** : Set the **Minimum number of instances** to `1`.\n\n11. Click **Container(s), volumes, networking, security**.\n\n12. In the **Revision autoscaling** section, enter the following:\n\n - **Minimum number of instances** : Enter `1`.\n\n - **Maximum number of instances** : Enter `3`.\n\n13. Click **Create**.\n\n14. Optional: To test the app deployment to Cloud Run, do the following: \n\n 1. On the **Services** page in Cloud Run, click the service name.\n\n [Go to the Services page](https://console.cloud.google.com/run)\n 2. On the **Service details** page, click the **URL** displayed next to the service name.\n\nSet up an automatic Cloud Build trigger\n---------------------------------------\n\n1. Navigate to the **Triggers** page in Cloud Build.\n\n [Go to the Triggers page](https://console.cloud.google.com/cloud-build/triggers)\n2. Click the name of your new trigger.\n\n3. Under **Source** , click to expand **Show included and ignored files filters**.\n\n4. In the **Included files filter** box, enter `gemini-streamlit-cloudrun/**`.\n\n5. Click **Save**.\n\n | **Tip:** If you want to manually build the Cloud Run service again, go to the **Triggers** page and click **Run**."]]