google-app-enginegoogle-cloud-storagegoogle-container-registrygoogle-artifact-registry

Is Google Artifact Registry required for an NodeJS AppEngine Standard Deployment?


I have a Google App Engine app. It is a "Standard" (vs "Flexible"), it is NodeJS, the first few lines of the config are:

runtime: nodejs20
env: standard
instance_class: F2
...

Does this require the use of Artifact Registry? (formerly the Container Registry?)

I think the answer is "Yes, Standard environment requires Artifact Registry" based on this sentence:

App Engine standard environment:

App Engine standard environment uses the Cloud Build service account to build and deploy your applications, including integration of dependencies stored in Artifact Registry.

Can someone confirm the answer is "Yes"? And consider my followup questions below...

I thought the answer might be "No" based on a different link which emphasizes that Docker containers associated with the "Flexible" environment. See this link, which says:

In contrast, the flexible environment runs your application in Docker containers on Google Compute Engine virtual machines (VMs), which have fewer restrictions.

... whereas ...

In the standard environment, your application runs on a lightweight instance inside of a sandbox...

I thought the above meant that a "Standard" environment app doesn't use containers, therefore doesn't need Artifact/Container Registry. But maybe the Registry is needed for dependencies (i.e. my app depends on many libraries via package.json and npm install, so is this what Artifact Registry is doing? The Artifact Registry is a "universal package manager"?)

Since it seems like my Standard-environment App Engine App does depend on Artifact Registry, I have followup questions:

I never set up Container/Artifact Registry, how is it "connected" to my app? How does Artifact Registry know my dependencies

Specifically, I just deploy using gcloud app deploy app.yaml. How does that connect to Artifact Registry?

This link says "App Engine and Cloud Build create Pub/Sub topics and subscriptions in your project for use in Google's internal analysis and maintenance of your container images."... is that how?

Do I pay for Artifact Registry? How?

I think I pay through the cost of Google Storage of the artifacts, is that right? This link says:

Storage costs apply to the at-rest storage of your artifacts in Artifact Registry repositories.

The above Artifact Registry pricing link also explains how they charge for Data Transfer (vs "at-rest storage")

How can I learn more about folder structure?

For example, check the screenshot below.

Screenshot of my Artifact Registry "us.gcr.io"  repository. What are all these files/folders?

For extra context I have all these questions because Container Registry is being deprecated, so I'm following this process to transition to Artifact Registry using automatic migration tools. I thought, "Do I even need this registry stuff"?

I did run the script to check for Container Registry usage. gcloud container images list-gcr-usage --project={project} I got ACTIVE. That's another reason I figure my Standard App Engine environment uses Container Registry.

And I ran this script as part of migration process: gcloud artifacts docker upgrade migrate.

Similar questions include:


Solution

    1. Yes, App Engine standard uses Artifact Registry. Your cited link is the source of truth

    2. If your Node.js app includes a private/custom package, you can host it (upload it to) on Artifact Registry (see documentation) and then list it as a dependency for your App (see documentation). After doing this, Google takes care of the rest when you run gcloud app deploy. Even if you don't use private/custom package, App Engine are essentially preconfigured containers (see first paragraph here)

    3. I've deleted old images for our website a few times before and I haven't seen any issues; just checked and the earliest I see is from 2024 but our website has been in existence for far longer). If you navigate to App Engine > Versions and look at the date of your last deployment and then you check Artifact Registry, you'll see one with a corresponding date (if there are multiple deploys on the same date, you should see one with a tag of latest). One very cautious way to go would be to start by deleting a few of the oldest (a few of the 2021 images) and see if there are any issues. But please research this before you decide to go ahead.

    4. I don't believe you can roll back your code to very old ones. Rollback involves re-deploying your old source files. If you didn't keep copies, then you have to re-download your source files. By default, your source files (from running gcloud app deploy) are only stored for 15 days. You can change the lifecycle (see this blog article from us for an understanding of this and how you can do it).

    5. Also, if you check Artifact Registry, there should be an entry for each service of your App. So, you should see something like app-engine-tmp/app/<service_name>/...