This document describes the necessary tools and steps needed for the installation of JChem Choral in AWS RDS and Fargate environment.
Oracle RDS with Admin password
AWS rights
Local or EC2 Instance (AppServer) with
AWS CLI
Docker
Terraform
SQL Client, e.g. SQLDeveloper
AppServer connection to Oracle RDS
Familiarity with
An RDS database running with a user that the Choral service can use to create its backend data. In this docs this user will be referred to as <RDS user> and <RDS password>.
Fargate service CPU and memory capacity is limited, you can check if the suggested values do not exceed Fargate’s capacity. If memory seems insufficient, you can uncheck caching options to lower memory requirements. If it still exceeds Fargate’s capacity then our recommendation would be to run Choral service in an EC2 instance as it is described in this documentation.
The installation is twofold, we fake the application service for initialization using a local or EC2 instance. We create the application service in Fargate which will serve the database and replace the local fake application service with this one.
During the installation we make the following steps:
The first (partial) installation of Choral will be executed here. RDS is set as database and a local machine or an EC2 instance is applied for the application service.
RDS instance is accessed by the local machine or by the EC2 instance.
Use SQLdeveloper.
The application service is initialized by the without SQL script execution (8b) method.
Have Oracle RDS in place
Create indexuser with indexuserpassword
CREATE USER <RDS_USER> IDENTIFIED BY <RDS_PASSWORD>;
GRANT connect, resource to <RDS_USER>;
GRANT unlimited tablespace to <RDS_USER>;
Example:
CREATE USER indexuser IDENTIFIED BY indexuserpassword;
GRANT connect, resource to indexuser;
GRANT unlimited tablespace to indexuser;
Local or EC2 (AppServer) installation of the service
Connection to RDS is OK (tunnel)
configure config/choral.conf in order to store index in Oracle by adding the following lines:
# write back to oracle
com.chemaxon.jchem.psql.scheme=gcrdb
com.chemaxon.jchem.psql.gcrdb.isSingleTable=true
com.chemaxon.jchem.psql.gcrdb.singleTableName=engine_data
com.chemaxon.jchem.psql.gcrdb.sqlBuilderProvider=ORACLE
com.chemaxon.jchem.psql.gcrdb.jdbcUrl=jdbc:oracle:thin:@localhost:1521/<SID>
com.chemaxon.jchem.psql.gcrdb.user=<RDS_USER>
com.chemaxon.jchem.psql.gcrdb.password=<RDS_PASSWORD>
choral.init.oracleUrl=jdbc:oracle:thin:@localhost:1521:<SID>
choral.init.grantingUser=ADMIN
Memory settings
License file, see step 5
Molecule type, see step 7
Initialize server without SQL script execution
./init-choral-service
This step serves for the docker image creation, and uploading it to ECR, then finally starting a choral ECS using the image.
Download the required files
Setup terraform.tfvars
Add parameters to SSM Parameter Store
Create Docker image and upload to ECR
terraform init
terraform plan
terraform apply
terraform apply -lock=false
Setup AWS environment and choral ECS
terraform init
terraform plan
terraform apply
During this step SQL scripts for finishing the Choral configuration must be executed.
RDS is tunneled.
Use SQLdeveloper. The SQL scripts to be run are available in <choral_home>/sql/ folder.
Find the name of the router (Route 53 -> Hosted Zones -> Records) that handles the Fargate cluster (you can also find information about which target group the Fargate service was registered to in the Fargate service’s Deployment > Events tab), this will be referred to as Fargate_Route_name
Modify 2_http.sql
host => 'Fargate_Route_name',
Example:
host => 'choral-fargate-internal.jcb.cxcloud.io',
Execute as Admin user in RDS (scripts work on SQLDeveloper but not in SquirrelSQL or DBeaver)
or
Modify 5_indextype.sql
call set_choral_setting('HOST','Fargate_Route_name')
Example:
call set_choral_setting('HOST','choral-fargate-internal.jcb.cxcloud.io')
Execute as CHORAL_OWNER user in RDS (scripts work on SQLDeveloper but not in SquirrelSQL or DBeaver)
or
3_choral_settings.sql
4_logger.sql
5_indextype.sql
6_choral_idxstat.sql
7_choral_assoc_stats.sql
Test the installation by running 8_smoke_test.sql as CHORAL_OWNER.