Skip to content

Commit

Permalink
Upgrade dependencies, including googleapis and gcloud + code cleanup. (
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Sep 5, 2024
1 parent 6f23465 commit a1ed6eb
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 194 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Important changes to data models, configuration, and migrations between each
AppEngine version, listed here to ease deployment and troubleshooting.

## Next Release (replace with git tag when deployed)
* Upgraded dependencies including `googleapis`.

## `20240905t122100-all`
* Bumped runtimeVersion to `2024.09.04`.
Expand Down
53 changes: 5 additions & 48 deletions app/lib/task/cloudcompute/googlecloudcompute.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'dart:io';
import 'package:clock/clock.dart';
import 'package:gcloud/service_scope.dart' as ss;
import 'package:googleapis/compute/v1.dart' hide Duration;
import 'package:googleapis/compute/v1.dart' as compute_v1 show Duration;
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart' show Logger;
import 'package:meta/meta.dart';
Expand Down Expand Up @@ -456,13 +457,15 @@ runcmd:
name: instanceName,
description: description,
machineType: 'zones/$zone/machineTypes/$_machineType',
scheduling: _Scheduling(
scheduling: Scheduling(
preemptible: true,
automaticRestart: false,
onHostMaintenance: 'TERMINATE',
instanceTerminationAction: 'DELETE',
provisioningModel: 'SPOT',
maxRunDuration: _maxRunDuration,
maxRunDuration: compute_v1.Duration(
seconds: _maxRunDuration.inSeconds.toString(),
),
),
labels: {
// Labels that allows us to filter instances when listing instances.
Expand Down Expand Up @@ -774,49 +777,3 @@ DateTime _parseInstanceCreationTimestamp(String? timestamp) {
return DateTime(0);
}
}

/// Extend [Scheduling] with support for [maxRunDuration].
///
/// This is only available in the Compute Beta API, but extremely useful for
/// our use case, because GCE will then automatically delete instances.
///
/// The [maxRunDuration] property is encoded as:
/// ```
/// "maxRunDuration": {
/// "seconds": string,
/// "nanos": integer
/// },
/// ```
/// For details, see reference documentation:
/// https://cloud.google.com/compute/docs/reference/rest/beta/instances/insert
class _Scheduling extends Scheduling {
/// Specifies the max run duration for the given instance.
///
/// If specified, the instance termination action will be performed at the
/// end of the run duration.
Duration? maxRunDuration;

_Scheduling({
super.automaticRestart,
super.instanceTerminationAction,
super.locationHint, // ignore: unused_element
super.minNodeCpus, // ignore: unused_element
super.nodeAffinities, // ignore: unused_element
super.onHostMaintenance,
super.preemptible,
super.provisioningModel,
this.maxRunDuration,
});

@override
Map<String, dynamic> toJson() {
final maxRunDuration_ = maxRunDuration;
return <String, dynamic>{
...super.toJson(),
if (maxRunDuration_ != null)
'maxRunDuration': <String, dynamic>{
'seconds': '${maxRunDuration_.inSeconds}',
},
};
}
}
32 changes: 16 additions & 16 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ packages:
dependency: "direct dev"
description:
name: coverage
sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db"
sha256: c1fb2dce3c0085f39dc72668e85f8e0210ec7de05345821ff58530567df345a5
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.2"
crypto:
dependency: "direct main"
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
csslib:
dependency: transitive
description:
Expand Down Expand Up @@ -310,10 +310,10 @@ packages:
dependency: "direct main"
description:
name: gcloud
sha256: e9501083036d5f94027ce5afddd8ddae9b04121cf2fc6036b2cdd5663b52fca7
sha256: b8fbff52ff1cfdb2bb3c53eb039c0ee3745618632969b60ec25d55b31fbb36dd
url: "https://pub.dev"
source: hosted
version: "0.8.12"
version: "0.8.13"
glob:
dependency: transitive
description:
Expand All @@ -334,10 +334,10 @@ packages:
dependency: "direct main"
description:
name: googleapis
sha256: "8a8c311723162af077ca73f94b823b97ff68770d966e29614d20baca9fdb490a"
sha256: "864f222aed3f2ff00b816c675edf00a39e2aaf373d728d8abec30b37bee1a81c"
url: "https://pub.dev"
source: hosted
version: "12.0.0"
version: "13.2.0"
googleapis_auth:
dependency: "direct main"
description:
Expand Down Expand Up @@ -525,10 +525,10 @@ packages:
dependency: "direct main"
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
neat_cache:
dependency: "direct main"
description:
Expand Down Expand Up @@ -732,10 +732,10 @@ packages:
dependency: transitive
description:
name: source_map_stack_trace
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
source_maps:
dependency: transitive
description:
Expand Down Expand Up @@ -860,18 +860,18 @@ packages:
dependency: transitive
description:
name: uuid
sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90"
sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77
url: "https://pub.dev"
source: hosted
version: "4.4.2"
version: "4.5.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ dependencies:
fake_async: ^1.2.0
fake_gcloud:
path: ../pkg/fake_gcloud
gcloud: '^0.8.11'
googleapis: ^12.0.0
gcloud: '^0.8.13'
googleapis: ^13.0.0
googleapis_auth: ^1.1.0
html: ^0.15.0
http: ^1.0.0
Expand Down
20 changes: 10 additions & 10 deletions pkg/_popularity/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ packages:
dependency: "direct dev"
description:
name: coverage
sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db"
sha256: c1fb2dce3c0085f39dc72668e85f8e0210ec7de05345821ff58530567df345a5
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
dart_style:
dependency: transitive
description:
Expand Down Expand Up @@ -298,10 +298,10 @@ packages:
dependency: transitive
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
node_preamble:
dependency: transitive
description:
Expand Down Expand Up @@ -402,10 +402,10 @@ packages:
dependency: transitive
description:
name: source_map_stack_trace
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
source_maps:
dependency: transitive
description:
Expand Down Expand Up @@ -506,10 +506,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
24 changes: 12 additions & 12 deletions pkg/_pub_shared/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,18 @@ packages:
dependency: "direct dev"
description:
name: coverage
sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db"
sha256: c1fb2dce3c0085f39dc72668e85f8e0210ec7de05345821ff58530567df345a5
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
csslib:
dependency: transitive
description:
Expand Down Expand Up @@ -345,10 +345,10 @@ packages:
dependency: transitive
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
node_preamble:
dependency: transitive
description:
Expand Down Expand Up @@ -465,10 +465,10 @@ packages:
dependency: transitive
description:
name: source_map_stack_trace
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
source_maps:
dependency: transitive
description:
Expand Down Expand Up @@ -577,18 +577,18 @@ packages:
dependency: transitive
description:
name: uuid
sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90"
sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77
url: "https://pub.dev"
source: hosted
version: "4.4.2"
version: "4.5.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
24 changes: 12 additions & 12 deletions pkg/api_builder/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db"
sha256: c1fb2dce3c0085f39dc72668e85f8e0210ec7de05345821ff58530567df345a5
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.9.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
dart_style:
dependency: transitive
description:
Expand Down Expand Up @@ -306,10 +306,10 @@ packages:
dependency: transitive
description:
name: mime
sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a"
url: "https://pub.dev"
source: hosted
version: "1.0.5"
version: "1.0.6"
node_preamble:
dependency: transitive
description:
Expand Down Expand Up @@ -410,10 +410,10 @@ packages:
dependency: transitive
description:
name: source_map_stack_trace
sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae"
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
source_maps:
dependency: transitive
description:
Expand Down Expand Up @@ -522,18 +522,18 @@ packages:
dependency: "direct main"
description:
name: uuid
sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90"
sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77
url: "https://pub.dev"
source: hosted
version: "4.4.2"
version: "4.5.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit a1ed6eb

Please sign in to comment.