Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions UD_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Deployment notes - nomulus-pre-alpha2 environment
Note: these steps are confirmed to work with the existing nomulus-pre-alpha2 environment. The initial DB create/migrations/run of flyway migrations, any oauth config, or other steps not documented here (or in this PR) are hopefully captured somewhere else (or ask me)

You can pass `--info` to a nom_build command to get more info. You will get pretty verbose output.

From the repository root directory:

1. update nomulus-config-alpha.yaml with teh oauth client id and secret. you'll have to ask for this.
1. `./nom_build build`
```
For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 4m 2s
133 actionable tasks: 133 executed
```

1. `./nom_build :console-webapp:build --environment alpha`
```
TOTAL: 20 SUCCESS
ERROR: 'Backend returned code 404, body was: NOT FOUND'
Chrome Headless 136.0.0.0 (Mac OS 10.15.7): Executed 20 of 20 SUCCESS (0.524 secs / 0.38 secs)
ERROR: 'Backend returned code 404, body was: NOT FOUND'
Chrome Headless 136.0.0.0 (Mac OS 10.15.7) ERROR
Disconnected , because no message in 30000 ms.
Chrome Headless 136.0.0.0 (Mac OS 10.15.7): Executed 20 of 20 DISCONNECTED (30.53 secs / 0.38 secs)
✔ Browser application bundle generation complete.
Chrome Headless 136.0.0.0 (Mac OS 10.15.7) ERROR
Chrome Headless 136.0.0.0 (Mac OS 10.15.7): Executed 20 of 20 DISCONNECTED (30.53 secs / 0.38 secs)

[Incubating] Problems report is available at: file:///Users/tjones/UDtorrey/nomulus/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 49s
5 actionable tasks: 4 executed, 1 up-to-date
```
note: idk why some say `ERROR` but still succeed.

1. `./nom_build appengineDeploy --environment=alpha`
```
((HEAVILY TRUNCATED))
> Task :services:bsa:appengineDeploy
> Task :services:backend:appengineDeploy
> Task :services:pubapi:appengineDeploy
> Task :services:default:appengineDeploy
> Task :services:backend:appengineDeploy
> Task :services:pubapi:appengineDeploy
> Task :services:tools:appengineDeploy
> Task :services:default:appengineDeploy
> Task :services:tools:appengineDeploy

BUILD SUCCESSFUL in 1m 48s
42 actionable tasks: 22 executed, 20 up-to-date
```

1. `nvm use 20.5.1` then `./nom_build :console-webapp:buildConsoleForAlpha`
```
> ng build --base-href=/console/ --configuration=$npm_config_configuration

❯ Building...
✔ Building...
Initial chunk files | Names | Raw size
chunk-OVCP647X.js | - | 4.01 MB |
chunk-RDS7UYFR.js | - | 427.20 kB |
polyfills.js | polyfills | 90.58 kB |
styles.css | styles | 61.80 kB |
main.js | main | 346 bytes |

| Initial total | 4.59 MB

Lazy chunk files | Names | Raw size
users.component-SXQHP6OS.js | users-component | 40.95 kB |
oteStatus.component-DJHE4TJU.js | oteStatus-component | 8.12 kB |
newOte.component-HRH7KR5Q.js | newOte-component | 6.64 kB |

Application bundle generation complete. [6.575 seconds]

Output location: /Users/tjones/UDtorrey/nomulus/console-webapp/staged/dist


[Incubating] Problems report is available at: file:///Users/tjones/UDtorrey/nomulus/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 9s
2 actionable tasks: 2 executed
<-------------> 0% WAITING
> IDLE
```
1. `nom_build :console-webapp::appengineDeploy --environment=alpha`
I HAVE PROBLEMS WITH THIS
```
output here
```

1. if needed edit `core/src/main/java/google/registry/env/alpha/bsa/WEB-INF/appengine-web.xml` for the vpc-access-connector setting, then `./nom_build :services:bsa:build --environment=alpha` and `./nom_build :services:bsa:appengineDeploy --environment=alpha`

# How to run nomulus CLI tool locally
From the repository root directory:
1. ask to get your user added to the oauth client test user credential list
1. `nom_build buildToolImage`

note: your nomulus-config-*.yaml gets baked into the jar that is produced! so any changes to your config needs to have a rebuild

1. `alias nomulus='java -jar /Users/tjones/UDtorrey/nomulus/core/build/libs/nomulus.jar'`
1. `nomulus -e alpha login`
1. `nomulus -e alpha --canary --gae list_tlds`

note: depending on the GAE service it communicates with, sometimes you have to use `--canary --use_gae`




## Quick demo/howto

# Create premium list
`nomulus -e alpha create_premium_list -n demo2 -i core/src/main/java/google/registry/config/files/premium/demo2.txt -c USD -o`


`nomulus -e alpha --canary --gae list_premium_lists # list premium lists`
```
nomulus -e alpha --canary --gae list_premium_lists
demo1
demo2
torrey
```

# Create/Configure TLD
`nomulus -e alpha configure_tld -i core/src/test/resources/google/registry/tools/demo2.yaml `

`nomulus -e alpha --canary --gae list_tlds``

# Create Registrar
`nomulus -e alpha create_registrar demo2 --name 'demo2 Registrar' --registrar_type TEST --password ud_pre_alpha --icann_referral_email torrey+demo2+registrar@unstoppabledomains --street '123 fake St' --city 'Las Veges' --state NV --zip 1234 --cc US
nomulus -e alpha --canary --gae list_registrars # list registrars`
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ cloudSql:
# Using the default 'postgres' is bad practice. See bug for more information.
# If jdbcUrl in this file is moved elsewhere, be sure to move this notice
# with it until the change is applied.
jdbcUrl: jdbc:postgresql://localhost
jdbcUrl: jdbc:postgresql://localhost:15432/
# This name is used by Cloud SQL when connecting to the database.
instanceConnectionName: project-id:region:instance-id
# If non-null, we will use this instance for certain read-only actions or
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# Add environment-specific configuration here.
gcpProject:
# projectId: nomulus-pre-alpha
# projectIdNumber: 241446389074
projectId: nomulus-pre-alpha2
projectIdNumber: 264643765037
locationId: us-central1
isLocal: false
defaultServiceUrl: https://default-dot-nomulus-pre-alpha2.appspot.com
backendServiceUrl: https://backend-dot-nomulus-pre-alpha2.appspot.com
bsaServiceUrl: https://bsa-dot-nomulus-pre-alpha2.appspot.com
toolsServiceUrl: https://tools-dot-nomulus-pre-alpha2.appspot.com
pubapiServiceUrl: https://pubapi-dot-nomulus-pre-alpha2.appspot.com
baseDomain: nomulus-pre-alpha2.appspot.com

registryTool:
# OAuth client ID used by the tool.
# OAuth client secret used by the tool.

clientId: PLACEHOLDER
clientSecret: PLACEHOLDER

oAuth:
availableOauthScopes:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/appengine.apis
- https://www.googleapis.com/auth/userinfo.email
- https://www.googleapis.com/auth/appengine.admin
requiredOauthScopes:
- https://www.googleapis.com/auth/userinfo.email

cloudSql:
jdbcUrl: jdbc:postgresql://localhost:15432/
instanceConnectionName: nomulus-pre-alpha2:us-central1:nomulus-pre-alpha

auth:
# OAuth 2.0 client ID that will be used as the audience in OIDC ID tokens sent
# from clients (e.g., proxy, nomulus tool, cloud tasks) for authentication. The
# same ID is the only one accepted by the regular OIDC or IAP authentication
# mechanisms. In most cases, we should use the client ID created for IAP here,
# as it allows requests bearing a token with this audience to be accepted by
# both IAP or regular OIDC. The clientId value in proxy config file should be
# the same as this one.
oauthClientId: PLACEHOLDER
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example of a premium list file. This is simply a CSV file with two
# columns: sub-domain name, and price (specified as currency type and value).
#
# These are manipulated using the "nomulus" tool
# {create,update,delete,list}_premium_list commands.
torrey,USD 100 # comment after the item
somespecialsubdomain, USD 127 # $127 USD sub doamin
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Example of a premium list file. This is simply a CSV file with two
# columns: sub-domain name, and price (specified as currency type and value).
#
# These are manipulated using the "nomulus" tool
# {create,update,delete,list}_premium_list commands.
demo2,USD 100000000 # demo2.demo2 should be REALLY expensive
somespecialsubdomain, USD 127 # $127 USD sub doamin
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<sessions-enabled>true</sessions-enabled>
<instance-class>B4</instance-class>
<basic-scaling>
<max-instances>100</max-instances>
<max-instances>2</max-instances>
<idle-timeout>10m</idle-timeout>
</basic-scaling>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<sessions-enabled>true</sessions-enabled>
<instance-class>B4</instance-class>
<basic-scaling>
<max-instances>100</max-instances>
<max-instances>2</max-instances>
<idle-timeout>10m</idle-timeout>
</basic-scaling>

Expand All @@ -23,10 +23,12 @@
</env-variables>

<!-- Enable external traffic to go through VPC, required for static ip -->
<vpc-access-connector>
<name>projects/domain-registry-alpha/locations/us-central1/connectors/appengine-connector</name>
<egress-setting>all-traffic</egress-setting>
</vpc-access-connector>
<!-- <vpc-access-connector> -->
<!-- <name>projects/domain-registry-alpha/locations/us-central1/connectors/appengine-connector</name> -->
<!-- <name>projects/nomulus-pre-alpha2/locations/us-central1/connectors/vpc-connector-test</name> -->
<!-- <egress-setting>all-traffic</egress-setting> -->
<!-- </vpc-access-connector> -->


<static-files>
<include path="/*.html" expiration="1m"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<sessions-enabled>true</sessions-enabled>
<instance-class>B4</instance-class>
<basic-scaling>
<max-instances>8</max-instances>
<max-instances>1</max-instances>
<idle-timeout>30m</idle-timeout>
</basic-scaling>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<sessions-enabled>true</sessions-enabled>
<instance-class>B4</instance-class>
<basic-scaling>
<max-instances>8</max-instances>
<max-instances>1</max-instances>
<idle-timeout>10m</idle-timeout>
</basic-scaling>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<sessions-enabled>true</sessions-enabled>
<instance-class>B4</instance-class>
<basic-scaling>
<max-instances>5</max-instances>
<max-instances>1</max-instances>
<idle-timeout>5m</idle-timeout>
</basic-scaling>

Expand Down
56 changes: 56 additions & 0 deletions core/src/test/resources/google/registry/tools/demo1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
addGracePeriodLength: "PT2592000S"
allowedFullyQualifiedHostNames: []
allowedRegistrantContactIds: []
anchorTenantAddGracePeriodLength: "PT2592000S"
autoRenewGracePeriodLength: "PT2592000S"
automaticTransferLength: "PT2592000S"
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
creationTime: "2022-09-01T00:00:00.000Z"
createBillingCostTransitions:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 13.00
currency: "USD"
defaultPromoTokens: []
dnsAPlusAaaaTtl: "PT900S"
dnsDsTtl: null
dnsNsTtl: null
dnsPaused: false
dnsWriters:
- "VoidDnsWriter"
driveFolderId: "driveFolder"
eapFeeSchedule:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 0.00
escrowEnabled: false
idnTables: []
invoicingEnabled: false
lordnUsername: null
numDnsPublishLocks: 1
pendingDeleteLength: "PT2592000S"
premiumListName: "demo1"
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
redemptionGracePeriodLength: "PT2592000S"
registryLockOrUnlockBillingCost:
currency: "USD"
amount: 0.00
renewBillingCostTransitions:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 11.00
renewGracePeriodLength: "PT2592000S"
reservedListNames: []
restoreBillingCost:
currency: "USD"
amount: 17.00
roidSuffix: "DEMO1"
serverStatusChangeBillingCost:
currency: "USD"
amount: 19.00
tldStateTransitions:
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
tldStr: "demo1"
tldType: "REAL"
tldUnicode: "demo1"
transferGracePeriodLength: "PT2592000S"
56 changes: 56 additions & 0 deletions core/src/test/resources/google/registry/tools/demo2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
addGracePeriodLength: "PT2592000S"
allowedFullyQualifiedHostNames: []
allowedRegistrantContactIds: []
anchorTenantAddGracePeriodLength: "PT2592000S"
autoRenewGracePeriodLength: "PT2592000S"
automaticTransferLength: "PT2592000S"
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
creationTime: "2022-09-01T00:00:00.000Z"
createBillingCostTransitions:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 13.00
currency: "USD"
defaultPromoTokens: []
dnsAPlusAaaaTtl: "PT900S"
dnsDsTtl: null
dnsNsTtl: null
dnsPaused: false
dnsWriters:
- "VoidDnsWriter"
driveFolderId: "driveFolder"
eapFeeSchedule:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 0.00
escrowEnabled: false
idnTables: []
invoicingEnabled: false
lordnUsername: null
numDnsPublishLocks: 1
pendingDeleteLength: "PT2592000S"
premiumListName: "demo2"
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
redemptionGracePeriodLength: "PT2592000S"
registryLockOrUnlockBillingCost:
currency: "USD"
amount: 0.00
renewBillingCostTransitions:
"1970-01-01T00:00:00.000Z":
currency: "USD"
amount: 11.00
renewGracePeriodLength: "PT2592000S"
reservedListNames: []
restoreBillingCost:
currency: "USD"
amount: 17.00
roidSuffix: "DEMO2"
serverStatusChangeBillingCost:
currency: "USD"
amount: 19.00
tldStateTransitions:
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
tldStr: "demo2"
tldType: "REAL"
tldUnicode: "demo2"
transferGracePeriodLength: "PT2592000S"
Loading