Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] add support for sharding phases #4652

Merged
merged 65 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b49a165
add test project
aramissennyeydd Apr 16, 2024
6f93177
add support for sharded phases
aramissennyeydd Apr 16, 2024
ed7abc0
move to .shards folder and rename properties
aramissennyeydd Apr 16, 2024
02e154a
remove dev logging
aramissennyeydd Apr 16, 2024
06f1a4c
add cobuild test repo for shards
aramissennyeydd Apr 16, 2024
c4a88e3
reduce the timeout period
aramissennyeydd Apr 16, 2024
fc625c1
fix bugs with shards in cobuilds
aramissennyeydd Apr 16, 2024
db8ad00
minor script updates
aramissennyeydd Apr 17, 2024
eb80e93
pr fixes
aramissennyeydd Apr 25, 2024
403734c
move to a new plugin
aramissennyeydd Apr 25, 2024
1bf1465
adjust to sharding config
aramissennyeydd Apr 25, 2024
7d34e74
isolate sharding work to ShardedPhaseOperationPlugin
aramissennyeydd Apr 26, 2024
6c8cf5c
move operationSettings inside of IOperationRunner
aramissennyeydd Apr 26, 2024
19b0dbd
revert state
aramissennyeydd Apr 26, 2024
044bcbb
run rush update
aramissennyeydd Apr 26, 2024
540453e
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd Apr 26, 2024
31dd787
add changesets
aramissennyeydd Apr 26, 2024
d4159e9
add support for sharding to the jest plugin
aramissennyeydd Apr 26, 2024
7821702
remove .shards remnants
aramissennyeydd Apr 26, 2024
ab0b208
support coverage output in jest
aramissennyeydd Apr 26, 2024
e6b1eb4
rename test cases
aramissennyeydd Apr 26, 2024
efa189f
revert metadata changes
aramissennyeydd Apr 26, 2024
7f24299
addressing PR feedback
aramissennyeydd Apr 30, 2024
73d3d77
arrays..
aramissennyeydd Apr 30, 2024
226fd81
don't need to format collator command
aramissennyeydd Apr 30, 2024
3fd51e3
remove from command-line.json
aramissennyeydd Apr 30, 2024
a3eb413
adjust how the logs get written
aramissennyeydd Apr 30, 2024
67598bf
support for configuring collator configuration
aramissennyeydd Apr 30, 2024
058eee7
move to shard being additional command
aramissennyeydd Apr 30, 2024
52f53ca
Apply suggestions from code review
aramissennyeydd May 1, 2024
e176bab
address pr comments
aramissennyeydd May 1, 2024
ba0924f
organize imports
aramissennyeydd May 1, 2024
9016dfc
move parent folder definition to static and use operationmetadatamana…
aramissennyeydd May 1, 2024
845a9b6
move operation settings to operation and standardize normalize log fi…
aramissennyeydd May 1, 2024
ee88bd5
replace all
aramissennyeydd May 1, 2024
4683793
remove heft specific updates
aramissennyeydd May 1, 2024
735c159
remove unnecessary change logs
aramissennyeydd May 1, 2024
817dc44
remove test project from the rest of rush
aramissennyeydd May 1, 2024
aea2ee7
revert typo fix
aramissennyeydd May 1, 2024
aea9238
fix lock file
aramissennyeydd May 2, 2024
354a872
fix test cases
aramissennyeydd May 2, 2024
8c49e12
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd May 10, 2024
f21108c
remove unnecessary phase
aramissennyeydd May 23, 2024
83b53ad
Apply suggestions from code review
aramissennyeydd May 23, 2024
42f63c2
address more PR feedback - create an initial pre-shard stage
aramissennyeydd May 23, 2024
64befae
adjust local dev setup and fix bug in operation creation
aramissennyeydd May 23, 2024
df66a93
remove reference to env vars
aramissennyeydd May 23, 2024
14a00eb
fix linting issues
aramissennyeydd May 23, 2024
791097f
add shards to readme
aramissennyeydd May 23, 2024
fd76a79
test with weights enabled as well
aramissennyeydd May 23, 2024
42d98fc
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd May 23, 2024
bb7a494
fix merge issue
aramissennyeydd May 23, 2024
a18b56b
remove console.log
aramissennyeydd May 23, 2024
11ffb2e
fixing output folder argument format
aramissennyeydd May 25, 2024
b2ddb4f
fix api report
aramissennyeydd May 25, 2024
291349b
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd May 25, 2024
f8f66be
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd May 25, 2024
48365b1
fix merge issue
aramissennyeydd May 25, 2024
3ff8688
fix test case
aramissennyeydd May 25, 2024
1cf78ff
Use a const.
iclanton May 25, 2024
a3f623f
fixes after local testing
aramissennyeydd May 25, 2024
37ddc9b
fix how we get the output folder
aramissennyeydd May 25, 2024
c1484a3
remove quote handling
aramissennyeydd May 25, 2024
d73fd00
Merge remote-tracking branch 'upstream/main' into jest-sharding
aramissennyeydd May 25, 2024
90caded
fix unit test
aramissennyeydd May 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ jspm_packages
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/
**/.rush
*.lock

# Heft temporary files
.cache
.heft


# Common toolchain intermediate files
temp
lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ cd sandbox/repo
node ../../lib/runRush.js update
```

#### Case 1: Normal build, Cobuild is disabled because of missing RUSH_COBUILD_CONTEXT_ID
You can also test sharded operations with cobuilds using the **build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo**
```sh
cd sandbox/sharded-repo
node ../../lib/runRush.js update
```
You should expect to see multiple shards for operations `a` (15 shards), `b` (75) and `h` (50) and `e` (75).

#### Case 1: Normal build, Cobuild is disabled because of missing RUSH_COBUILD_CONTEXT_ID

1. Write to build cache

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Rush temporary files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
projects/*/dist/
*.log
node_modules/
.rush
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"url": "redis://localhost:6379",
"passwordEnvironmentVariable": "REDIS_PASS"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* This configuration file manages Rush's build cache feature.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/build-cache.schema.json",

/**
* (Required) EXPERIMENTAL - Set this to true to enable the build cache feature.
*
* See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature.
*/
"buildCacheEnabled": true,

/**
* (Required) Choose where project build outputs will be cached.
*
* Possible values: "local-only", "azure-blob-storage", "amazon-s3"
*/
"cacheProvider": "local-only",

/**
* Setting this property overrides the cache entry ID. If this property is set, it must contain
* a [hash] token.
*
* Other available tokens:
* - [projectName]
* - [projectName:normalize]
* - [phaseName]
* - [phaseName:normalize]
* - [phaseName:trimPrefix]
*/
// "cacheEntryNamePattern": "[projectName:normalize]-[phaseName:normalize]-[hash]"

/**
* Use this configuration with "cacheProvider"="azure-blob-storage"
*/
"azureBlobStorageConfiguration": {
/**
* (Required) The name of the the Azure storage account to use for build cache.
*/
// "storageAccountName": "example",
/**
* (Required) The name of the container in the Azure storage account to use for build cache.
*/
// "storageContainerName": "my-container",
/**
* The Azure environment the storage account exists in. Defaults to AzurePublicCloud.
*
* Possible values: "AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment"
*/
// "azureEnvironment": "AzurePublicCloud",
/**
* An optional prefix for cache item blob names.
*/
// "blobPrefix": "my-prefix",
/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
},

/**
* Use this configuration with "cacheProvider"="amazon-s3"
*/
"amazonS3Configuration": {
/**
* (Required unless s3Endpoint is specified) The name of the bucket to use for build cache.
* Example: "my-bucket"
*/
// "s3Bucket": "my-bucket",
/**
* (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache.
* This should not include any path; use the s3Prefix to set the path.
* Examples: "my-bucket.s3.us-east-2.amazonaws.com" or "http://localhost:9000"
*/
// "s3Endpoint": "https://my-bucket.s3.us-east-2.amazonaws.com",
/**
* (Required) The Amazon S3 region of the bucket to use for build cache.
* Example: "us-east-1"
*/
// "s3Region": "us-east-1",
/**
* An optional prefix ("folder") for cache items. It should not start with "/".
*/
// "s3Prefix": "my-prefix",
/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* This configuration file manages Rush's cobuild feature.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/cobuild.schema.json",

/**
* (Required) EXPERIMENTAL - Set this to true to enable the cobuild feature.
* RUSH_COBUILD_CONTEXT_ID should always be specified as an environment variable with an non-empty string,
* otherwise the cobuild feature will be disabled.
*/
"cobuildFeatureEnabled": true,

/**
* (Required) Choose where cobuild lock will be acquired.
*
* The lock provider is registered by the rush plugins.
* For example, @rushstack/rush-redis-cobuild-plugin registers the "redis" lock provider.
*/
"cobuildLockProvider": "redis"
}