Skip to content

Commit 9d34c13

Browse files
authored
Merge pull request #119 from RLOpenCatalyst/topic-release
Newbuild 1.14.0 updates
2 parents 5310216 + d4e306d commit 9d34c13

11 files changed

Lines changed: 138 additions & 52 deletions

config/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@
200200
"endTime": "21:10:00"
201201
},
202202
"cronJobForEodSync" : "*/60 * * * *",
203+
"cronJobForSync" : "00 08 * * *",
204+
"cronJobForEodPIReport": "00 10 * * *",
203205
"sampleCSVForUser": "users.csv",
204206
"sampleCSVBucketRegion": "REPLACE_WITH_REGION",
205207
"sessionMaxAge" : 900000

config/mongo-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"db_ssl_enable": "REPLACE_WITH_TRUE_FALSE",
33
"db_auth_enable": "REPLACE_WITH_TRUE_FALSE",
4-
"db_documentdb_enable": "REPLACE_WITH_TRUE_FALSE",
4+
"db_documentdb_enable": "REPLACE_WITH_TRUE_FALSE",
55
"db_ssl_config": {
66
"CAFile": "rds-combined-ca-bundle.pem",
77
"PEMFile": "REPLACE_WITH_PEM_FILE_NAME"
88
},
99
"db_auth_config": {
1010
"username": "app",
1111
"password": "App123",
12+
"secretName": "REPLACE_WITH_secretarn",
1213
"authenticateDb":"admin"
1314
}
1415

config/settings-config.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@
8484
{
8585
"action": "Unshare",
8686
"imageUrl": "../../assets/images/unshare@2x.png"
87-
},
88-
{
89-
"action": "Upload",
90-
"imageUrl": "../../assets/images/cloud-computing@2x.png"
9187
}
9288
]
9389
},
@@ -793,7 +789,7 @@
793789
],
794790
"action": []
795791
},
796-
"external": {
792+
"internal": {
797793
"connect":[
798794
{
799795
"menu": "Explore",
@@ -804,7 +800,12 @@
804800
"imageUrl": "../../assets/images/link@2x.png"
805801
}
806802
],
807-
"action":[]
803+
"action":[
804+
{
805+
"action": "Edit",
806+
"imageUrl": "../../assets/images/editStudy.png"
807+
}
808+
]
808809
},
809810
"Personal": {
810811
"connect": [
@@ -880,7 +881,7 @@
880881
},
881882
{
882883
"key": "studyType",
883-
"value": "external"
884+
"value": "internal"
884885
},
885886
{
886887
"key": "studyType",

deploy.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ aws s3 cp "$localhome"/config.tar.gz s3://"$bucketname"
246246
rm -f config.tar.gz
247247

248248
echo "Copying script files to new bucket"
249+
sed -i "s/secret_name/RL-RG-$runid-$env/g" "$localhome"/scripts/connect-db.sh
249250
tar -czf scripts.tar.gz scripts/*
250251
tar -tf scripts.tar.gz
251252
aws s3 cp "$localhome"/scripts.tar.gz s3://"$bucketname"
@@ -337,10 +338,10 @@ function create_cognito_pool() {
337338
function create_doc_db() {
338339
echo "Creating new stack $1"
339340
aws cloudformation deploy --template-file "$localhome"/rg_document_db.yml --stack-name "$1" \
340-
--parameter-overrides MasterUser="$appuser" MasterPassword="$appuserpassword" \
341+
--parameter-overrides DocDBSecretName="RL-RG-$runid-$env" VpceSecurityGroupName="RGVE-SG-$runid" \
341342
DBClusterName="RGCluster-$runid" DBInstanceName="RGInstance-$runid" DBInstanceClass="db.t3.medium" \
342343
Subnet1="$subnet1id" Subnet2="$subnet2id" Subnet3="$subnet3id" VPC="$vpcid" \
343-
SecurityGroupName="RGDB-SG-$runid" DocDBSubnetGroupName="RGDBSubnet-$runid"
344+
SecurityGroupName="RGDB-SG-$runid" DocDBSubnetGroupName="RGDBSubnet-$runid" --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND
344345
echo "Waiting for stack $1 to finish deploying..."
345346
aws cloudformation wait stack-create-complete --stack-name "$1"
346347
}
@@ -355,6 +356,7 @@ function create_image_builder() {
355356

356357
}
357358

359+
358360
function create_main_stack() {
359361
echo "Creating new stack $1"
360362
#update the AMI id in the RGMainStack CFT
@@ -366,14 +368,14 @@ function create_main_stack() {
366368
echo "UserPool ClientId: $userpoolclient_id"
367369
echo "BucketName $bucketname"
368370
echo "RG URL: $rgurl"
369-
if [ -n "$appuserpassword" ]; then
371+
if [ -n "$secpassword" ]; then
370372
echo "UserPassword is not a blank string"
371373
fi
372374
if [ -n "$adminpassword" ]; then
373375
echo "AdminPassword is not a blank string"
374376
fi
375377
echo "VPC Id: $vpcid"
376-
echo "subnet1id: subnet1id"
378+
echo "subnet1id: $subnet1id"
377379
echo "Key Pair: $keypairname"
378380
echo "TGARN: $tgarn"
379381
echo "DocDBURL: $docdburl"
@@ -382,7 +384,7 @@ function create_main_stack() {
382384
aws cloudformation deploy --template-file "$localhome"/rg_main_stack.yml \
383385
--stack-name "$mainstackname" \
384386
--parameter-overrides CFTBucketName="$bucketname" RGUrl="$rgurl"\
385-
UserPassword="$appuserpassword" AdminPassword="$adminpassword" \
387+
UserPassword="$secpassword" AdminPassword="$adminpassword" \
386388
VPC="$vpcid" Subnet1="$subnet1id" KeyName1="$keypairname" TGARN="$tgarn" \
387389
DocumentDBInstanceURL="$docdburl" Environment="$env" BaseAccountPolicyName="RG-Portal-Base-Account-Policy-$env-$runid" \
388390
--capabilities CAPABILITY_NAMED_IAM
@@ -506,12 +508,14 @@ ac_name=$(aws sts get-caller-identity --query "Account" --output text)
506508
r53_domain_name="${rgurl//http[s]*:\/\//}"
507509
jqcmd='.HostedZones[] | select(.Name=='"\"${r53_domain_name}.\""')|.Id'
508510
hosted_zone=$(aws route53 list-hosted-zones-by-name --dns-name "$r53_domain_name" | jq -r "$jqcmd" | sed -e 's#\/hostedzone\/##')
511+
secretdb_arn=$(aws secretsmanager get-secret-value --secret-id RL-RG-$runid-$env | jq --raw-output .ARN)
509512
echo "Creating configs locally"
510513
export RG_ENV="$env"
511514
./makeconfigs.sh "$userpool_id" "$userpoolclient_id" "$bucketname" "$appuser" "$appuserpassword" \
512-
"$runid" "$rgurl" "$region" "ROLE_NAME" "$ac_name" "$hosted_zone"
515+
"$runid" "$rgurl" "$region" "ROLE_NAME" "$ac_name" "$hosted_zone" "$secretdb_arn"
513516
echo "Uploading configs to $bucketname"
514517
aws s3 cp "$localhome"/config.tar.gz s3://"$bucketname"
518+
secpassword=$(aws secretsmanager get-secret-value --secret-id RL-RG-$runid-$env --version-stage AWSCURRENT | jq --raw-output .SecretString| jq -r ."password")
515519
#===============================================================================================================
516520
#Creating Main stack
517521
echo "Deploying main stack (roles, ec2 instance etc.)"

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- sp2net
1919

2020
cc-3102:
21-
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.13.2_b1352
21+
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.14.0_b1444
2222
secrets:
2323
- source: sp2prod-config.json
2424
target: /rlc/cc/server/app/config/config.json
@@ -42,7 +42,7 @@ services:
4242
command: /bin/bash start.sh
4343

4444
scheduler-3102:
45-
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.13.2_b1352
45+
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.14.0_b1444
4646
secrets:
4747
- source: sp2prod-config.json
4848
target: /rlc/cc/server/app/config/config.json
@@ -62,7 +62,7 @@ services:
6262
command: node ./app/scheduler/app.js
6363

6464
notificationsink:
65-
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/notificationsink:1.13.2_b3
65+
image: 045938549113.dkr.ecr.us-east-2.amazonaws.com/notificationsink:1.14.0_b3
6666
secrets:
6767
- source: sp2prod-config.json
6868
target: /opt/app/config/config.json

dump/configs.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,8 @@
345345
"ownCatalogWithTagLink" : "https://researchgateway.readthedocs.io/en/latest/",
346346
"isProductDailyCostMigration_v1_13_0_Required" : true,
347347
"projectStorage" : "https://researchgateway.readthedocs.io/en/latest/GettingStarted.html#project-storage"
348-
}
348+
},
349+
"studySelectionCount" : 2
349350
},
350351
{
351352
"_id" : {
@@ -394,5 +395,18 @@
394395
"pipeline_git_url": "https://github.com/gatk-workflows/gatk4-basic-joint-genotyping.git"
395396
}
396397
]
397-
}
398+
},
399+
{
400+
"key" : "study",
401+
"message" : "This config help us to configure the external studies in the product launch form",
402+
"value" : {
403+
"productList" : [
404+
"ec2",
405+
"rstudio",
406+
"nextflow",
407+
"cromwell"
408+
]
409+
},
410+
"studySelectionCount" : 4
411+
}
398412
]

makeconfigs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version="0.1.0"
33
echo "Making configs locally...(makeconfigs.sh v$version)"
44
# Ensure right number of params
5-
if [ $# -lt 11 ]; then
5+
if [ $# -lt 12 ]; then
66
echo 'At least 11 parameters are required!'
77
echo ' Param 1: AWS Cognito User Pool id'
88
echo ' Param 2: AWS Cognito client id'
@@ -19,6 +19,7 @@ if [ $# -lt 11 ]; then
1919
echo ' same account to which Research Gateway is to be deployed'
2020
echo ' Param 11: Hosted Zone Id in Route53 to be used for enabling SSL'
2121
echo ' in projects'
22+
echo ' Param 12: AWS secret ARN'
2223
exit 1
2324
fi
2425

@@ -31,6 +32,7 @@ myrunid=$6
3132
myurl=$7
3233
region=$8
3334
role_name=$9
35+
secret_arn=${12}
3436
RG_HOME=$(mktemp -d -t "config.$myrunid.XXX")
3537
echo "RG_HOME=$RG_HOME"
3638
RG_SRC=$(pwd)
@@ -106,6 +108,7 @@ jq -r ".db_ssl_enable=true" "$mytemp/mongo-config.json" |
106108
jq -r ".db_documentdb_enable=true" |
107109
jq -r ".db_auth_config.username=\"$myappuser\"" |
108110
jq -r ".db_auth_config.password=\"$myapppwd\"" |
111+
jq -r ".db_auth_config.secretName=\"$secret_arn\"" |
109112
jq -r '.db_auth_config.authenticateDb="admin"' >"${RG_HOME}/config/mongo-config.json"
110113

111114
echo "Modifying notification-config.json"
@@ -122,6 +125,7 @@ jq -r ".db_ssl_enable=true" "$mytemp/mongo-config.json" |
122125
jq -r '.db_ssl_config.PEMFile="mongodb.pem"' |
123126
jq -r ".db_auth_config.username=\"$myappuser\"" |
124127
jq -r ".db_auth_config.password=\"$myapppwd\"" |
128+
jq -r ".db_auth_config.secretName=\"$secret_arn\"" |
125129
jq -r '.db_auth_config.authenticateDb="admin"' >"${RG_HOME}/config/mongo-config.json"
126130
tar -C "$RG_HOME" -czf config.tar.gz "config"/*
127131
tar -tf config.tar.gz

provisioners/provision-ecr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -xe
22
sudo docker login -u AWS -p $(aws ecr get-login-password --region us-east-2) 045938549113.dkr.ecr.us-east-2.amazonaws.com
3-
sudo docker pull 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.13.2_b1352
3+
sudo docker pull 045938549113.dkr.ecr.us-east-2.amazonaws.com/researchportal:_fd_1.14.0_b1444
44
sudo docker pull 045938549113.dkr.ecr.us-east-2.amazonaws.com/nginx:latest
5-
sudo docker pull 045938549113.dkr.ecr.us-east-2.amazonaws.com/notificationsink:1.13.2_b3
5+
sudo docker pull 045938549113.dkr.ecr.us-east-2.amazonaws.com/notificationsink:1.14.0_b3

0 commit comments

Comments
 (0)