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

Assistance Required for max_instances Configuration Issue during Deployment #2663

Open
SowAbdoul opened this issue Feb 2, 2025 · 11 comments

Comments

@SowAbdoul
Copy link

SowAbdoul commented Feb 2, 2025

Hello,

I hope this message finds you well. I'm currently working on deploying multiple services within my Nomulus project, specifically backend and bsa, but I'm encountering a recurring issue related to the max_instances parameter in the app.yaml configuration files.

Issue Description:
During deployment, I'm receiving the following error message:

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: version.basic_scaling.max_instances (100.0) must be in the range [1.0, 25.0].

Despite updating the max_instances value to 25 in the app.yaml files for backend and bsa, it seems to reset to 100 during the deployment process. I have attempted to set the correct value in various configuration files including nomulus-config-alpha.yaml, but the issue persists.

Steps Taken:

  1. Verified and updated app.yaml files for backend and bsa:

    basic_scaling:
      max_instances: 25
      idle_timeout: 10m
    vim services/backend/build/staged-app/app.yaml
    vim services/backend/build/staged-app/WEB-INF/appengine-generated/app.yaml
    vim services/bsa/build/staged-app/app.yaml
    vim services/bsa/build/staged-app/WEB-INF/appengine-generated/app.yaml

Observations:

  • The max_instances parameter resets to 100 during the deployment, causing the error.
  • Suspected that Gradle scripts or other configuration files may be overriding the app.yaml settings.

Request for Assistance: I would greatly appreciate any guidance on where else this configuration might be set or any steps I might be missing to ensure the correct max_instances value is applied during deployment.

Thank you in advance for your help!

@jianglai
Copy link
Collaborator

jianglai commented Feb 2, 2025

The app.yaml file is temporary and automatically generated during a deployment from appengine-web.xml. Therefore you need to change the XML file for the respective environment-service combo for the change to persist.

@SowAbdoul
Copy link
Author

SowAbdoul commented Feb 3, 2025

Thank you @jianglai, I successfully deployed.

I am having issues using both the UI and CLI.

Steps I followed:

  1. Created the Web Credentials:
    • Google Cloud Console > "APIs & Services" > "Credentials"
    • Clicked "Create Credentials" > "OAuth Client ID"
    • Chose "Desktop"
ls java/google/registry/tools/resources/client_secret.json
  1. Updated the configuration file (config/nomulus-config-alpha.yaml):

    registryTool:
      clientId: DESKTOP_CLIENT_ID
      clientSecret: DESKTOP_CLIENT_SECRET  
    
    oAuth:
      availableOauthScopes:
        - https://www.googleapis.com/auth/userinfo.email
      requiredOauthScopes:
        - https://www.googleapis.com/auth/userinfo.email
      allowedOauthClientIds:
        - DESKTOP_CLIENT_ID
  2. Redeployed the application::

    ./nom_build appengineDeploy --environment=alpha

Issues:

  • UI: I am still being redirected to /console. How can I properly access the UI?
default[]  INFO: URL Stream handler diverting type: native
default[]  "GET /registrar/ HTTP/1.1" 200
default[]  "GET /console HTTP/1.1" 404
  • CLI: I can't find the Nomulus CLI and I'm struggling to install it. Could you help me?

@jianglai
Copy link
Collaborator

jianglai commented Feb 4, 2025

/console is the only web UI that this application has. What UI are you referring to?

The CLI is at core/build/libs/nomulus.jar after you run ./gradlew :core:nomulus.

@SowAbdoul
Copy link
Author

SowAbdoul commented Feb 5, 2025

The CLI works fine, but regarding the UI, the documentation mentions the following URL:

https://[project-id].appspot.com/registrar

However, when I try to access it, I get redirected to:

https://[project-id].appspot.com/console

In the logs, I can see that the request to /registrar/ returns 200, but the request to /console returns 404:

@jianglai
Copy link
Collaborator

jianglai commented Feb 5, 2025

The document is outdated. /console is the correct path for the UI. How are you accessing the UI? It needs to be configured with IAP and you can only access it in a browser due to the need for authentication.

@SowAbdoul
Copy link
Author

SowAbdoul commented Feb 5, 2025

Thanks a lot

1. OAuth Consent Screen Configuration

  • User Type: Internal
  • Application Name: Nomulus Tool
  • Support Email: support@xxxxx
  • Developer Contact Email: support@xxxxx

2. Modified Files

core/src/main/java/google/registry/tools/resources/client_secret.json

core/src/main/java/google/registry/config/files/nomulus-config-alpha.yaml

# Add environment-specific configuration here.
gcpProject:
  projectId: [project-id]
  toolsServiceUrl: https://tools-dot-[project-id].appspot.com # Insert your project ID
  isLocal: false   # Causes saved credentials to be used

gSuite:
  domainName: # Your G Suite domain name
  adminAccountAccountEmailAddress: # An admin login for your G Suite account

# Configuration options relevant to the "nomulus" registry tool
registryTool:
  # OAuth client ID used by the tool
  clientId: 1096782583788-       .apps.googleusercontent.com
  # OAuth client secret used by the tool
  clientSecret: GOCSPX-

auth:
  oauthClientId: 1096782583788-       .apps.googleusercontent.com

cloudSql:
  # JDBC URL for the Cloud SQL database
  jdbcUrl: jdbc:postgresql://localhost
  # This name is used by Cloud SQL when connecting to the database
  instanceConnectionName: [project-id]:asia-south1:nomulus-db

Issues

CLI

When running:

nomulus -e alpha login

I get the following output:

Feb 05, 2025 3:01:19 PM google.registry.util.YamlUtils mergeYaml
WARNING: Ignoring empty environment configuration YAML file.
Please open the following address in your browser:
  https://accounts.google.com/o/oauth2/auth?client_id=YOUR_CLIENT_ID&redirect_uri=http://localhost:39849/Callback&response_type=code&scope=https://www.googleapis.com/auth/cloud-platform%20https://www.googleapis.com/auth/appengine.apis%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/appengine.admin

The login URL displays YOUR_CLIENT_ID instead of my defined clientId in
core/src/main/java/google/registry/config/files/nomulus-config-alpha.yaml.

UI

I have activated and configured IAP, added my user with the IAP-secured Web App User role, and successfully authenticated. However, I am encountering a 404 Not Found error, as if nothing has been deployed.

I navigated to nomulus/console-webapp/ and made the following modification in angular.json:

"serve": {
  "options": {
    "host": "0.0.0.0"
  }
}

After running npm run start, I was able to display the UI successfully.

However, when accessing the application via /console, I can log in, but I remain stuck on /console with a 404 Not Found error.

@jianglai
Copy link
Collaborator

jianglai commented Feb 5, 2025

WARNING: Ignoring empty environment configuration YAML file.: This means that the config file for the environment is not included in the nomulus.jar file for some reason. I'd unjar the file to confirm.

For the UI, it should be deployed when you run ./gradlew deploy.

@SowAbdoul
Copy link
Author

SowAbdoul commented Feb 5, 2025

Please, I used an outdated docuement

# Build the codebase
./nom_build build --environment=alpha --info --stacktrace

./nom_build :db:flywayMigrate

# Deploy App
./nom_build appengineDeploy --environment=alpha --info --stacktrace

May I replace ./nom_build to ./gradlew ?

@jianglai
Copy link
Collaborator

jianglai commented Feb 5, 2025

I personally use ./gradlew -Penvironment=alpha deploy.

@SowAbdoul
Copy link
Author

Thank you so much @jianglai
I now use ./gradlew -Penvironment=alpha deploy, and then I run ./gradlew :core:nomulus.

@SowAbdoul
Copy link
Author

SowAbdoul commented Feb 13, 2025

Hi @jianglai,
Sorry to bother you, I would like to deploy Nomulus in a production environment, can you help me?

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

No branches or pull requests

2 participants