Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta guía, se proporciona una descripción general introductoria de cómo otros Google Cloud servicios
participan en el proceso de implementación de Cloud Run Functions.
Cuando implementas el código fuente de la función en Cloud Run Functions, ese código fuente se almacena en un bucket de Cloud Storage. A continuación, Cloud Build compila el código de forma automática en una imagen de contenedor y envía esa imagen a un registro de imágenes de Artifact Registry.
Cloud Run Functions accede a esta imagen cuando necesita ejecutar el contenedor para ejecutar la función.
En el siguiente diagrama, el cuadro de Cloud Run Functions representa una función implementada en Cloud Run, ya sea con la API de Cloud Run Admin o la API de Cloud Functions. Por lo general, las funciones más nuevas se implementan con la API de Cloud Run Admin, y las funciones más antiguas se implementan con la API de Cloud Functions.
Figura 1. Un usuario prepara el código fuente de las funciones y
lo implementa en Cloud Run.
Según la API que se use cuando se implemente una función, ocurrirá lo siguiente:
Si implementaste tu función con la API de Cloud Run Admin, ocurrirá lo siguiente:
Tu código fuente se sube a un bucket de Cloud Storage que no tiene un período de retención.
Si usas la encriptación predeterminada, el nombre del bucket se genera automáticamente y se llama run-sources-PROJECT_ID-REGION.
El código fuente se envía a Cloud Build, donde los paquetes de compilación de Google Cloud y Functions Framework crean una imagen de contenedor. Ten en cuenta que la cuenta de servicio de Cloud Build compila la imagen del contenedor. De forma predeterminada, Cloud Run usa el tipo de máquina e2-standard-2 que proporciona Cloud Build.
Luego, tu imagen de contenedor se sube a Artifact Registry a través de un bucket creado automáticamente llamado REGION-docker.pkg.dev/PROJECT_ID/cloud-run-source-deploy.
La imagen se implementa en Cloud Run como un servicio.
Puedes activar o invocar la función con Eventarc, Pub/Sub o cualquier otro activador HTTP.
Si implementaste tu función con la API de Cloud Functions (v2), ocurrirá lo siguiente:
Tu código fuente se sube a un bucket de Cloud Storage que no tiene un período de retención.
El nombre del bucket se genera automáticamente y tiene el siguiente formato:
Si usas la encriptación predeterminada, este bucket se llama gcf-v2-sources-PROJECT_NUMBER-REGION.
Si proteges tus datos con CMEK, el bucket se llama gcf-sources-PROJECT_NUMBER-REGION-CMEK_KEY_HASH.
El código fuente se envía a Cloud Build, donde los paquetes de compilación de Google Cloud y Functions Framework crean una imagen de contenedor. Ten en cuenta que la cuenta de servicio de Cloud Build compila la imagen del contenedor. De forma predeterminada, Cloud Run usa el tipo de máquina e2-standard-2 que proporciona Cloud Build.
Luego, tu imagen de contenedor se sube a Artifact Registry a través de un bucket creado automáticamente llamado REGION-docker.pkg.dev/PROJECT_ID/gcf-artifacts.
La imagen se implementa en Cloud Run como un servicio.
Puedes activar o invocar la función con Eventarc, Pub/Sub o cualquier otro activador HTTP.
Si ya creaste funciones con la API de Cloud Functions, consulta la guía de comparación de Cloud Run Functions para obtener información sobre las diferencias entre las dos versiones de Cloud Run Functions.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Cloud Run functions overview\n\nThis guide provides an introductory overview of how other Google Cloud services\nare involved in the Cloud Run functions deployment process.\n\nBefore you begin\n----------------\n\nFamiliarize yourself with Cloud Run functions and source deployment\nconcepts from the\n[Cloud Run deployment options and resource model](/run/docs/resource-model)\nguide.\n\nArchitecture overview\n---------------------\n\nWhen you deploy your function's source code to Cloud Run functions,\nthat source code is stored in a Cloud Storage bucket. Cloud Build then\nautomatically builds your code into a container image and pushes that image to\nan Artifact Registry [image registry](/run/docs/deploy-functions#image-repository).\nCloud Run functions accesses this image when it needs to run the\ncontainer to execute your function.\n\nIn the following diagram, the Cloud Run functions box represents\na function that is deployed in Cloud Run, using either the\nCloud Run Admin API or the Cloud Functions API. Typically, newer functions\nare deployed using the Cloud Run Admin API, and older functions are deployed\nusing the Cloud Functions API.\n**Figure 1.** A user prepares functions source code and deploys it to Cloud Run.\n\nDepending on which API is used when deploying a function, the following occurs:\n\n- If you deployed your function using use the *Cloud Run Admin API*, the\n following occurs:\n\n 1. Your source code is uploaded to a Cloud Storage bucket that has no\n retention period.\n\n 1. If you're using default encryption, the name of the bucket is autogenerated and named `run-sources-`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e.\n 2. If you're protecting your data with [Customer-managed encryption keys (CMEK)](/kms/docs/cmek), the bucket name is not autogenerated, and you must provide a bucket name.\n 2. The source code is submitted to Cloud Build, where\n Google Cloud's buildpacks and the Functions Framework create a container\n image. Note that the Cloud Build service account builds the container\n image. Cloud Run defaults to using the\n [`e2-standard-2` machine type](/build/pricing)\n provided by Cloud Build.\n\n 3. Your container image is then uploaded to Artifact Registry through an auto-created\n bucket called \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e`-docker.pkg.dev/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/cloud-run-source-deploy`.\n\n 4. The image is deployed to Cloud Run as a service.\n\n 5. You can trigger or invoke the function with Eventarc,\n Pub/Sub, or other HTTP triggers.\n\n- If you deployed your function using use the *Cloud Functions API (v2)*, the\n following occurs:\n\n 1. Your source code is uploaded to a Cloud Storage bucket that has no\n retention period.\n\n The name of the bucket is autogenerated and follows this format:\n 1. If you're using default encryption, this bucket is named `gcf-v2-sources-`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e.\n 2. If you're protecting your data with CMEK, the bucket is named `gcf-sources-`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e`-`\u003cvar translate=\"no\"\u003eCMEK_KEY_HASH\u003c/var\u003e.\n 2. The source code is submitted to Cloud Build, where\n Google Cloud's buildpacks and the Functions Framework create a container\n image. Note that the Cloud Build service account builds the container\n image. Cloud Run defaults to using the\n [`e2-standard-2` machine type](/build/pricing)\n provided by Cloud Build.\n\n 3. Your container image is then uploaded to Artifact Registry through an auto-created\n bucket called \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e`-docker.pkg.dev/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/gcf-artifacts`.\n\n 4. The image is deployed to Cloud Run as a service.\n\n 5. You can trigger or invoke the function with Eventarc,\n Pub/Sub, or other HTTP triggers.\n\nWhat's next\n-----------\n\n- Learn about the [different types of functions](/run/docs/write-functions) and your options for [triggering functions](/run/docs/function-triggers).\n- If you previously created functions with the Cloud Functions API, see the [Cloud Run functions comparison guide](/run/docs/functions/comparison) to learn about the differences between the two versions of Cloud Run functions."]]