|
1 |
| -/* |
2 |
| - * Copyright 2024 Google LLC |
3 |
| - * |
4 |
| - * Licensed under the Apache License, Version 2.0 (the "License"); |
5 |
| - * you may not use this file except in compliance with the License. |
6 |
| - * You may obtain a copy of the License at |
7 |
| - * |
8 |
| - * https://www.apache.org/licenses/LICENSE-2.0 |
9 |
| - * |
10 |
| - * Unless required by applicable law or agreed to in writing, software |
11 |
| - * distributed under the License is distributed on an "AS IS" BASIS, |
12 |
| - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 |
| - * See the License for the specific language governing permissions and |
14 |
| - * limitations under the License. |
15 |
| - */ |
| 1 | +// /* |
| 2 | +// * Copyright 2024 Google LLC |
| 3 | +// * |
| 4 | +// * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// * you may not use this file except in compliance with the License. |
| 6 | +// * You may obtain a copy of the License at |
| 7 | +// * |
| 8 | +// * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +// * |
| 10 | +// * Unless required by applicable law or agreed to in writing, software |
| 11 | +// * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// * See the License for the specific language governing permissions and |
| 14 | +// * limitations under the License. |
| 15 | +// */ |
16 | 16 |
|
17 |
| -'use strict'; |
| 17 | +// 'use strict'; |
18 | 18 |
|
19 |
| -const path = require('path'); |
20 |
| -const assert = require('node:assert/strict'); |
21 |
| -const {after, before, describe, it} = require('mocha'); |
22 |
| -const cp = require('child_process'); |
23 |
| -const {TpuClient} = require('@google-cloud/tpu').v2alpha1; |
| 19 | +// const path = require('path'); |
| 20 | +// const assert = require('node:assert/strict'); |
| 21 | +// const {after, before, describe, it} = require('mocha'); |
| 22 | +// const cp = require('child_process'); |
| 23 | +// const {TpuClient} = require('@google-cloud/tpu').v2alpha1; |
24 | 24 |
|
25 |
| -const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); |
26 |
| -const cwd = path.join(__dirname, '..'); |
| 25 | +// const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); |
| 26 | +// const cwd = path.join(__dirname, '..'); |
27 | 27 |
|
28 |
| -describe('TPU queued resource with specified network', async () => { |
29 |
| - const queuedResourceName = `queued-resource-with-network-${Math.floor(Math.random() * 1000 + 1)}`; |
30 |
| - const nodeName = `node-with-network-2a2b3c${Math.floor(Math.random() * 1000 + 1)}`; |
31 |
| - const zone = 'us-south1-a'; |
32 |
| - const tpuType = 'v5litepod-1'; |
33 |
| - const tpuSoftwareVersion = 'tpu-vm-tf-2.14.1'; |
34 |
| - let projectId; |
| 28 | +// describe('TPU queued resource with specified network', async () => { |
| 29 | +// const queuedResourceName = `queued-resource-with-network-${Math.floor(Math.random() * 1000 + 1)}`; |
| 30 | +// const nodeName = `node-with-network-2a2b3c${Math.floor(Math.random() * 1000 + 1)}`; |
| 31 | +// const zone = 'us-south1-a'; |
| 32 | +// const tpuType = 'v5litepod-1'; |
| 33 | +// const tpuSoftwareVersion = 'tpu-vm-tf-2.14.1'; |
| 34 | +// let projectId; |
35 | 35 |
|
36 |
| - before(async () => { |
37 |
| - const tpuClient = new TpuClient(); |
38 |
| - projectId = await tpuClient.getProjectId(); |
39 |
| - }); |
| 36 | +// before(async () => { |
| 37 | +// const tpuClient = new TpuClient(); |
| 38 | +// projectId = await tpuClient.getProjectId(); |
| 39 | +// }); |
40 | 40 |
|
41 |
| - after(() => { |
42 |
| - // Delete queued resource |
43 |
| - execSync( |
44 |
| - `node ./queuedResources/forceDeleteQueuedResource.js ${queuedResourceName} ${zone}`, |
45 |
| - { |
46 |
| - cwd, |
47 |
| - } |
48 |
| - ); |
49 |
| - }); |
| 41 | +// after(() => { |
| 42 | +// // Delete queued resource |
| 43 | +// execSync( |
| 44 | +// `node ./queuedResources/forceDeleteQueuedResource.js ${queuedResourceName} ${zone}`, |
| 45 | +// { |
| 46 | +// cwd, |
| 47 | +// } |
| 48 | +// ); |
| 49 | +// }); |
50 | 50 |
|
51 |
| - it('should create queued resource with specified network', () => { |
52 |
| - const networkConfig = { |
53 |
| - network: `projects/${projectId}/global/networks/compute-tpu-network`, |
54 |
| - subnetwork: `projects/${projectId}/regions/europe-west4/subnetworks/compute-tpu-network`, |
55 |
| - enableExternalIps: true, |
56 |
| - }; |
| 51 | +// it('should create queued resource with specified network', () => { |
| 52 | +// const networkConfig = { |
| 53 | +// network: `projects/${projectId}/global/networks/compute-tpu-network`, |
| 54 | +// subnetwork: `projects/${projectId}/regions/europe-west4/subnetworks/compute-tpu-network`, |
| 55 | +// enableExternalIps: true, |
| 56 | +// }; |
57 | 57 |
|
58 |
| - const response = execSync( |
59 |
| - `node ./queuedResources/createQueuedResourceNetwork.js ${nodeName} ${queuedResourceName} ${zone} ${tpuType} ${tpuSoftwareVersion}`, |
60 |
| - { |
61 |
| - cwd, |
62 |
| - } |
63 |
| - ); |
| 58 | +// const response = execSync( |
| 59 | +// `node ./queuedResources/createQueuedResourceNetwork.js ${nodeName} ${queuedResourceName} ${zone} ${tpuType} ${tpuSoftwareVersion}`, |
| 60 | +// { |
| 61 | +// cwd, |
| 62 | +// } |
| 63 | +// ); |
64 | 64 |
|
65 |
| - assert( |
66 |
| - response.includes( |
67 |
| - `Queued resource ${queuedResourceName} with specified network created.` |
68 |
| - ) |
69 |
| - ); |
70 |
| - assert(response.includes(JSON.stringify(networkConfig))); |
71 |
| - }); |
72 |
| -}); |
| 65 | +// assert( |
| 66 | +// response.includes( |
| 67 | +// `Queued resource ${queuedResourceName} with specified network created.` |
| 68 | +// ) |
| 69 | +// ); |
| 70 | +// assert(response.includes(JSON.stringify(networkConfig))); |
| 71 | +// }); |
| 72 | +// }); |
0 commit comments