@lage-run/scheduler 0.10.3 → 0.10.5

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/CHANGELOG.json CHANGED
@@ -2,7 +2,49 @@
2
2
  "name": "@lage-run/scheduler",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 27 Mar 2023 18:00:03 GMT",
5
+ "date": "Wed, 29 Mar 2023 22:41:31 GMT",
6
+ "tag": "@lage-run/scheduler_v0.10.5",
7
+ "version": "0.10.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/scheduler",
13
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c",
14
+ "comment": "moving config to its own package"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@lage-run/scheduler",
19
+ "comment": "Bump @lage-run/worker-threads-pool to v0.5.1",
20
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@lage-run/scheduler",
25
+ "comment": "Bump @lage-run/scheduler-types to v0.3.5",
26
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Wed, 29 Mar 2023 20:02:40 GMT",
33
+ "tag": "@lage-run/scheduler_v0.10.4",
34
+ "version": "0.10.4",
35
+ "comments": {
36
+ "patch": [
37
+ {
38
+ "author": "beachball",
39
+ "package": "@lage-run/scheduler",
40
+ "comment": "Bump @lage-run/cache to v0.5.1",
41
+ "commit": "3554c6c3bc2226933a819fd1123ada422848d7d4"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Mon, 27 Mar 2023 18:00:15 GMT",
6
48
  "tag": "@lage-run/scheduler_v0.10.3",
7
49
  "version": "0.10.3",
8
50
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @lage-run/scheduler
2
2
 
3
- This log was last generated on Mon, 27 Mar 2023 18:00:03 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 29 Mar 2023 22:41:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.10.5
8
+
9
+ Wed, 29 Mar 2023 22:41:31 GMT
10
+
11
+ ### Patches
12
+
13
+ - moving config to its own package (kchau@microsoft.com)
14
+ - Bump @lage-run/worker-threads-pool to v0.5.1
15
+ - Bump @lage-run/scheduler-types to v0.3.5
16
+
17
+ ## 0.10.4
18
+
19
+ Wed, 29 Mar 2023 20:02:40 GMT
20
+
21
+ ### Patches
22
+
23
+ - Bump @lage-run/cache to v0.5.1
24
+
7
25
  ## 0.10.3
8
26
 
9
- Mon, 27 Mar 2023 18:00:03 GMT
27
+ Mon, 27 Mar 2023 18:00:15 GMT
10
28
 
11
29
  ### Patches
12
30
 
@@ -7,7 +7,7 @@ import type { Logger } from "@lage-run/logger";
7
7
  import type { TargetGraph } from "@lage-run/target-graph";
8
8
  import type { TargetScheduler, SchedulerRunSummary } from "@lage-run/scheduler-types";
9
9
  import type { Pool } from "@lage-run/worker-threads-pool";
10
- import type { TargetRunnerPickerOptions } from "./runners/TargetRunnerPicker.js";
10
+ import type { TargetRunnerPickerOptions } from "@lage-run/scheduler-types";
11
11
  export interface SimpleSchedulerOptions {
12
12
  logger: Logger;
13
13
  concurrency: number;
@@ -0,0 +1,15 @@
1
+ import type { CacheOptions } from "@lage-run/cache";
2
+ import { RemoteFallbackCacheProvider, TargetHasher } from "@lage-run/cache";
3
+ import type { Logger } from "@lage-run/logger";
4
+ interface CreateCacheOptions {
5
+ cacheOptions?: CacheOptions;
6
+ logger: Logger;
7
+ root: string;
8
+ skipLocalCache: boolean;
9
+ cliArgs: string[];
10
+ }
11
+ export declare function createCache(options: CreateCacheOptions): {
12
+ cacheProvider: RemoteFallbackCacheProvider;
13
+ hasher: TargetHasher;
14
+ };
15
+ export {};
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "createCache", {
6
+ enumerable: true,
7
+ get: ()=>createCache
8
+ });
9
+ const _cache = require("@lage-run/cache");
10
+ const _isRunningFromCIJs = require("./isRunningFromCI.js");
11
+ function createCache(options) {
12
+ const { cacheOptions , logger , root , skipLocalCache , cliArgs } = options;
13
+ const hasRemoteCacheConfig = !!cacheOptions?.cacheStorageConfig || !!process.env.BACKFILL_CACHE_PROVIDER || !!process.env.BACKFILL_CACHE_PROVIDER_OPTIONS;
14
+ // Create Cache Provider
15
+ const cacheProvider = new _cache.RemoteFallbackCacheProvider({
16
+ root,
17
+ logger,
18
+ localCacheProvider: skipLocalCache === true ? undefined : new _cache.BackfillCacheProvider({
19
+ logger,
20
+ root,
21
+ cacheOptions: {
22
+ outputGlob: cacheOptions?.outputGlob,
23
+ ...cacheOptions?.internalCacheFolder && {
24
+ internalCacheFolder: cacheOptions.internalCacheFolder
25
+ },
26
+ ...cacheOptions?.incrementalCaching && {
27
+ incrementalCaching: cacheOptions.incrementalCaching
28
+ }
29
+ }
30
+ }),
31
+ remoteCacheProvider: hasRemoteCacheConfig ? new _cache.BackfillCacheProvider({
32
+ logger,
33
+ root,
34
+ cacheOptions: cacheOptions ?? {}
35
+ }) : undefined,
36
+ writeRemoteCache: cacheOptions?.writeRemoteCache === true || String(process.env.LAGE_WRITE_CACHE).toLowerCase() === "true" || _isRunningFromCIJs.isRunningFromCI
37
+ });
38
+ const hasher = new _cache.TargetHasher({
39
+ root,
40
+ environmentGlob: cacheOptions?.environmentGlob ?? [],
41
+ cacheKey: cacheOptions?.cacheKey,
42
+ cliArgs
43
+ });
44
+ return {
45
+ cacheProvider,
46
+ hasher
47
+ };
48
+ }
@@ -0,0 +1 @@
1
+ export declare const isRunningFromCI: boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "isRunningFromCI", {
6
+ enumerable: true,
7
+ get: ()=>isRunningFromCI
8
+ });
9
+ const isRunningFromCI = process.env.NODE_ENV !== "test" && (!!process.env.CI || !!process.env.TF_BUILD);
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { NpmScriptRunner } from "./runners/NpmScriptRunner.js";
2
2
  export { SimpleScheduler } from "./SimpleScheduler.js";
3
- export { TargetRunnerPicker, type TargetRunnerPickerOptions } from "./runners/TargetRunnerPicker.js";
3
+ export { TargetRunnerPicker } from "./runners/TargetRunnerPicker.js";
4
4
  export { WorkerRunner } from "./runners/WorkerRunner.js";
5
5
  export { NoOpRunner } from "./runners/NoOpRunner.js";
@@ -1,11 +1,5 @@
1
1
  import type { Target } from "@lage-run/target-graph";
2
- import type { TargetRunner } from "@lage-run/scheduler-types";
3
- export interface TargetRunnerPickerOptions {
4
- [key: string]: {
5
- script: string;
6
- options: any;
7
- };
8
- }
2
+ import type { TargetRunner, TargetRunnerPickerOptions } from "@lage-run/scheduler-types";
9
3
  export declare class TargetRunnerPicker {
10
4
  private options;
11
5
  constructor(options: TargetRunnerPickerOptions);
@@ -6,7 +6,7 @@ const _workerThreadsPool = require("@lage-run/worker-threads-pool");
6
6
  const _targetRunnerPickerJs = require("../runners/TargetRunnerPicker.js");
7
7
  const _workerThreads = require("worker_threads");
8
8
  function setup(options) {
9
- const { runners } = options;
9
+ const { runners , root } = options;
10
10
  const runnerPicker = new _targetRunnerPickerJs.TargetRunnerPicker(runners);
11
11
  return {
12
12
  runnerPicker
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/scheduler",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "description": "Scheduler for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"
@@ -17,11 +17,11 @@
17
17
  "dependencies": {
18
18
  "@lage-run/target-graph": "^0.8.1",
19
19
  "@lage-run/logger": "^1.2.2",
20
- "@lage-run/cache": "^0.5.0",
21
- "@lage-run/worker-threads-pool": "^0.5.0"
20
+ "@lage-run/cache": "^0.5.1",
21
+ "@lage-run/worker-threads-pool": "^0.5.1"
22
22
  },
23
23
  "devDependencies": {
24
- "@lage-run/scheduler-types": "^0.3.4",
24
+ "@lage-run/scheduler-types": "^0.3.5",
25
25
  "monorepo-scripts": "*"
26
26
  },
27
27
  "publishConfig": {