Skip to content

Commit 4ad4037

Browse files
committed
Merge branch 'main' into topic-release
2 parents 334fe7c + 981bc06 commit 4ad4037

7 files changed

Lines changed: 97 additions & 15 deletions

File tree

packer-rg.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
"source": "config",
8181
"destination": "{{user `RG_SRC`}}/config"
8282
},
83+
{
84+
"type": "shell",
85+
"inline": [
86+
"sudo apt install zip -y"
87+
]
88+
},
8389
{
8490
"type": "shell",
8591
"environment_vars": ["RG_HOME=/opt/deploy/sp2","RG_SRC=/home/ubuntu"],

products/RStudio/machine-images/config/infra/provisioners/provision-rstudio.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sudo yum update -y
55
sudo yum install -y gcc-7.3.* gcc-gfortran-7.3.* gcc-c++-7.3.*
66
sudo yum install -y java-1.8.0-openjdk-devel-1.8.0.*
77
sudo yum install -y readline-devel-6.2 zlib-devel-1.2.* bzip2-devel-1.0.* xz-devel-5.2.* pcre-devel-8.32
8-
sudo yum install -y libcurl-devel-7.76.1 libpng-devel-1.5.* cairo-devel-1.15.* pango-devel-1.42.*
8+
sudo yum install -y libcurl-devel-7.79.* libpng-devel-1.5.* cairo-devel-1.15.* pango-devel-1.42.*
99
sudo yum install -y xorg-x11-server-devel-1.20.* libX11-devel-1.6.* libXt-devel-1.1.*
1010

1111
# Install R from source (https://docs.rstudio.com/resources/install-r-source/)

products/img-builder-config.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[
2-
{
3-
"product": "Nextflow Advanced",
4-
"pipeline": "RL_RG_Nextflow_Advanced",
5-
"path": "/RL/RG/StandardCatalog/nextflow-latest"
6-
},
7-
{
8-
"product": "RStudio",
9-
"pipeline": "RL_RG_RStudio",
10-
"path": "/RL/RG/StandardCatalog/RStudio"
11-
}
2+
{
3+
"product": "Nextflow Advanced",
4+
"pipeline": "RL_RG_Nextflow_Advanced",
5+
"path": "/RL/RG/StandardCatalog/nextflow-latest"
6+
},
7+
{
8+
"product": "RStudio",
9+
"pipeline": "RL_RG_RStudio",
10+
"path": "/RL/RG/StandardCatalog/RStudio"
11+
}
1212
]

products/make-ami-list-json.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
jq -r '.Products | map( (.ami_id_list |= ( map_values(to_entries ) | flatten)) )'
3+
jq -r '.Products | map( (.ami_id_list |= ( map_values(to_entries ) | flatten)) )'

scripts/fixdocdb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ echo "Downloading new dump file..."
7070
# fi
7171
aws s3 cp s3://${S3_SOURCE}/dump.zip "$RG_SRC"
7272
echo "Extracting seed data from dump file."
73-
unzip "$RG_SRC/dump.zip" -d "$RG_SRC"
73+
unzip "$RG_SRC/dump.zip" -o -d "$RG_SRC"
7474
if [ ! "$(ls -A $RG_SRC/dump)" ]; then
7575
echo "Error: No files found in dump folder. Your database cannot be seeded."
7676
else

scripts/import-seed-db.sh

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
version="0.1.0"
3+
echo "Connecting to DB....(connect-db.sh v$version)"
4+
5+
if [ "$1" == "-h" ]; then
6+
echo "Usage: $(basename $0)"
7+
exit 0
8+
fi
9+
if [ $# -gt 0 ]; then
10+
mydbname=$1
11+
fi
12+
13+
if [ $# -gt 1 ]; then
14+
mycollection=$2
15+
fi
16+
[ -z "$RG_HOME" ] && RG_HOME='/opt/deploy/sp2'
17+
echo "RG_HOME=$RG_HOME"
18+
[ -z "$RG_SRC" ] && RG_SRC='/home/ubuntu'
19+
echo "RG_SRC=$RG_SRC"
20+
myinput=$(cat "$RG_HOME/config/mongo-config.json")
21+
if [ -z "$myinput" ]; then
22+
echo "Could not find DB details file. Exiting"
23+
exit 1
24+
fi
25+
26+
mydbuser=$(jq -r '.db_auth_config.username' <<<"${myinput}")
27+
mydbuserpwd=$(jq -r '.db_auth_config.password' <<<"${myinput}")
28+
29+
if [ -z "$mydbuser" ] || [ -z "$mydbuserpwd" ]; then
30+
echo "Could not find DB details. Exiting"
31+
exit 1
32+
fi
33+
34+
if [ ! -f "$RG_HOME/docker-compose.yml" ]; then
35+
echo "docker-compose.yml does not exist. Exiting"
36+
exit 1
37+
fi
38+
mydocdburl=$(grep DB_HOST "$RG_HOME/docker-compose.yml" | head -1 | sed -e "s/.*DB_HOST=//")
39+
if [ -z "$mydocdburl" ]; then
40+
echo "Could not find DB URL. Exiting"
41+
exit 1
42+
fi
43+
if [ "$mycollection" == "ALL" ]; then
44+
echo "Importing all 3 collections into $mydocdburl"
45+
mongoimport --host "$mydocdburl:27017" --ssl \
46+
--sslCAFile "$RG_HOME/config/rds-combined-ca-bundle.pem" \
47+
--username "$mydbuser" --password "$mydbuserpwd" \
48+
--db "${mydbname}" --collection=studies \
49+
"$RG_SRC/dump/studies.json"
50+
mongoimport --host "$mydocdburl:27017" --ssl \
51+
--sslCAFile "$RG_HOME/config/rds-combined-ca-bundle.pem" \
52+
--username "$mydbuser" --password "$mydbuserpwd" \
53+
--db "${mydbname}" --collection=standardcatalogitems\
54+
"$RG_SRC/dump/standardcatalogitems.json"
55+
mongoimport --host "$mydocdburl:27017" --ssl \
56+
--sslCAFile "$RG_HOME/config/rds-combined-ca-bundle.pem" \
57+
--username "$mydbuser" --password "$mydbuserpwd" \
58+
--db "${mydbname}" --collection=configs\
59+
"$RG_SRC/dump/configs.json"
60+
else
61+
# trunk-ignore(shellcheck/SC2060)
62+
mycollection=$(echo "$mycollection" | tr [:upper:] [:lower:])
63+
if [ "$mycollection" != "studies" ] && [ "$mycollection" != "standardcatalogitems" ] && [ "$mycollection" != "configs" ]; then
64+
echo "Unknown collection $mycollection" && exit 1
65+
fi
66+
mongoimport --host "$mydocdburl:27017" --ssl \
67+
--sslCAFile "$RG_HOME/config/rds-combined-ca-bundle.pem" \
68+
--username "$mydbuser" --password "$mydbuserpwd" \
69+
--db "${mydbname}" --collection=$mycollection \
70+
"$RG_SRC/dump/$mycollection.json"
71+
fi

updatescripts.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Download the latest scripts
3-
version='0.1.3'
3+
version='0.1.4'
44
echo "updatescripts.sh version: $version"
55
[ -z "$RG_HOME" ] && RG_HOME='/opt/deploy/sp2'
66
echo "RG_HOME=$RG_HOME"
@@ -64,6 +64,11 @@ if [ ! -f /usr/local/sbin/updatessmpaths.sh ] || [ $RG_SRC/scripts/updatessmpath
6464
echo "Found newer version of updatessmpaths.sh. Updating"
6565
cp $RG_SRC/scripts/updatessmpaths.sh /usr/local/sbin/
6666
fi
67-
grep -i 'version=' /usr/local/sbin/fix*.sh /usr/local/sbin/start_server.sh
67+
if [ ! -f /usr/local/sbin/import-seed-db.sh ] || [ $RG_SRC/scripts/import-seed-db.sh -nt /usr/local/sbin/import-seed-db.sh ]; then
68+
echo "Found newer version of import-seed-db.sh. Updating"
69+
cp $RG_SRC/scripts/import-seed-db.sh /usr/local/sbin/
70+
fi
71+
72+
grep -i 'version=' /usr/local/sbin/fix*.sh /usr/local/sbin/start_server.sh /usr/local/sbin/import-seed-db.sh /usr/local/sbin/updatessmpaths.sh
6873
rm -rf $RG_SRC/scripts
6974
echo "Done updating scripts"

0 commit comments

Comments
 (0)