Skip to content

Commit 7149fd3

Browse files
authored
Remove more references to GAE (#2894)
These are old/pointless now that we've migrated to GKE. Note that this doesn't update anything in the docs/ folder, as that's a much larger project that should be done on its own.
1 parent 0dc7ab9 commit 7149fd3

File tree

72 files changed

+125
-2537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+125
-2537
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ tasks.build.dependsOn(tasks.checkLicense)
8484
// Paths to main and test sources.
8585
ext.projectRootDir = "${rootDir}"
8686

87-
// Tasks to deploy/stage all App Engine services
87+
// Tasks to deploy/stage all services
8888
task deploy {
8989
group = 'deployment'
90-
description = 'Deploys all services to App Engine.'
90+
description = 'Deploys all services.'
9191
}
9292

9393
task stage {

common/src/main/java/google/registry/util/DateTimeUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public abstract class DateTimeUtils {
3333
/**
3434
* A date in the far future that we can treat as infinity.
3535
*
36-
* <p>This value is (2^63-1)/1000 rounded down. AppEngine stores dates as 64 bit microseconds, but
37-
* Java uses milliseconds, so this is the largest representable date that will survive a
36+
* <p>This value is (2^63-1)/1000 rounded down. Postgres can store dates as 64 bit microseconds,
37+
* but Java uses milliseconds, so this is the largest representable date that will survive a
3838
* round-trip through the database.
3939
*/
4040
public static final DateTime END_OF_TIME = new DateTime(Long.MAX_VALUE / 1000, DateTimeZone.UTC);

config/nom_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class GradleFlag:
104104
Property('testFilter',
105105
'Comma separated list of test patterns, if specified run only '
106106
'these.'),
107-
Property('environment', 'GAE Environment for deployment and staging.'),
107+
Property('environment', 'Environment for deployment and staging.'),
108108

109109
# Cloud SQL properties
110110
Property('dbServer',

console-webapp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ expected to change.
99

1010
## Deployment
1111

12-
Webapp is deployed with the nomulus default service war to Google App Engine.
12+
The webapp is deployed with the nomulus default service war to GKE.
1313
During nomulus default service war build task, gradle script triggers the
1414
following:
1515

core/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ configurations {
110110
// for details.
111111
nomulus_test
112112

113-
// Exclude non-canonical servlet-api jars. Our AppEngine deployment uses
113+
// Exclude non-canonical servlet-api jars. Our deployment uses
114114
// javax.servlet:servlet-api:2.5
115115
// For reasons we do not understand, marking the following dependencies as
116116
// compileOnly instead of compile does not exclude them from runtimeClasspath.

core/src/main/java/google/registry/batch/CloudTasksUtils.java

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@
5555
import java.util.Arrays;
5656
import java.util.Optional;
5757
import java.util.Random;
58-
import java.util.function.BiConsumer;
59-
import java.util.function.Consumer;
6058
import java.util.function.Supplier;
6159
import org.joda.time.Duration;
6260

@@ -118,19 +116,13 @@ public ImmutableList<Task> enqueue(String queue, Task... tasks) {
118116
* <p>For GET requests we add them on to the URL, and for POST requests we add them in the body of
119117
* the request.
120118
*
121-
* <p>The parameters {@code putHeadersFunction} and {@code setBodyFunction} are used so that this
122-
* method can be called with either an AppEngine HTTP request or a standard non-AppEngine HTTP
123-
* request. The two objects do not have the same methods, but both have ways of setting headers /
124-
* body.
125-
*
126119
* @return the resulting path (unchanged for POST requests, with params added for GET requests)
127120
*/
128121
private static String processRequestParameters(
129122
String path,
130123
Method method,
131124
Multimap<String, String> params,
132-
BiConsumer<String, String> putHeadersFunction,
133-
Consumer<ByteString> setBodyFunction) {
125+
HttpRequest.Builder requestBuilder) {
134126
if (CollectionUtils.isNullOrEmpty(params)) {
135127
return path;
136128
}
@@ -148,8 +140,8 @@ private static String processRequestParameters(
148140
if (method.equals(Method.GET)) {
149141
return String.format("%s?%s", path, encodedParams);
150142
}
151-
putHeadersFunction.accept(HttpHeaders.CONTENT_TYPE, MediaType.FORM_DATA.toString());
152-
setBodyFunction.accept(ByteString.copyFrom(encodedParams, StandardCharsets.UTF_8));
143+
requestBuilder.putHeaders(HttpHeaders.CONTENT_TYPE, MediaType.FORM_DATA.toString());
144+
requestBuilder.setBody(ByteString.copyFrom(encodedParams, StandardCharsets.UTF_8));
153145
return path;
154146
}
155147

@@ -160,18 +152,17 @@ private static String processRequestParameters(
160152
* default service account as the principal. That account must have permission to submit tasks to
161153
* Cloud Tasks.
162154
*
163-
* <p>The caller of this method is responsible for passing in the appropriate service based on the
164-
* runtime (GAE/GKE). Use the overload that takes an action class if possible.
155+
* <p>The caller of this method is responsible for passing in the appropriate service. Use the
156+
* overload that takes an action class if possible.
165157
*
166158
* @param path the relative URI (staring with a slash and ending without one).
167159
* @param method the HTTP method to be used for the request.
168-
* @param service the GAE/GKE service to route the request to.
160+
* @param service the service to route the request to.
169161
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
170162
* to the server to process the duplicate keys.
171163
* @return the enqueued task.
172-
* @see <a
173-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
174-
* the worker service</a>
164+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
165+
* HTTP target tasks</a>
175166
*/
176167
protected Task createTask(
177168
String path, Method method, Action.Service service, Multimap<String, String> params) {
@@ -180,9 +171,7 @@ protected Task createTask(
180171
"The path must start with a '/'.");
181172
HttpRequest.Builder requestBuilder =
182173
HttpRequest.newBuilder().setHttpMethod(HttpMethod.valueOf(method.name()));
183-
path =
184-
processRequestParameters(
185-
path, method, params, requestBuilder::putHeaders, requestBuilder::setBody);
174+
path = processRequestParameters(path, method, params, requestBuilder);
186175
OidcToken.Builder oidcTokenBuilder =
187176
OidcToken.newBuilder()
188177
.setServiceAccountEmail(credential.serviceAccount())
@@ -204,16 +193,15 @@ protected Task createTask(
204193
* Cloud Tasks.
205194
*
206195
* <p>Prefer this overload over the one where the path and service are explicitly defined, as this
207-
* class will automatically determine the service to use based on the action and the runtime.
196+
* class will automatically determine the service to use based on the action.
208197
*
209198
* @param actionClazz the action class to run, must be annotated with {@link Action}.
210199
* @param method the HTTP method to be used for the request.
211200
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
212201
* to the server to process the duplicate keys.
213202
* @return the enqueued task.
214-
* @see <a
215-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
216-
* the worker service</a>
203+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
204+
* HTTP target tasks</a>
217205
*/
218206
public Task createTask(
219207
Class<? extends Runnable> actionClazz, Method method, Multimap<String, String> params) {
@@ -236,19 +224,18 @@ public Task createTask(
236224
/**
237225
* Create a {@link Task} to be enqueued with a random delay up to {@code jitterSeconds}.
238226
*
239-
* <p>The caller of this method is responsible for passing in the appropriate service based on the
240-
* runtime (GAE/GKE). Use the overload that takes an action class if possible.
227+
* <p>The caller of this method is responsible for passing in the appropriate service. Use the
228+
* overload that takes an action class if possible.
241229
*
242230
* @param path the relative URI (staring with a slash and ending without one).
243231
* @param method the HTTP method to be used for the request.
244-
* @param service the GAE/GKE service to route the request to.
232+
* @param service the service to route the request to.
245233
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
246234
* to the server to process the duplicate keys.
247235
* @param jitterSeconds the number of seconds that a task is randomly delayed up to.
248236
* @return the enqueued task.
249-
* @see <a
250-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
251-
* the worker service</a>
237+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
238+
* HTTP target tasks</a>
252239
*/
253240
public Task createTaskWithJitter(
254241
String path,
@@ -271,17 +258,16 @@ public Task createTaskWithJitter(
271258
* Create a {@link Task} to be enqueued with a random delay up to {@code jitterSeconds}.
272259
*
273260
* <p>Prefer this overload over the one where the path and service are explicitly defined, as this
274-
* class will automatically determine the service to use based on the action and the runtime.
261+
* class will automatically determine the service to use based on the action.
275262
*
276263
* @param actionClazz the action class to run, must be annotated with {@link Action}.
277264
* @param method the HTTP method to be used for the request.
278265
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
279266
* to the server to process the duplicate keys.
280267
* @param jitterSeconds the number of seconds that a task is randomly delayed up to.
281268
* @return the enqueued task.
282-
* @see <a
283-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
284-
* the worker service</a>
269+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
270+
* HTTP target tasks</a>
285271
*/
286272
public Task createTaskWithJitter(
287273
Class<? extends Runnable> actionClazz,
@@ -302,14 +288,13 @@ public Task createTaskWithJitter(
302288
*
303289
* @param path the relative URI (staring with a slash and ending without one).
304290
* @param method the HTTP method to be used for the request.
305-
* @param service the GAE/GKE service to route the request to.
291+
* @param service the service to route the request to.
306292
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
307293
* to the server to process the duplicate keys.
308294
* @param delay the amount of time that a task needs to be delayed for.
309295
* @return the enqueued task.
310-
* @see <a
311-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
312-
* the worker service</a>
296+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
297+
* HTTP target tasks</a>
313298
*/
314299
private Task createTaskWithDelay(
315300
String path,
@@ -330,17 +315,16 @@ private Task createTaskWithDelay(
330315
* Create a {@link Task} to be enqueued with delay of {@code duration}.
331316
*
332317
* <p>Prefer this overload over the one where the path and service are explicitly defined, as this
333-
* class will automatically determine the service to use based on the action and the runtime.
318+
* class will automatically determine the service to use based on the action.
334319
*
335320
* @param actionClazz the action class to run, must be annotated with {@link Action}.
336321
* @param method the HTTP method to be used for the request.
337322
* @param params a multimap of URL query parameters. Duplicate keys are saved as is, and it is up
338323
* to the server to process the duplicate keys.
339324
* @param delay the amount of time that a task needs to be delayed for.
340325
* @return the enqueued task.
341-
* @see <a
342-
* href=ttps://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-tasks#target>Specifyinig
343-
* the worker service</a>
326+
* @see <a href=https://docs.cloud.google.com/tasks/docs/creating-http-target-tasks#java>Creating
327+
* HTTP target tasks</a>
344328
*/
345329
public Task createTaskWithDelay(
346330
Class<? extends Runnable> actionClazz,

core/src/main/java/google/registry/batch/RelockDomainAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ public RelockDomainAction(
112112
public void run() {
113113
/* We wish to manually control our retry behavior, in order to limit the number of retries
114114
* and/or notify registrars / support only after a certain number of retries, or only
115-
* with a certain type of failure. AppEngine will automatically retry on any non-2xx status
115+
* with a certain type of failure. Cloud Tasks will automatically retry on any non-2xx status
116116
* code, so return SC_NO_CONTENT (204) by default to avoid this auto-retry.
117117
*
118-
* See https://cloud.google.com/appengine/docs/standard/java/taskqueue/push/retrying-tasks
119-
* for more details on retry behavior. */
118+
* See https://docs.cloud.google.com/tasks/docs/configuring-queues#retry for more details on
119+
* retry behavior. */
120120
response.setStatus(SC_NO_CONTENT);
121121
response.setContentType(MediaType.PLAIN_TEXT_UTF_8);
122122
tm().transact(this::relockDomain);

core/src/main/java/google/registry/beam/common/RegistryPipelineWorkerInitializer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public class RegistryPipelineWorkerInitializer implements JvmInitializer {
4040

4141
@Override
4242
public void beforeProcessing(PipelineOptions options) {
43-
// TODO(b/416299900): remove next line after GAE is removed.
44-
System.setProperty("google.registry.jetty", "true");
4543
RegistryPipelineOptions registryOptions = options.as(RegistryPipelineOptions.class);
4644
RegistryEnvironment environment = registryOptions.getRegistryEnvironment();
4745
if (environment == null || environment.equals(RegistryEnvironment.UNITTEST)) {

core/src/main/java/google/registry/bigquery/BigqueryConnection.java

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,6 @@ private WriteDisposition getWriteDisposition() {
279279
private TableReference getTableReference() {
280280
return table.getTableReference().clone();
281281
}
282-
283-
/** Returns a string representation of the TableReference for the wrapped table. */
284-
public String getStringReference() {
285-
return tableReferenceToString(table.getTableReference());
286-
}
287-
288-
/** Returns a string representation of the given TableReference. */
289-
private static String tableReferenceToString(TableReference tableRef) {
290-
return String.format(
291-
"%s:%s.%s",
292-
tableRef.getProjectId(),
293-
tableRef.getDatasetId(),
294-
tableRef.getTableId());
295-
}
296282
}
297283

298284
/**
@@ -398,29 +384,12 @@ public ListenableFuture<DestinationTable> startQuery(String querySql, Destinatio
398384
}
399385

400386
/**
401-
* Starts an asynchronous query job to dump the results of the specified query into a local
402-
* ImmutableTable object, row-keyed by the row number (indexed from 1), column-keyed by the
403-
* TableFieldSchema for that column, and with the value object as the cell value. Note that null
404-
* values will not actually be null, but they can be checked for using Data.isNull().
387+
* Dumps the results of the specified query into a local ImmutableTable object, row-keyed by the
388+
* row number (indexed from 1), column-keyed by the TableFieldSchema for that column, and with the
389+
* value object as the cell value.
405390
*
406-
* <p>Returns a ListenableFuture that holds the ImmutableTable on success.
407-
*/
408-
public ListenableFuture<ImmutableTable<Integer, TableFieldSchema, Object>>
409-
queryToLocalTable(String querySql) {
410-
Job job = new Job()
411-
.setConfiguration(new JobConfiguration()
412-
.setQuery(new JobConfigurationQuery()
413-
.setQuery(querySql)
414-
.setDefaultDataset(getDataset())));
415-
return transform(runJobToCompletion(job), this::getQueryResults, directExecutor());
416-
}
417-
418-
/**
419-
* Returns the result of calling queryToLocalTable, but synchronously to avoid spawning new
420-
* background threads, which App Engine doesn't support.
421-
*
422-
* @see <a href="https://cloud.google.com/appengine/docs/standard/java/runtime#Threads">App Engine
423-
* Runtime</a>
391+
* <p>Note that null values will not actually be null, but they can be checked for using
392+
* Data.isNull()
424393
*/
425394
public ImmutableTable<Integer, TableFieldSchema, Object> queryToLocalTableSync(String querySql) {
426395
Job job = new Job()
@@ -634,10 +603,6 @@ private <T> ListenableFuture<T> runJobToCompletion(
634603
});
635604
}
636605

637-
private ListenableFuture<Job> runJobToCompletion(final Job job) {
638-
return service.submit(() -> runJob(job, null));
639-
}
640-
641606
/** Helper that returns true if a dataset with this name exists. */
642607
public boolean checkDatasetExists(String datasetName) throws IOException {
643608
try {
@@ -676,14 +641,6 @@ public DatasetReference getDataset() {
676641
.setDatasetId(getDatasetId());
677642
}
678643

679-
/** Returns table reference with the projectId and datasetId filled out for you. */
680-
public TableReference getTable(String tableName) {
681-
return new TableReference()
682-
.setProjectId(getProjectId())
683-
.setDatasetId(getDatasetId())
684-
.setTableId(tableName);
685-
}
686-
687644
/**
688645
* Helper that creates a dataset with this name if it doesn't already exist, and returns true if
689646
* creation took place.

core/src/main/java/google/registry/bsa/BsaDiffCreator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ BsaDiff createDiff(DownloadSchedule schedule, IdnChecker idnChecker) {
7171
Optional<String> previousJobName = schedule.latestCompleted().map(CompletedJob::jobName);
7272
/*
7373
* Memory usage is a concern when creating a diff, when the newest download needs to be held in
74-
* memory in its entirety. The top-grade AppEngine VM has 3GB of memory, leaving less than 1.5GB
75-
* to application memory footprint after subtracting overheads due to copying garbage collection
76-
* and non-heap data etc. Assuming 400K labels, each of which on average included in 5 orders,
74+
* memory in its entirety. Assuming 400K labels, each of which on average included in 5 orders,
7775
* the memory footprint is at least 300MB when loaded into a Hashset-backed Multimap (64-bit
7876
* JVM, with 12-byte object header, 16-byte array header, and 16-byte alignment).
7977
*

0 commit comments

Comments
 (0)