From d024e9c11cebf683744c27c4d4f2576ef4a146a9 Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:11:35 -0700 Subject: [PATCH 1/6] update community installer to v 25.7.7 --- sample_embedded_envs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sample_embedded_envs.sh b/sample_embedded_envs.sh index ec40954..301cad6 100755 --- a/sample_embedded_envs.sh +++ b/sample_embedded_envs.sh @@ -12,7 +12,7 @@ export LABKEY_BASE_SERVER_URL="https://localhost" #export LABKEY_INSTALL_SKIP_START_LABKEY_STEP=1 export POSTGRES_SVR_LOCAL="TRUE" -export LABKEY_DIST_URL="https://lk-binaries.s3.us-west-2.amazonaws.com/downloads/release/community/25.3.2/LabKey25.3.2-3-community.tar.gz" -export LABKEY_DIST_FILENAME="LabKey25.3.2-3-community.tar.gz" -export LABKEY_VERSION="25.3.2" +export LABKEY_DIST_URL="https://lk-binaries.s3.us-west-2.amazonaws.com/downloads/release/community/25.7.7/LabKey25.7.7-8-community.tar.gz" +export LABKEY_DIST_FILENAME="LabKey25.7.7-8-community.tar.gz" +export LABKEY_VERSION="25.7.7" export LABKEY_DISTRIBUTION="community" From cc01e25b85e8126075329f0033fd798381ecdaca Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:12:28 -0700 Subject: [PATCH 2/6] update adoptium installer for Amzn Linux 2023 --- install-labkey.bash | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/install-labkey.bash b/install-labkey.bash index 968e73d..6080bde 100755 --- a/install-labkey.bash +++ b/install-labkey.bash @@ -317,11 +317,12 @@ function step_os_prereqs() { case "_$(platform)" in _amzn) # amzn stuff goes here - # Add adoptium repo - if [ ! -f "/etc/yum.repos.d/adoptium.repo" ]; then - NewFile="/etc/yum.repos.d/adoptium.repo" - ( - /bin/cat <<-AMZN_JDK_HERE + # For versions of Amazon Linux prior to 2023 - Add adoptium repo + if [ "$(platform_version)" != "2023" ]; then + if [ ! -f "/etc/yum.repos.d/adoptium.repo" ]; then + NewFile="/etc/yum.repos.d/adoptium.repo" + ( + /bin/cat <<-AMZN_JDK_HERE [Adoptium] name=Adoptium baseurl=https://packages.adoptium.net/artifactory/rpm/amazonlinux/\$releasever/\$basearch @@ -329,10 +330,28 @@ function step_os_prereqs() { gpgcheck=1 gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public AMZN_JDK_HERE - ) >"$NewFile" + ) >"$NewFile" + fi + sudo yum update -y + sudo yum install -y "$ADOPTOPENJDK_VERSION" + else + # Add adoptium repo for Amazon Linux 2023 + if [ ! -f "/etc/yum.repos.d/adoptium.repo" ]; then + NewFile="/etc/yum.repos.d/adoptium.repo" + ( + /bin/cat <<-AMZN_JDK_HERE + [Adoptium] + name=Adoptium + baseurl=https://packages.adoptium.net/artifactoryfedora/36/\$basearch + enabled=1 + gpgcheck=1 + gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public + AMZN_JDK_HERE + ) >"$NewFile" + fi + sudo dnf update -y + sudo dnf install -y "$ADOPTOPENJDK_VERSION" fi - sudo yum update -y - sudo yum install -y "$ADOPTOPENJDK_VERSION" ;; _almalinux) From 448699e0954dc53f6dac75e6387b94494a520d85 Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:35:13 -0700 Subject: [PATCH 3/6] fix2 for adoptium and first attempt postgres for AL2023 --- install-labkey.bash | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/install-labkey.bash b/install-labkey.bash index 6080bde..59be7fc 100755 --- a/install-labkey.bash +++ b/install-labkey.bash @@ -335,14 +335,17 @@ function step_os_prereqs() { sudo yum update -y sudo yum install -y "$ADOPTOPENJDK_VERSION" else - # Add adoptium repo for Amazon Linux 2023 + # Add adoptium repo for Amazon Linux 2023 (AL2023 is fedora based) + DISTRIBUTION_NAME="fedora" + MAJOR_VERSION="42" + ARCH="$(uname -m)" if [ ! -f "/etc/yum.repos.d/adoptium.repo" ]; then NewFile="/etc/yum.repos.d/adoptium.repo" ( /bin/cat <<-AMZN_JDK_HERE [Adoptium] name=Adoptium - baseurl=https://packages.adoptium.net/artifactoryfedora/36/\$basearch + baseurl=https://packages.adoptium.net/artifactory/rpm/${DISTRIBUTION_NAME}/${MAJOR_VERSION}/${ARCH} enabled=1 gpgcheck=1 gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public @@ -350,6 +353,7 @@ function step_os_prereqs() { ) >"$NewFile" fi sudo dnf update -y + sudo dnf upgrade --security --assumeyes --releasever=latest sudo dnf install -y "$ADOPTOPENJDK_VERSION" fi ;; @@ -728,7 +732,14 @@ function step_postgres_configure() { sudo yum install tomcat-native.x86_64 apr fontconfig -y if [ ! -f "/var/lib/pgsql/data/$DEFAULT_POSTGRES_VERSION" ]; then - "/usr/pgsql-$DEFAULT_POSTGRES_VERSION/bin/postgresql-$DEFAULT_POSTGRES_VERSION-setup" initdb "postgresql-$DEFAULT_POSTGRES_VERSION" + # Handle differing paths between Amazon Linux 2 and Amazon Linux 2023 + if [ -f "/usr/pgsql-$DEFAULT_POSTGRES_VERSION/bin/postgresql-$DEFAULT_POSTGRES_VERSION-setup" ]; then + "/usr/pgsql-$DEFAULT_POSTGRES_VERSION/bin/postgresql-$DEFAULT_POSTGRES_VERSION-setup" initdb "postgresql-$DEFAULT_POSTGRES_VERSION" + elif [ -f "/usr/bin/postgresql-setup" ]; then + "/usr/bin/postgresql-setup" initdb "postgresql-$DEFAULT_POSTGRES_VERSION" + else + console_msg "Error: Unable to find Postgres Setup! ..." + fi fi sudo systemctl enable "postgresql-$DEFAULT_POSTGRES_VERSION" sudo systemctl start "postgresql-$DEFAULT_POSTGRES_VERSION" From 3ee26ae932c4af26031bcb53b553be5a01e5f9af Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Thu, 18 Sep 2025 16:58:46 -0700 Subject: [PATCH 4/6] Add installation support for Amazon Linux 2023 --- install-labkey.bash | 106 +++++++++++++++++++++++++--------------- sample_embedded_envs.sh | 2 + 2 files changed, 68 insertions(+), 40 deletions(-) diff --git a/install-labkey.bash b/install-labkey.bash index 59be7fc..35867f8 100755 --- a/install-labkey.bash +++ b/install-labkey.bash @@ -354,7 +354,7 @@ function step_os_prereqs() { fi sudo dnf update -y sudo dnf upgrade --security --assumeyes --releasever=latest - sudo dnf install -y "$ADOPTOPENJDK_VERSION" + sudo dnf install -y "$ADOPTOPENJDK_VERSION" tomcat-native.x86_64 apr fontconfig fi ;; @@ -702,18 +702,19 @@ function step_postgres_configure() { case "_$(platform)" in _amzn) - # Install the Postgresql repository RPM - # note this method is required for AMZN linux and supports PG versions 12-15 - v16 not supported by PG repo - if [[ -z $POSTGRES_VERSION ]]; then - DEFAULT_POSTGRES_VERSION="15" - else - DEFAULT_POSTGRES_VERSION=$POSTGRES_VERSION - fi + if [ "$(platform_version)" != "2023" ]; then + # Install the Postgresql repository RPM + # note this method is required for AMZN linux and supports PG versions 12-15 - v16 not supported by PG repo + if [[ -z $POSTGRES_VERSION ]]; then + DEFAULT_POSTGRES_VERSION="15" + else + DEFAULT_POSTGRES_VERSION=$POSTGRES_VERSION + fi - if [ ! -f "/etc/yum.repos.d/pgdg.repo" ]; then - NewPGRepoFile="/etc/yum.repos.d/pgdg.repo" - ( - /bin/cat <<-PG_REPO_HERE + if [ ! -f "/etc/yum.repos.d/pgdg.repo" ]; then + NewPGRepoFile="/etc/yum.repos.d/pgdg.repo" + ( + /bin/cat <<-PG_REPO_HERE [pgdg$DEFAULT_POSTGRES_VERSION] name=PostgreSQL $DEFAULT_POSTGRES_VERSION for RHEL/CentOS 7 - x86_64 baseurl=https://download.postgresql.org/pub/repos/yum/$DEFAULT_POSTGRES_VERSION/redhat/rhel-7-x86_64 @@ -721,40 +722,65 @@ function step_postgres_configure() { gpgcheck=0 PG_REPO_HERE - ) >"$NewPGRepoFile" - fi + ) >"$NewPGRepoFile" + fi - if [ "$POSTGRES_SVR_LOCAL" == "TRUE" ]; then - sudo yum clean metadata - sudo yum update -y - sudo yum install "postgresql$DEFAULT_POSTGRES_VERSION-server" -y - # TODO: These are pre-reqs for Amazon Linux - Move to the pre-reqs function - sudo yum install tomcat-native.x86_64 apr fontconfig -y + if [ "$POSTGRES_SVR_LOCAL" == "TRUE" ]; then + sudo yum clean metadata + sudo yum update -y + sudo yum install "postgresql$DEFAULT_POSTGRES_VERSION-server" -y + # TODO: These are pre-reqs for Amazon Linux - Move to the pre-reqs function + sudo yum install tomcat-native.x86_64 apr fontconfig -y - if [ ! -f "/var/lib/pgsql/data/$DEFAULT_POSTGRES_VERSION" ]; then - # Handle differing paths between Amazon Linux 2 and Amazon Linux 2023 - if [ -f "/usr/pgsql-$DEFAULT_POSTGRES_VERSION/bin/postgresql-$DEFAULT_POSTGRES_VERSION-setup" ]; then + if [ ! -f "/var/lib/pgsql/data/$DEFAULT_POSTGRES_VERSION" ]; then "/usr/pgsql-$DEFAULT_POSTGRES_VERSION/bin/postgresql-$DEFAULT_POSTGRES_VERSION-setup" initdb "postgresql-$DEFAULT_POSTGRES_VERSION" - elif [ -f "/usr/bin/postgresql-setup" ]; then - "/usr/bin/postgresql-setup" initdb "postgresql-$DEFAULT_POSTGRES_VERSION" - else - console_msg "Error: Unable to find Postgres Setup! ..." fi + sudo systemctl start "postgresql-$DEFAULT_POSTGRES_VERSION" + sudo -u postgres psql -c "create user $POSTGRES_USER password '$POSTGRES_PASSWORD';" + sudo -u postgres psql -c "create database $POSTGRES_DB with owner $POSTGRES_USER;" + sudo -u postgres psql -c "revoke all on database $POSTGRES_DB from public;" + sed -i 's/host all all 127.0.0.1\/32 ident/host all all 127.0.0.1\/32 md5/' "/var/lib/pgsql/$DEFAULT_POSTGRES_VERSION/data/pg_hba.conf" + sudo systemctl restart "postgresql-$DEFAULT_POSTGRES_VERSION" + console_msg "Postgres Server and Client Installed ..." + else + sudo yum clean metadata + sudo yum install "postgresql-client-$DEFAULT_POSTGRES_VERSION" -y + # TODO: These are pre-reqs for Amazon Linux - Move to the pre-reqs function + sudo yum install tomcat-native.x86_64 apr fontconfig -y + console_msg "Postgres Client Installed ..." fi - sudo systemctl enable "postgresql-$DEFAULT_POSTGRES_VERSION" - sudo systemctl start "postgresql-$DEFAULT_POSTGRES_VERSION" - sudo -u postgres psql -c "create user $POSTGRES_USER password '$POSTGRES_PASSWORD';" - sudo -u postgres psql -c "create database $POSTGRES_DB with owner $POSTGRES_USER;" - sudo -u postgres psql -c "revoke all on database $POSTGRES_DB from public;" - sed -i 's/host all all 127.0.0.1\/32 ident/host all all 127.0.0.1\/32 md5/' "/var/lib/pgsql/$DEFAULT_POSTGRES_VERSION/data/pg_hba.conf" - sudo systemctl restart "postgresql-$DEFAULT_POSTGRES_VERSION" - console_msg "Postgres Server and Client Installed ..." else - sudo yum clean metadata - sudo yum install "postgresql-client-$DEFAULT_POSTGRES_VERSION" -y - # TODO: These are pre-reqs for Amazon Linux - Move to the pre-reqs function - sudo yum install tomcat-native.x86_64 apr fontconfig -y - console_msg "Postgres Client Installed ..." + if [ "$(platform_version)" == "2023" ]; then + # AL 2023 supports installing Postgresql 15, 16, or 16 from its repo - however, only one version can be installed + # default to v15 unless another version is supplied + if [[ -z $POSTGRES_VERSION ]]; then + DEFAULT_POSTGRES_VERSION="15" + else + DEFAULT_POSTGRES_VERSION=$POSTGRES_VERSION + fi + + if [ "$POSTGRES_SVR_LOCAL" == "TRUE" ]; then + sudo dnf install "postgresql$DEFAULT_POSTGRES_VERSION-server" -y + + if [ ! -f "/var/lib/pgsql/data/PG_VERSION" ]; then + sudo /usr/bin/postgresql-setup initdb + fi + sudo systemctl enable postgresql + sudo systemctl start postgresql + sudo -u postgres psql -c "create user $POSTGRES_USER password '$POSTGRES_PASSWORD';" + sudo -u postgres psql -c "create database $POSTGRES_DB with owner $POSTGRES_USER;" + sudo -u postgres psql -c "revoke all on database $POSTGRES_DB from public;" + sed -i 's/host all all 127.0.0.1\/32 ident/host all all 127.0.0.1\/32 md5/' "/var/lib/pgsql/data/pg_hba.conf" + sudo systemctl restart postgresql + console_msg "Postgres Server and Client Installed ..." + else + sudo dnf clean metadata + sudo dnf install "postgresql$DEFAULT_POSTGRES_VERSION" -y + console_msg "Postgres Client Installed ..." + fi + else + console_msg "Error: Postgresql install on Amazon Linux version $(platform_version) not supported ..." + fi fi ;; diff --git a/sample_embedded_envs.sh b/sample_embedded_envs.sh index 301cad6..729a75e 100755 --- a/sample_embedded_envs.sh +++ b/sample_embedded_envs.sh @@ -11,6 +11,8 @@ export LABKEY_BASE_SERVER_URL="https://localhost" #export LABKEY_INSTALL_SKIP_REQUIRED_ENVS_STEP=1 #export LABKEY_INSTALL_SKIP_START_LABKEY_STEP=1 export POSTGRES_SVR_LOCAL="TRUE" +# Default POSTGRES version is 15, use this var to specify v16, 17 etc +#export POSTGRES_VERSION="16" export LABKEY_DIST_URL="https://lk-binaries.s3.us-west-2.amazonaws.com/downloads/release/community/25.7.7/LabKey25.7.7-8-community.tar.gz" export LABKEY_DIST_FILENAME="LabKey25.7.7-8-community.tar.gz" From 6dbb7dff5f1580354088984f95f04d8568f68cc4 Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Thu, 18 Sep 2025 17:30:04 -0700 Subject: [PATCH 5/6] better amzn linux 2 platform detction --- install-labkey.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install-labkey.bash b/install-labkey.bash index 35867f8..7736971 100755 --- a/install-labkey.bash +++ b/install-labkey.bash @@ -318,7 +318,7 @@ function step_os_prereqs() { _amzn) # amzn stuff goes here # For versions of Amazon Linux prior to 2023 - Add adoptium repo - if [ "$(platform_version)" != "2023" ]; then + if [ "$(platform_version)" == "2" ]; then if [ ! -f "/etc/yum.repos.d/adoptium.repo" ]; then NewFile="/etc/yum.repos.d/adoptium.repo" ( @@ -702,7 +702,8 @@ function step_postgres_configure() { case "_$(platform)" in _amzn) - if [ "$(platform_version)" != "2023" ]; then + # Amazon Linux 2 + if [ "$(platform_version)" == "2" ]; then # Install the Postgresql repository RPM # note this method is required for AMZN linux and supports PG versions 12-15 - v16 not supported by PG repo if [[ -z $POSTGRES_VERSION ]]; then @@ -750,6 +751,7 @@ function step_postgres_configure() { console_msg "Postgres Client Installed ..." fi else + # Amazon Linux 2023 if [ "$(platform_version)" == "2023" ]; then # AL 2023 supports installing Postgresql 15, 16, or 16 from its repo - however, only one version can be installed # default to v15 unless another version is supplied From baf3e76098175e0c790a1239512ad2a976d46eb4 Mon Sep 17 00:00:00 2001 From: Stuart MacDonald <32204841+labkey-stuartm@users.noreply.github.com> Date: Fri, 19 Sep 2025 09:45:53 -0700 Subject: [PATCH 6/6] fix typo in comment --- install-labkey.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-labkey.bash b/install-labkey.bash index 7736971..b3677a3 100755 --- a/install-labkey.bash +++ b/install-labkey.bash @@ -753,7 +753,7 @@ function step_postgres_configure() { else # Amazon Linux 2023 if [ "$(platform_version)" == "2023" ]; then - # AL 2023 supports installing Postgresql 15, 16, or 16 from its repo - however, only one version can be installed + # AL 2023 supports installing Postgresql 15, 16, or 17 from its repo - however, only one version can be installed # default to v15 unless another version is supplied if [[ -z $POSTGRES_VERSION ]]; then DEFAULT_POSTGRES_VERSION="15"