This package is used to reset the name-service's test-environment to match the latest production-environment DB snapshot.
Bash instruction below assume this directory (test-system) as starting-point working directory.
- AWS (IAM) credentials set in users environment/shell
- (IAM) User login credentials to the AWS web console
- Appropriate AWS IAM permissions granted to AWS IAM user (ask an admin)
A clone of the production Elastic Beanstalk environment exists with the name: wormbase-names-test
.
To use this wormbase.names.test-system
package, build the jar from source
or download the latest release from s3://wormbase/names/test-system/wb-names-test-system.jar
.
Note:
Before resetting the test system, communicate this will be done to the wider group.
Upon performing a reset, all current test-system data will be destroyed!
- Set the
AWS_PROFILE
andAWS_DEFAULT_REGION
environment variables in your shell (example below for bash):
export AWS_PROFILE="<your-local-wormbase-aws-profile-name-here>"
export AWS_DEFAULT_REGION="us-east-1"
- Use a
screen
ortmux
session to run the following command:
java -cp wb-names-test-system.jar clojure.main -m wormbase.names.test-system reset
Further options (advanced usage, not needed for normal operations)
can be printed by using the --help
argument like so:
java -cp wb-names-test-system.jar clojure.main -m wormbase.names.test-system --help
Running the reset command will take approximately half an hour.
This command will perform the following operations in the WormBase AWS account:
-
Restore a backup of the production DynamoDB table for the names service to a new DynamoDB table. Runtime: ~15 mins
-
Create and execute a CloudFormation changeset for the test-environment transactors stack (
WBNamesTestTransactor
), to set the appropriate parameters (point to the correct (new) DynamoDB table). Runtime: ~10mins -
Update Elastic Beanstalk
wormbase-names-test
configuration (restarts web app servers) to point to the new DynamoDB tables (datomic storage). Runtime: ~5mins -
Once the new test-system is in place, DynamoDB tables from the previous test-system will be deleted.
In the event of interrupting the program (e.g with Ctrl-C
or kill
),
the state of the test system will need to be assessed and restored to a given state.
To do this, an AWS administrator must log into the AWS console and inspect the state for each AWS service separately.
The defaults of the program as described in the --help
report (see above) should provide
the administrator with the details required.
To reset to a state such that the reset command can work:
- Delete the
WBNamesTestTransactor
cloud formation stack - Terminate the Elastic Beanstalk environment
wormbase-names-test
. - Delete any DynamoDB table with the prefix
WSNames-test
. Be careful not to deleteWSNames
(production env table)! - Clone the production Elastic Beanstalk environment:
wormbase-names
to create a new EB test environment (wormbase-names-test
). - Create a new CloudFormation transactor stack named
WBNamesTestTransactor
The names of DynamoDB, Cloudformation and Elastic Beanstalk resources above can be changed,
but it is recommended to keep the defaults (as described in the --help
report as described above).
Terminating an Elastic Beanstalk environment results in its name not being available for up to 2 hours.
If you should wish to proceed with a new Elastic Beanstalk environment name (e.g wormbase-names-test2
),
then you will need to update the DNS mapping associated with https://test-names.wormbase.org in AWS Route53:
* Go to the console > hosted zones.
* Click wormbase.org
, on the next page search for names
in the Records filter (search) box.
* Edit the recordset to link test-names.wormbase.org to the new Elastic Beanstalk environment URL
(e.g: wormbase-names-test2.us-east1.elasticbeanstalk.com
) and save the changes.
make target/wb-names-test-system.jar
Ensure you have your WormBase AWS credentials set in your environment.
Edit the top-level of this package in pom.xml
, then
run:
make clean target/wb-names-test-system.jar deploy