Skip to content

Commit 343ef54

Browse files
committed
Add 2.0.0 files
Signed-off-by: Brian Presley <[email protected]>
1 parent 26979a7 commit 343ef54

File tree

11 files changed

+161
-26
lines changed

11 files changed

+161
-26
lines changed

AWSSolutionsArchitecture.png

235 KB
Loading

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,25 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
## [2.0.0] - 2024-09-30
8+
9+
### Added
10+
- Support for workloads up to 100TB with the new Reindex-from-Snapshot capability
11+
- Added Migration Console CLI to facilitate migrations
12+
- GovCloud support
13+
- Backfill Pause-and-Resume, with the ability to roll back a migration
14+
- Increased vertical performance on Replay
15+
- Metadata Migration Tool to migrate cluster settings and configurations
16+
- Load balancer configuration to facilitate zero-downtime migrations
17+
- Support for new migration paths, including 6.x, 7.x, and 1.x as source versions
18+
- Support for multi-hop migrations
19+
20+
### Removed
21+
- Fetch Backfill support
722

823
## [1.0.0] - 2023-11-17
924

1025
### Added
1126

1227
- All files, initial release
28+

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ information to effectively respond to your bug report or contribution.
1111

1212
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313

14-
When filing an issue, please check [existing open](https://github.com/opensearch-project/opensearch-migrations), or [recently closed](https://github.com/opensearch-project/opensearch-migrations/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
14+
When filing an issue, please check [existing open](https://github.com/opensearch-project/opensearch-migrations/issues), or [recently closed](https://github.com/opensearch-project/opensearch-migrations/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
1515
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616

1717
* A reproducible test case or series of steps

NOTICE.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ requests-aws4auth is under MIT License (MIT License)
5050
rsa under the Apache Software License (Apache-2.0)
5151
s3transfer under the Apache Software License (Apache License 2.0)
5252
xmltodict under the MIT License (MIT)
53+
coloredlogs under the MIT License (MIT)
54+
humanfriendly under the MIT License (MIT)
55+
prometheus_client under Apache Software License Apache 2.0

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ The solution facilitates user comparisons of source and target traffic in terms
5050

5151
Deploying this solution with the default parameters builds the following environment in the AWS Cloud.
5252

53-
<img width="818" alt="image" src="https://github.com/user-attachments/assets/1caf8f48-33eb-4b6a-b449-d2f8e3f539bb">
54-
53+
<img width="818" alt="image" src="AWSSolutionsArchitecture.png">
5554

5655
The high-level process flow for the solution components deployed with the AWS CloudFormation template is as follows:
5756

@@ -62,7 +61,6 @@ The high-level process flow for the solution components deployed with the AWS Cl
6261
5. Performance and behavior of traffic sent to source and target clusters are compared by reviewing logs and metrics.
6362
6. After confirming the target cluster’s functionality meets expectations the use redirects clients to new target.
6463

65-
6664
## Deployment
6765

6866
Please follow the [Implementation Guide](https://docs.aws.amazon.com/solutions/latest/migration-assistant-for-amazon-opensearch/) to deploy the solution in your AWS account.

deployment/run-unit-tests.sh

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,47 @@
44
[ "$DEBUG" == 'true' ] && set -x
55
set -e
66

7+
ECR_ACCOUNT="740797759474.dkr.ecr.us-west-2.amazonaws.com"
8+
ECR_REPO_URL="$ECR_ACCOUNT/opensearch-migrations/base-images"
9+
10+
# Check load-images-to-ecr.sh for loading needed images into ECR
11+
pull_from_ecr() {
12+
local docker_image_tag=$1
13+
local ecr_image_tag=$2
14+
15+
echo "Checking for local Docker image: $docker_image_tag"
16+
17+
# Check if the image exists locally
18+
if docker image inspect $docker_image_tag >/dev/null 2>&1; then
19+
echo "Docker image already exists locally."
20+
else
21+
echo "Attempting to pull Docker image from ECR: $docker_image_tag"
22+
23+
docker pull "$ECR_REPO_URL:$ecr_image_tag"
24+
docker tag "$ECR_REPO_URL:$ecr_image_tag" "$docker_image_tag"
25+
fi
26+
}
27+
28+
pull_docker_image() {
29+
local image_name=$1
30+
31+
echo "Checking for Docker image: $image_name"
32+
33+
# Check if the image exists locally
34+
if docker image inspect $image_name >/dev/null 2>&1; then
35+
echo "Docker image already exists locally."
36+
else
37+
echo "Attempting to pull Docker image: $image_name"
38+
39+
# Try to pull the Docker image
40+
if docker pull $image_name; then
41+
echo "Docker image pulled successfully."
42+
else
43+
echo "Failed to pull Docker image. Aborting unit tests."
44+
exit 1
45+
fi
46+
fi
47+
}
748

849
prepare_jest_coverage_report() {
950
local component_name=$1
@@ -31,33 +72,36 @@ run_python_tests() {
3172
echo "cd $component_path"
3273
cd "$component_path"
3374

34-
python3 -m venv .venv
35-
source .venv/bin/activate
36-
pip install -r requirements.txt
37-
pip install -r dev-requirements.txt
38-
python3 -m coverage run -m unittest
39-
python3 -m coverage xml --omit "*/tests/*"
75+
echo "python3 -m pip install --upgrade pipenv"
76+
python3 -m pip install --upgrade pipenv
77+
echo "pipenv install --deploy --dev"
78+
pipenv install --deploy --dev
79+
echo "pipenv run python -m coverage run -m pytest"
80+
pipenv run python -m coverage run -m pytest
81+
82+
echo "pipenv run python -m coverage xml --omit '*/tests/*'"
83+
pipenv run python -m coverage xml --omit "*/tests/*"
84+
4085
# The coverage module uses absolutes paths in its coverage output. To avoid dependencies of tools (such as SonarQube)
4186
# on different absolute paths for source directories, this substitution is used to convert each absolute source
4287
# directory path to the corresponding project relative path. The $source_dir holds the absolute path for source
4388
# directory.
4489
sed -i -e "s,<source>$source_dir,<source>source,g" coverage.xml
45-
deactivate
46-
rm -rf .venv
4790
}
4891

4992

5093
run_gradle_tests() {
5194
local component_path=$1
5295
local component_name=$2
96+
local gradle_arguments=$3
5397

5498
echo "------------------------------------------------------------------------------"
5599
echo "[Test] Run unit test with coverage for $component_name"
56100
echo "------------------------------------------------------------------------------"
57101
echo "cd $component_path"
58102
cd "$component_path"
59103

60-
./gradlew build copyDependencies jacocoTestReport
104+
./gradlew $gradle_arguments
61105
}
62106

63107
run_npm_tests() {
@@ -96,18 +140,50 @@ check_test_failure() {
96140
fi
97141
}
98142

143+
if aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin "$ECR_ACCOUNT" && pull_from_ecr "amazonlinux:2023" "amazonlinux-2023"; then
144+
echo "Successful accessed ECR account $ECR_ACCOUNT and pulled amazonlinux-2023, pulling remaining base images from here..."
145+
pull_from_ecr "opensearchproject/opensearch:1.3.16" "opensearch-1.3.16"
146+
pull_from_ecr "opensearchproject/opensearch:2.14.0" "opensearch-2.14.0"
147+
pull_from_ecr "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2" "elasticsearch-oss-7.10.2"
148+
pull_from_ecr "docker.elastic.co/elasticsearch/elasticsearch:7.17.22" "elasticsearch-7.17.22"
149+
pull_from_ecr "docker.elastic.co/elasticsearch/elasticsearch:6.8.23" "elasticsearch-6.8.23"
150+
pull_from_ecr "httpd:alpine" "httpd-alpine"
151+
pull_from_ecr "alpine:3.16" "alpine-3.16"
152+
pull_from_ecr "confluentinc/cp-kafka:7.5.0" "cp-kafka-7.5.0"
153+
pull_from_ecr "ghcr.io/shopify/toxiproxy:latest" "toxiproxy-latest"
154+
else
155+
echo "Failed to access $ECR_ACCOUNT or pull image from this ECR, will not pull base images from this ECR"
156+
# com.rfs.framework.SearchClusterContainer Images
157+
pull_docker_image "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2"
158+
pull_docker_image "docker.elastic.co/elasticsearch/elasticsearch:7.17.22"
159+
pull_docker_image "docker.elastic.co/elasticsearch/elasticsearch:6.8.23"
160+
pull_docker_image "opensearchproject/opensearch:1.3.16"
161+
pull_docker_image "opensearchproject/opensearch:2.14.0"
162+
# org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.HttpdContainerTestBase
163+
pull_docker_image "httpd:alpine"
164+
pull_docker_image "alpine:3.16"
165+
# org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.KafkaContainerTestBase
166+
pull_docker_image "confluentinc/cp-kafka:7.5.0"
167+
# org.opensearch.migrations.trafficcapture.proxyserver.testcontainers.ToxiproxyContainerTestBase
168+
pull_docker_image "ghcr.io/shopify/toxiproxy:latest"
169+
# TrafficCapture/dockerSolution/src/main/docker/elasticsearchTestConsole/Dockerfile
170+
pull_docker_image "amazonlinux:2023"
171+
fi
172+
173+
echo "Images pulled successfully. Continuing to unit tests."
174+
99175
# Run unit tests
100176
echo "Running unit tests"
101177

102178
# Get reference for source folder
103179
source_dir="$(cd $PWD/../source; pwd -P)"
104180
coverage_reports_top_path=$source_dir/test/coverage-reports
105181

106-
run_gradle_tests "$source_dir/opensearch-migrations/TrafficCapture" "TrafficCapture"
107-
check_test_failure "TrafficCapture"
182+
run_gradle_tests "$source_dir/opensearch-migrations" "opensearch-migrations" "build copyDependencies mergeJacocoReports -x spotlessCheck"
183+
check_test_failure "opensearch-migrations"
108184

109-
run_python_tests "$source_dir/opensearch-migrations/FetchMigration/python" "FetchMigration"
110-
check_test_failure "FetchMigration"
185+
run_python_tests "$source_dir/opensearch-migrations/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link" "ConsoleLibrary"
186+
check_test_failure "ConsoleLibrary"
111187

112188
# Test packages from /source directory
113189
declare -a packages=(

source/solutions-infrastructure/bin/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const getProps = (): SolutionsInfrastructureStackProps => {
2828

2929
// Uncomment for local testing
3030
// const codeBucket = 'unknown';
31-
// const solutionVersion = "1.0.0";
31+
// const solutionVersion = "2.0.0";
3232
// const solutionId = 'SO0290';
3333
// const solutionName = 'migration-assistant-for-amazon-opensearch';
3434
// const description = `(${solutionId}) - The AWS CloudFormation template for deployment of the ${solutionName}. Version ${solutionVersion}`;
@@ -49,4 +49,4 @@ new SolutionsInfrastructureStack(app, 'OSMigrations-Bootstrap', {
4949
generateBootstrapVersionRule: false
5050
}),
5151
...infraProps
52-
});
52+
});

source/solutions-infrastructure/initBootstrap.sh

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,53 @@
11
#!/bin/bash
22

3+
usage() {
4+
echo "Usage: $0 [--tag <tag_name>] [--branch <branch_name>]"
5+
exit 1
6+
}
7+
8+
tag=""
9+
branch=""
10+
11+
# Parse options
12+
while [[ "$#" -gt 0 ]]; do
13+
case $1 in
14+
--tag)
15+
if [ -n "$branch" ]; then
16+
echo "Error: You cannot specify both --tag and --branch."
17+
usage
18+
fi
19+
tag="$2"
20+
shift
21+
;;
22+
--branch)
23+
if [ -n "$tag" ]; then
24+
echo "Error: You cannot specify both --tag and --branch."
25+
usage
26+
fi
27+
branch="$2"
28+
shift
29+
;;
30+
*)
31+
echo "Unknown parameter passed: $1"
32+
usage
33+
;;
34+
esac
35+
shift
36+
done
37+
338
yum update && yum install -y git java-11-amazon-corretto-devel docker nodejs https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm
439
systemctl start docker
540
git init
6-
release_tag=$(curl -s https://api.github.com/repos/opensearch-project/opensearch-migrations/releases/latest | jq -r ".tag_name")
7-
git remote add -f origin https://github.com/opensearch-project/opensearch-migrations.git
8-
git checkout tags/$release_tag
41+
git remote | grep "origin" || git remote add -f origin https://github.com/opensearch-project/opensearch-migrations.git
42+
43+
if [ -n "$branch" ]; then
44+
git checkout $branch
45+
elif [ -n "$tag" ]; then
46+
git checkout tags/$tag
47+
else
48+
latest_release_tag=$(curl -s https://api.github.com/repos/opensearch-project/opensearch-migrations/releases/latest | jq -r ".tag_name")
49+
git checkout tags/$latest_release_tag
50+
fi
951

1052
cd deployment/cdk/opensearch-service-migration || exit
1153
npm install -g aws-cdk

source/solutions-infrastructure/lib/solutions-infrastructure-stack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class SolutionsInfrastructureStack extends Stack {
148148
})
149149
const solutionsUserAgent = `AwsSolution/${props.solutionId}/${props.solutionVersion}`
150150
const cfnInitConfig : InitElement[] = [
151-
InitCommand.shellCommand(`echo "export MIGRATIONS_APP_REGISTRY_ARN=${appRegistryAppARN}; export CUSTOM_REPLAYER_USER_AGENT=${solutionsUserAgent}" > /etc/profile.d/solutionsEnv.sh`),
151+
InitCommand.shellCommand(`echo "export MIGRATIONS_APP_REGISTRY_ARN=${appRegistryAppARN}; export MIGRATIONS_USER_AGENT=${solutionsUserAgent}" > /etc/profile.d/solutionsEnv.sh`),
152152
bootstrapFile
153153
]
154154

@@ -166,7 +166,7 @@ export class SolutionsInfrastructureStack extends Stack {
166166
new Instance(this, 'BootstrapEC2Instance', {
167167
vpc: vpc,
168168
instanceName: `bootstrap-${stageParameter.valueAsString}-instance`,
169-
instanceType: InstanceType.of(InstanceClass.T2, InstanceSize.LARGE),
169+
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.LARGE),
170170
machineImage: MachineImage.latestAmazonLinux2023(),
171171
role: bootstrapRole,
172172
blockDevices: [

source/solutions-infrastructure/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
"@aws-cdk/aws-servicecatalogappregistry-alpha": "2.105.0-alpha.0",
3131
"source-map-support": "^0.5.21"
3232
}
33-
}
33+
}

0 commit comments

Comments
 (0)