@remotion/cloudrun 4.0.45 → 4.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -4
- package/.turbo/turbo-lint.log +24 -2
- package/LICENSE.md +1 -1
- package/dist/admin/bundle-installer.js +10 -10
- package/dist/api/delete-service.js +2 -1
- package/dist/api/get-service-info.js +2 -1
- package/dist/api/helpers/get-auth-client-for-url.js +16 -6
- package/dist/api/helpers/get-cloud-logging-client.js +6 -0
- package/dist/api/helpers/get-cloud-run-client.js +6 -0
- package/dist/api/helpers/get-cloud-storage-client.js +6 -0
- package/dist/api/helpers/get-resource-manager-client.js +6 -0
- package/dist/api/helpers/parse-service-name.js +2 -1
- package/dist/api/iam-validation/testPermissions.js +2 -1
- package/dist/api/test/make-console.test.d.ts +1 -0
- package/dist/api/test/make-console.test.js +26 -0
- package/dist/api/test/running-in-what-server.test.d.ts +1 -0
- package/dist/api/test/running-in-what-server.test.js +31 -0
- package/dist/api/test/service-names.test.js +1 -1
- package/dist/api/upload-dir.js +5 -5
- package/dist/cli/commands/permissions.js +2 -1
- package/dist/cli/helpers/cloudrun-crash-logs.js +4 -3
- package/dist/cli/helpers/make-console-url.js +2 -1
- package/dist/functions/helpers/is-in-cloud-task.d.ts +2 -0
- package/dist/functions/helpers/is-in-cloud-task.js +18 -0
- package/package.json +8 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @remotion/cloudrun@4.0.
|
|
2
|
+
> @remotion/cloudrun@4.0.46 build /Users/jonathanburger/remotion/packages/cloudrun
|
|
3
3
|
> tsc -d && cp src/shared/sa-permissions.json dist/shared/sa-permissions.json && pnpm run buildContainer && pnpm run tarInstaller
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @remotion/cloudrun@4.0.
|
|
6
|
+
> @remotion/cloudrun@4.0.46 buildContainer /Users/jonathanburger/remotion/packages/cloudrun
|
|
7
7
|
> ts-node src/admin/bundle-renderLogic.ts
|
|
8
8
|
|
|
9
9
|
distribution bundled.
|
|
10
10
|
|
|
11
|
-
> @remotion/cloudrun@4.0.
|
|
11
|
+
> @remotion/cloudrun@4.0.46 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
|
|
12
12
|
> ts-node src/admin/bundle-installer.ts
|
|
13
13
|
|
|
14
|
-
Making
|
|
14
|
+
Making reproducible build with gtar
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
|
|
2
|
-
> @remotion/cloudrun@4.0.
|
|
2
|
+
> @remotion/cloudrun@4.0.45 lint /Users/jonathanburger/remotion/packages/cloudrun
|
|
3
3
|
> eslint src --ext ts,tsx
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
|
|
6
|
+
|
|
7
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/api/check-if-service-exists.ts
|
|
8
|
+
56:14 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
9
|
+
|
|
10
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/api/render-media-on-cloudrun.ts
|
|
11
|
+
217:3 warning Unexpected 'todo' comment: 'TODO: Add any sort of type safety' no-warning-comments
|
|
12
|
+
226:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
13
|
+
|
|
14
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/api/render-still-on-cloudrun.ts
|
|
15
|
+
153:17 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
|
|
16
|
+
|
|
17
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/cli/commands/render/helpers/renderArgsCheck.ts
|
|
18
|
+
68:4 warning Unexpected 'todo' comment: 'TODO: Log if there is an incompatible...' no-warning-comments
|
|
19
|
+
|
|
20
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/cli/commands/render/index.ts
|
|
21
|
+
118:2 warning Unexpected 'todo' comment: 'Todo: Check cloudRunUrl is valid, as the...' no-warning-comments
|
|
22
|
+
|
|
23
|
+
/Users/jonathanburger/remotion/packages/cloudrun/src/cli/commands/still.ts
|
|
24
|
+
104:2 warning Unexpected 'todo' comment: 'Todo: Check cloudRunUrl is valid, as the...' no-warning-comments
|
|
25
|
+
|
|
26
|
+
✖ 7 problems (0 errors, 7 warnings)
|
|
27
|
+
|
package/LICENSE.md
CHANGED
|
@@ -38,4 +38,4 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
|
38
38
|
|
|
39
39
|
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
|
|
40
40
|
|
|
41
|
-
Visit [
|
|
41
|
+
Visit [remotion.pro](https://www.remotion.pro) for pricing and to buy a license.
|
|
@@ -8,6 +8,16 @@ const bundler_1 = require("@remotion/bundler");
|
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const hasGTar = () => {
|
|
12
|
+
try {
|
|
13
|
+
const output = (0, child_process_1.execSync)('gtar --usage', {});
|
|
14
|
+
return output.includes('--sort');
|
|
15
|
+
}
|
|
16
|
+
catch (_a) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.hasGTar = hasGTar;
|
|
11
21
|
const bundleInstaller = async () => {
|
|
12
22
|
const outdir = path_1.default.join(__dirname, '..', `build-installer`);
|
|
13
23
|
(0, fs_1.mkdirSync)(outdir, { recursive: true });
|
|
@@ -43,13 +53,3 @@ const bundleInstaller = async () => {
|
|
|
43
53
|
(0, fs_1.rmSync)(outdir, { recursive: true });
|
|
44
54
|
};
|
|
45
55
|
bundleInstaller();
|
|
46
|
-
const hasGTar = () => {
|
|
47
|
-
try {
|
|
48
|
-
const output = (0, child_process_1.execSync)('gtar --usage', {});
|
|
49
|
-
return output.includes('--sort');
|
|
50
|
-
}
|
|
51
|
-
catch (_a) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
exports.hasGTar = hasGTar;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteService = void 0;
|
|
4
|
+
const is_in_cloud_task_1 = require("../functions/helpers/is-in-cloud-task");
|
|
4
5
|
const get_cloud_run_client_1 = require("./helpers/get-cloud-run-client");
|
|
5
6
|
/**
|
|
6
7
|
* @description Deletes a service from GCP Cloud Run
|
|
@@ -13,7 +14,7 @@ const deleteService = async (params) => {
|
|
|
13
14
|
const cloudRunClient = (0, get_cloud_run_client_1.getCloudRunClient)();
|
|
14
15
|
// Run request
|
|
15
16
|
await cloudRunClient.deleteService({
|
|
16
|
-
name: `projects/${
|
|
17
|
+
name: `projects/${(0, is_in_cloud_task_1.getProjectId)()}/locations/${params.region}/services/${params.serviceName}`,
|
|
17
18
|
});
|
|
18
19
|
};
|
|
19
20
|
exports.deleteService = deleteService;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getServiceInfo = void 0;
|
|
4
4
|
const make_console_url_1 = require("../cli/helpers/make-console-url");
|
|
5
|
+
const is_in_cloud_task_1 = require("../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const get_cloud_run_client_1 = require("./helpers/get-cloud-run-client");
|
|
6
7
|
const parse_service_name_1 = require("./helpers/parse-service-name");
|
|
7
8
|
/**
|
|
@@ -15,7 +16,7 @@ const getServiceInfo = async ({ region, serviceName, }) => {
|
|
|
15
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
16
17
|
const cloudRunClient = (0, get_cloud_run_client_1.getCloudRunClient)();
|
|
17
18
|
const [service] = await cloudRunClient.getService({
|
|
18
|
-
name: `projects/${
|
|
19
|
+
name: `projects/${(0, is_in_cloud_task_1.getProjectId)()}/locations/${region}/services/${serviceName}`,
|
|
19
20
|
});
|
|
20
21
|
if (!service) {
|
|
21
22
|
throw new Error(`Service ${serviceName} not found`);
|
|
@@ -2,13 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAuthClientForUrl = void 0;
|
|
4
4
|
const google_auth_library_1 = require("google-auth-library");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const getAuthClientForUrl = async (url) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
}
|
|
7
|
+
let auth = new google_auth_library_1.GoogleAuth();
|
|
8
|
+
if ((0, is_in_cloud_task_1.isInCloudTask)()) {
|
|
9
|
+
auth = new google_auth_library_1.GoogleAuth({
|
|
10
|
+
projectId: (0, is_in_cloud_task_1.getProjectId)(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
auth = new google_auth_library_1.GoogleAuth({
|
|
15
|
+
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
16
|
+
credentials: {
|
|
17
|
+
client_email: process.env.REMOTION_GCP_CLIENT_EMAIL,
|
|
18
|
+
private_key: process.env.REMOTION_GCP_PRIVATE_KEY,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
12
22
|
const client = await auth.getIdTokenClient(url);
|
|
13
23
|
return client;
|
|
14
24
|
};
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCloudLoggingClient = void 0;
|
|
4
4
|
const logging_1 = require("@google-cloud/logging");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const { LoggingServiceV2Client } = logging_1.v2;
|
|
6
7
|
const getCloudLoggingClient = () => {
|
|
8
|
+
if ((0, is_in_cloud_task_1.isInCloudTask)()) {
|
|
9
|
+
return new LoggingServiceV2Client({
|
|
10
|
+
projectId: (0, is_in_cloud_task_1.getProjectId)(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
7
13
|
return new LoggingServiceV2Client({
|
|
8
14
|
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
9
15
|
credentials: {
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCloudRunClient = void 0;
|
|
4
4
|
const run_1 = require("@google-cloud/run");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const { ServicesClient } = run_1.v2;
|
|
6
7
|
const getCloudRunClient = () => {
|
|
8
|
+
if ((0, is_in_cloud_task_1.isInCloudTask)()) {
|
|
9
|
+
return new ServicesClient({
|
|
10
|
+
projectId: (0, is_in_cloud_task_1.getProjectId)(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
7
13
|
return new ServicesClient({
|
|
8
14
|
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
9
15
|
credentials: {
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCloudStorageClient = void 0;
|
|
4
4
|
const storage_1 = require("@google-cloud/storage");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const getCloudStorageClient = () => {
|
|
7
|
+
if ((0, is_in_cloud_task_1.isInCloudTask)()) {
|
|
8
|
+
return new storage_1.Storage({
|
|
9
|
+
projectId: (0, is_in_cloud_task_1.getProjectId)(),
|
|
10
|
+
});
|
|
11
|
+
}
|
|
6
12
|
return new storage_1.Storage({
|
|
7
13
|
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
8
14
|
credentials: {
|
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getResourceManagerClient = void 0;
|
|
4
4
|
const resource_manager_1 = require("@google-cloud/resource-manager");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const { ProjectsClient } = resource_manager_1.v3;
|
|
6
7
|
const getResourceManagerClient = () => {
|
|
8
|
+
if ((0, is_in_cloud_task_1.isInCloudTask)()) {
|
|
9
|
+
return new ProjectsClient({
|
|
10
|
+
projectId: (0, is_in_cloud_task_1.getProjectId)(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
7
13
|
return new ProjectsClient({
|
|
8
14
|
projectId: process.env.REMOTION_GCP_PROJECT_ID,
|
|
9
15
|
credentials: {
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseServiceName = exports.getGcpParent = void 0;
|
|
4
4
|
const make_console_url_1 = require("../../cli/helpers/make-console-url");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
6
|
const getGcpParent = (region) => {
|
|
6
|
-
const parent = `projects/${
|
|
7
|
+
const parent = `projects/${(0, is_in_cloud_task_1.getProjectId)()}/locations/${region}`;
|
|
7
8
|
return parent;
|
|
8
9
|
};
|
|
9
10
|
exports.getGcpParent = getGcpParent;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.testPermissions = exports.logPermissionOutput = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
9
10
|
const get_resource_manager_client_1 = require("../helpers/get-resource-manager-client");
|
|
10
11
|
const logPermissionOutput = (output) => {
|
|
11
12
|
return [output.decision ? '✅' : '❌', output.permissionName].join(' ');
|
|
@@ -23,7 +24,7 @@ const testPermissions = async (params) => {
|
|
|
23
24
|
const saPermissions = JSON.parse(fs_1.default.readFileSync(path_1.default.join(__dirname, '../../shared/sa-permissions.json'), 'utf-8'));
|
|
24
25
|
const permissionList = saPermissions.list.map((permission) => permission.name);
|
|
25
26
|
const response = await resourceManagerClient.testIamPermissions({
|
|
26
|
-
resource: `projects/${
|
|
27
|
+
resource: `projects/${(0, is_in_cloud_task_1.getProjectId)()}`,
|
|
27
28
|
permissions: permissionList,
|
|
28
29
|
});
|
|
29
30
|
const returnedPermissions = response[0].permissions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const make_console_url_1 = require("../../cli/helpers/make-console-url");
|
|
5
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
6
|
+
(0, vitest_1.beforeEach)(() => {
|
|
7
|
+
delete process.env.GCLOUD_PROJECT;
|
|
8
|
+
delete process.env.REMOTION_GCP_PROJECT_ID;
|
|
9
|
+
delete process.env.K_CONFIGURATION;
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.test)('app is in cloud tasks', () => {
|
|
12
|
+
process.env.GCLOUD_PROJECT = 'remotion-test-cloudtask';
|
|
13
|
+
process.env.K_CONFIGURATION = 'config';
|
|
14
|
+
const isInCloud = (0, is_in_cloud_task_1.isInCloudTask)();
|
|
15
|
+
(0, vitest_1.expect)(isInCloud).toBe(true);
|
|
16
|
+
const consoleUrl = (0, make_console_url_1.makeConsoleUrl)('asia-east1', 'test-name');
|
|
17
|
+
(0, vitest_1.expect)(consoleUrl).toBe('https://console.cloud.google.com/run/detail/asia-east1/test-name/logs?project=remotion-test-cloudtask');
|
|
18
|
+
});
|
|
19
|
+
(0, vitest_1.test)('app is not in cloud tasks', () => {
|
|
20
|
+
process.env.GCLOUD_PROJECT = 'remotion-test';
|
|
21
|
+
process.env.K_CONFIGURATION = 'config';
|
|
22
|
+
const isInCloud = (0, is_in_cloud_task_1.isInCloudTask)();
|
|
23
|
+
(0, vitest_1.expect)(isInCloud).toBe(true);
|
|
24
|
+
const consoleUrl = (0, make_console_url_1.makeConsoleUrl)('asia-east1', 'test-name');
|
|
25
|
+
(0, vitest_1.expect)(consoleUrl).toBe('https://console.cloud.google.com/run/detail/asia-east1/test-name/logs?project=remotion-test');
|
|
26
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
5
|
+
(0, vitest_1.beforeEach)(() => {
|
|
6
|
+
delete process.env.GCLOUD_PROJECT;
|
|
7
|
+
delete process.env.REMOTION_GCP_PROJECT_ID;
|
|
8
|
+
delete process.env.K_CONFIGURATION;
|
|
9
|
+
});
|
|
10
|
+
(0, vitest_1.test)('is running in cloud tasks = true', () => {
|
|
11
|
+
process.env.GCLOUD_PROJECT = 'remotion-test-cloudtask';
|
|
12
|
+
process.env.K_CONFIGURATION = 'config';
|
|
13
|
+
const isInCloud = (0, is_in_cloud_task_1.isInCloudTask)();
|
|
14
|
+
(0, vitest_1.expect)(isInCloud).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
(0, vitest_1.test)('is running in cloud tasks = false', () => {
|
|
17
|
+
process.env.REMOTION_GCP_PROJECT_ID = 'remotion-test-cloudtask';
|
|
18
|
+
const isInCloud = (0, is_in_cloud_task_1.isInCloudTask)();
|
|
19
|
+
(0, vitest_1.expect)(isInCloud).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
(0, vitest_1.test)('which project Id = remotion-test', () => {
|
|
22
|
+
process.env.REMOTION_GCP_PROJECT_ID = 'remotion-test';
|
|
23
|
+
const projectId = (0, is_in_cloud_task_1.getProjectId)();
|
|
24
|
+
(0, vitest_1.expect)(projectId).toBe('remotion-test');
|
|
25
|
+
});
|
|
26
|
+
(0, vitest_1.test)('which project Id = remotion-test-cloudtask', () => {
|
|
27
|
+
process.env.GCLOUD_PROJECT = 'remotion-test-cloudtask';
|
|
28
|
+
process.env.K_CONFIGURATION = 'config';
|
|
29
|
+
const projectId = (0, is_in_cloud_task_1.getProjectId)();
|
|
30
|
+
(0, vitest_1.expect)(projectId).toBe('remotion-test-cloudtask');
|
|
31
|
+
});
|
|
@@ -6,8 +6,8 @@ const parse_service_name_1 = require("../helpers/parse-service-name");
|
|
|
6
6
|
const speculate_service_name_1 = require("../speculate-service-name");
|
|
7
7
|
const dashedVersion = remotion_1.VERSION.replace(/\./g, '-');
|
|
8
8
|
const region = 'asia-east1';
|
|
9
|
-
process.env.REMOTION_GCP_PROJECT_ID = 'remotion-test-project';
|
|
10
9
|
(0, vitest_1.test)('Parse service names', () => {
|
|
10
|
+
process.env.REMOTION_GCP_PROJECT_ID = 'remotion-test-project';
|
|
11
11
|
const shortServiceName = (0, speculate_service_name_1.speculateServiceName)({
|
|
12
12
|
cpuLimit: '8.0',
|
|
13
13
|
memoryLimit: '100000k',
|
package/dist/api/upload-dir.js
CHANGED
|
@@ -13,11 +13,6 @@ const getDirFiles = (entry) => {
|
|
|
13
13
|
};
|
|
14
14
|
exports.getDirFiles = getDirFiles;
|
|
15
15
|
const uploadDir = async ({ bucket, localDir, onProgress, keyPrefix, toUpload, }) => {
|
|
16
|
-
const files = await getFiles(localDir, localDir, toUpload);
|
|
17
|
-
const progresses = {};
|
|
18
|
-
for (const file of files) {
|
|
19
|
-
progresses[file.name] = 0;
|
|
20
|
-
}
|
|
21
16
|
async function getFiles(directory, originalDirectory, filesToUpload) {
|
|
22
17
|
const dirents = await fs_1.promises.readdir(directory, { withFileTypes: true });
|
|
23
18
|
const _files = await Promise.all(dirents
|
|
@@ -48,6 +43,11 @@ const uploadDir = async ({ bucket, localDir, onProgress, keyPrefix, toUpload, })
|
|
|
48
43
|
}));
|
|
49
44
|
return _files.flat(1);
|
|
50
45
|
}
|
|
46
|
+
const files = await getFiles(localDir, localDir, toUpload);
|
|
47
|
+
const progresses = {};
|
|
48
|
+
for (const file of files) {
|
|
49
|
+
progresses[file.name] = 0;
|
|
50
|
+
}
|
|
51
51
|
const cloudStorageClient = (0, get_cloud_storage_client_1.getCloudStorageClient)();
|
|
52
52
|
const uploads = files.map((file) => {
|
|
53
53
|
const filePath = file.name;
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.permissionsCommand = exports.PERMISSIONS_COMMAND = void 0;
|
|
4
4
|
const cli_1 = require("@remotion/cli");
|
|
5
5
|
const testPermissions_1 = require("../../api/iam-validation/testPermissions");
|
|
6
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
6
7
|
const log_1 = require("../log");
|
|
7
8
|
exports.PERMISSIONS_COMMAND = 'permissions';
|
|
8
9
|
const permissionsCommand = async () => {
|
|
9
10
|
try {
|
|
10
|
-
log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`Checking permissions for ${process.env.REMOTION_GCP_CLIENT_EMAIL} in project ${
|
|
11
|
+
log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`Checking permissions for ${process.env.REMOTION_GCP_CLIENT_EMAIL} in project ${(0, is_in_cloud_task_1.getProjectId)()}.`));
|
|
11
12
|
log_1.Log.info();
|
|
12
13
|
await (0, testPermissions_1.testPermissions)({
|
|
13
14
|
onTest: (res) => {
|
|
@@ -5,6 +5,7 @@ const cli_1 = require("@remotion/cli");
|
|
|
5
5
|
const extract_mem_from_url_1 = require("../../api/helpers/extract-mem-from-url");
|
|
6
6
|
const extract_time_from_url_1 = require("../../api/helpers/extract-time-from-url");
|
|
7
7
|
const get_cloud_logging_client_1 = require("../../api/helpers/get-cloud-logging-client");
|
|
8
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
8
9
|
const log_1 = require("../log");
|
|
9
10
|
const displayCrashLogs = async (res) => {
|
|
10
11
|
let timeoutPreMsg = '';
|
|
@@ -18,11 +19,11 @@ const displayCrashLogs = async (res) => {
|
|
|
18
19
|
}
|
|
19
20
|
log_1.Log.error(`Error rendering on Cloud Run. The Cloud Run service did not return a response.\n
|
|
20
21
|
${timeoutPreMsg}The crash may be due to the service exceeding its memory limit of ${memoryLimit}.
|
|
21
|
-
Full logs are available at https://console.cloud.google.com/run?project=${
|
|
22
|
+
Full logs are available at https://console.cloud.google.com/run?project=${(0, is_in_cloud_task_1.getProjectId)()}\n`);
|
|
22
23
|
const cloudLoggingClient = (0, get_cloud_logging_client_1.getCloudLoggingClient)();
|
|
23
24
|
const listLogEntriesRequest = {
|
|
24
|
-
resourceNames: [`projects/${
|
|
25
|
-
filter: `logName=projects/${
|
|
25
|
+
resourceNames: [`projects/${(0, is_in_cloud_task_1.getProjectId)()}`],
|
|
26
|
+
filter: `logName=projects/${(0, is_in_cloud_task_1.getProjectId)()}/logs/run.googleapis.com%2Fvarlog%2Fsystem AND (severity=WARNING OR severity=ERROR) AND timestamp >= "${res.requestStartTime}"`,
|
|
26
27
|
};
|
|
27
28
|
const logCheckCountdown = cli_1.CliInternals.createOverwriteableCliOutput({
|
|
28
29
|
quiet: cli_1.CliInternals.quietFlagProvided(),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeConsoleUrl = void 0;
|
|
4
|
+
const is_in_cloud_task_1 = require("../../functions/helpers/is-in-cloud-task");
|
|
4
5
|
const makeConsoleUrl = (region, shortName) => {
|
|
5
|
-
return `https://console.cloud.google.com/run/detail/${region}/${shortName}/logs?project=${
|
|
6
|
+
return `https://console.cloud.google.com/run/detail/${region}/${shortName}/logs?project=${(0, is_in_cloud_task_1.getProjectId)()}`;
|
|
6
7
|
};
|
|
7
8
|
exports.makeConsoleUrl = makeConsoleUrl;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectId = exports.isInCloudTask = void 0;
|
|
4
|
+
const isInCloudTask = () => {
|
|
5
|
+
if (process.env.REMOTION_GCP_PROJECT_ID)
|
|
6
|
+
return false;
|
|
7
|
+
if (process.env.K_CONFIGURATION && process.env.GCLOUD_PROJECT) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
};
|
|
12
|
+
exports.isInCloudTask = isInCloudTask;
|
|
13
|
+
const getProjectId = () => {
|
|
14
|
+
return (0, exports.isInCloudTask)()
|
|
15
|
+
? process.env.GCLOUD_PROJECT
|
|
16
|
+
: process.env.REMOTION_GCP_PROJECT_ID;
|
|
17
|
+
};
|
|
18
|
+
exports.getProjectId = getProjectId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cloudrun",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.47",
|
|
4
4
|
"description": "GCP Cloud Run alternative to lambda rendering",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"@google-cloud/resource-manager": "^4.3.0",
|
|
12
12
|
"@google-cloud/logging": "^10.5.0",
|
|
13
13
|
"google-auth-library": "^8.7.0",
|
|
14
|
-
"zod": "^3.
|
|
15
|
-
"@remotion/bundler": "4.0.
|
|
16
|
-
"@remotion/cli": "4.0.
|
|
17
|
-
"
|
|
18
|
-
"remotion": "4.0.
|
|
14
|
+
"zod": "^3.22.3",
|
|
15
|
+
"@remotion/bundler": "4.0.47",
|
|
16
|
+
"@remotion/cli": "4.0.47",
|
|
17
|
+
"remotion": "4.0.47",
|
|
18
|
+
"@remotion/renderer": "4.0.47"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@jonny/eslint-config": "3.0.
|
|
21
|
+
"@jonny/eslint-config": "3.0.276",
|
|
22
22
|
"@types/node": "^18.11.2",
|
|
23
23
|
"@types/minimist": "1.2.2",
|
|
24
24
|
"eslint": "8.42.0",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
27
27
|
"ts-node": "^10.8.0",
|
|
28
28
|
"vitest": "0.24.3",
|
|
29
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
29
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.47"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
"./package.json": "./package.json",
|