Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test with debian 12 #308

Closed
rkrenn opened this issue Jun 10, 2024 · 4 comments · Fixed by #338
Closed

test with debian 12 #308

rkrenn opened this issue Jun 10, 2024 · 4 comments · Fixed by #338

Comments

@rkrenn
Copy link
Collaborator

rkrenn commented Jun 10, 2024

the default-jdk was bumped from 11 to 17 in debian 12.5:

root@phoenix:~# java -version openjdk version "17.0.11" 2024-04-16 OpenJDK Runtime Environment (build 17.0.11+9-Debian-1deb12u1) OpenJDK 64-Bit Server VM (build 17.0.11+9-Debian-1deb12u1, mixed mode, sharing)

the nashorn javascript engine was replaced, so compiling fails:

Compilation failure: Compilation failure: [ERROR] /ctsms/build/ctsms/core/src/main/java/org/phoenixctms/ctsms/js/JSObjectMap.java:[7,33] package jdk.nashorn.api.scripting does not exist

@rkrenn
Copy link
Collaborator Author

rkrenn commented Jun 20, 2024

@josharmenta building in new debian now works.

@josharmenta
Copy link

Thanks Rene, I'll test this over the week.

@rkrenn
Copy link
Collaborator Author

rkrenn commented Dec 17, 2024

while building in debian 12 works meanwhile, running dbtool.sh bails out with

java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @6a463b3d

fixed by 61c279b

finally, debian12 also replaced tomcat9 by tomcat10, which requires extensive migration, see https://tomcat.apache.org/migration-10.html. we will priorize this now since github actions worker instances moved to debian12 just recently.

@rkrenn rkrenn linked a pull request Dec 25, 2024 that will close this issue
@rkrenn
Copy link
Collaborator Author

rkrenn commented Jan 1, 2025

apt update
apt install openssh-server
sudo apt-get -q -y install default-jdk maven git vim mc postgresql postgresql-plperl wget

cd /home/phoenix
git clone https://github.com/phoenixctms/ctsms.git
#sudo apt-get -q -y install gh
cd /home/phoenix/ctsms
#git auth login (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)
#gh pr checkout 339
mvn install -DskipTests

mvn -f core/pom.xml org.andromda.maven.plugins:andromdapp-maven-plugin:schema -Dtasks=create
sudo useradd ctsms -p '*' --groups sudo
sudo sed -r -i "s|#*join_collapse_limit.*|join_collapse_limit = 1|" /etc/postgresql/15/main/postgresql.conf
sudo service postgresql start
sudo -u postgres psql postgres -c "CREATE USER ctsms WITH PASSWORD 'ctsms';"
sudo -u postgres psql postgres -c "CREATE DATABASE ctsms;"
sudo -u postgres psql postgres -c "GRANT ALL PRIVILEGES ON DATABASE ctsms to ctsms;"
sudo -u postgres psql postgres -c "ALTER DATABASE ctsms OWNER TO ctsms;"
sudo -u postgres psql ctsms < /home/phoenix/ctsms/core/db/dbtool.sql
sudo -u ctsms psql -U ctsms ctsms < /home/phoenix/ctsms/core/db/schema-create.sql
sudo -u ctsms psql -U ctsms ctsms < /home/phoenix/ctsms/core/db/index-create.sql
sudo -u ctsms psql -U ctsms ctsms < /home/phoenix/ctsms/core/db/schema-set-version.sql
sudo service postgresql restart

sudo mkdir /ctsms
sudo wget --no-verbose --no-check-certificate --content-disposition https://github.com/phoenixctms/config-default/archive/master.tar.gz -O /ctsms/config.tar.gz
sudo tar -zxvf /ctsms/config.tar.gz -C /ctsms --strip-components 1
sudo wget --no-verbose https://api.github.com/repos/phoenixctms/master-data/tarball/master -O /ctsms/master-data.tar.gz
sudo mkdir /ctsms/master_data
sudo tar -zxvf /ctsms/master-data.tar.gz -C /ctsms/master_data --strip-components 1
sudo chown ctsms:ctsms /ctsms -R
sudo chmod 777 /ctsms -R

sudo apt-get -q -y -o=Dpkg::Use-Pty=0 install \
libarchive-zip-perl \
libconfig-any-perl \
libdata-dump-perl \
libdata-dumper-concise-perl \
libdata-uuid-perl \
libdata-validate-ip-perl \
libdate-calc-perl \
libdate-manip-perl \
libdatetime-format-iso8601-perl \
libdatetime-format-strptime-perl \
libdatetime-perl \
libdatetime-timezone-perl \
libdbd-csv-perl \
libdbd-mysql-perl \
libdbd-sqlite3-perl \
tdsodbc \
libdbd-odbc-perl \
libdigest-md5-perl \
libemail-mime-attachment-stripper-perl \
libemail-mime-perl \
libgearman-client-perl \
libhtml-parser-perl \
libintl-perl \
libio-compress-perl \
libio-socket-ssl-perl \
libjson-xs-perl \
liblog-log4perl-perl \
libmail-imapclient-perl \
libmarpa-r2-perl \
libmime-base64-perl \
libmime-lite-perl \
libmime-tools-perl \
libnet-address-ip-local-perl \
libnet-smtp-ssl-perl \
libole-storage-lite-perl \
libphp-serialization-perl \
libexcel-writer-xlsx-perl \
libspreadsheet-parseexcel-perl \
libstring-mkpasswd-perl \
libtext-csv-xs-perl \
libtie-ixhash-perl \
libtime-warp-perl \
liburi-find-perl \
libuuid-perl \
libwww-perl \
libxml-dumper-perl \
libxml-libxml-perl \
libyaml-libyaml-perl \
libyaml-tiny-perl \
libtemplate-perl \
libdancer-perl \
libdbd-pg-perl \
libredis-perl \
libjson-perl \
libplack-perl \
libcache-memcached-perl \
libdancer-session-memcached-perl \
libgraphviz-perl \
gnuplot \
imagemagick \
ghostscript \
build-essential \
libtest-utf8-perl \
libmoosex-hasdefaults-perl \
cpanminus
sudo sed -r -i 's/^\s*(<policy domain="coder" rights="none" pattern="PS" \/>)\s*$/<!--\1-->/' /etc/ImageMagick-6/policy.xml
if [ "$(lsb_release -d | grep -Ei 'debian')" ]; then
  sudo apt-get -q -y -o=Dpkg::Use-Pty=0 install libsys-cpuaffinity-perl
else
  sudo cpanm Sys::CpuAffinity
  sudo cpanm threads::shared
fi
sudo cpanm --notest Dancer::Plugin::I18N
sudo cpanm --notest DateTime::Format::Excel
sudo cpanm --notest Spreadsheet::Reader::Format
sudo cpanm --notest Spreadsheet::Reader::ExcelXML
sudo wget --no-verbose --no-check-certificate --content-disposition https://github.com/phoenixctms/bulk-processor/archive/master.tar.gz -O /ctsms/bulk-processor.tar.gz
sudo tar -zxvf /ctsms/bulk-processor.tar.gz -C /ctsms/bulk_processor --strip-components 1
sudo perl /ctsms/bulk_processor/CTSMS/BulkProcessor/Projects/WebApps/minify.pl --folder=/ctsms/bulk_processor/CTSMS/BulkProcessor/Projects/WebApps/Signup
sudo mkdir /ctsms/bulk_processor/output
sudo chown ctsms:ctsms /ctsms/bulk_processor -R
sudo chmod 755 /ctsms/bulk_processor -R
sudo chmod 777 /ctsms/bulk_processor/output -R
sudo wget --no-verbose https://raw.githubusercontent.com/phoenixctms/install-debian/master/ecrfdataexport.sh -O /ctsms/ecrfdataexport.sh
sudo chown ctsms:ctsms /ctsms/ecrfdataexport.sh
sudo chmod 755 /ctsms/ecrfdataexport.sh
sudo wget --no-verbose https://raw.githubusercontent.com/phoenixctms/install-debian/master/ecrfdataimport.sh -O /ctsms/ecrfdataimport.sh
sudo chown ctsms:ctsms /ctsms/ecrfdataimport.sh
sudo chmod 755 /ctsms/ecrfdataimport.sh
sudo wget --no-verbose https://raw.githubusercontent.com/phoenixctms/install-debian/master/inquirydataexport.sh -O /ctsms/inquirydataexport.sh
sudo chown ctsms:ctsms /ctsms/inquirydataexport.sh
sudo chmod 755 /ctsms/inquirydataexport.sh
echo "publish_public_file: 1" | sudo tee -a /ctsms/bulk_processor/CTSMS/BulkProcessor/Projects/ETL/EcrfExporter/settings.yml

sudo chown ctsms:ctsms /home/phoenix/ctsms/.github/workflows/dbtool.sh
sudo chmod 755 /home/phoenix/ctsms/.github/workflows/dbtool.sh
sudo mv /home/phoenix/ctsms/.github/workflows/dbtool.sh /ctsms/dbtool.sh
sed -r -i 's!runner/work/ctsms!phoenix!g' /ctsms/dbtool.sh
sudo chmod 777 /home
sudo chmod 777 /home/phoenix
sudo chmod 777 /home/phoenix/ctsms
sudo chmod 777 /home/phoenix/ctsms/web -R

/ctsms/dbtool.sh -i -f
/ctsms/dbtool.sh -icp /ctsms/master_data/criterion_property_definitions.csv
/ctsms/dbtool.sh -ipd /ctsms/master_data/permission_definitions.csv
/ctsms/dbtool.sh -imi /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -ims /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imc /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imt /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imp /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -immm /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imifi /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imsi /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -impi /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imjf /ctsms/master_data/mime.types -e ISO-8859-1
/ctsms/dbtool.sh -imcc /ctsms/master_data/mime.types -e ISO-8859-1 

sudo apt-get -q -y -o=Dpkg::Use-Pty=0 install tomcat10
sudo systemctl stop tomcat10
sudo usermod --append --groups ctsms tomcat
export CTSMS_PROPERTIES=/ctsms/properties
export CTSMS_JAVA=/ctsms/java
echo "CTSMS_PROPERTIES=$CTSMS_PROPERTIES" | sudo tee -a /etc/default/tomcat10
echo "CTSMS_JAVA=$CTSMS_JAVA" | sudo tee -a /etc/default/tomcat10
sudo sed -r -i "s|# Lifecycle|EnvironmentFile=/etc/default/tomcat10\\n\\n# Lifecycle|" /usr/lib/systemd/system/tomcat10.service
sudo sed -r -i "s|# Security|# Security\\nReadWritePaths=/ctsms/external_files/ /ctsms/bulk_processor/output/ /ctsms/ /tmp/|" /usr/lib/systemd/system/tomcat10.service
VERSION=$(grep -oP '<application.version>\K[^<]+' /home/phoenix/ctsms/pom.xml)
sudo tar -xvzf /home/phoenix/ctsms/.github/workflows/jakartaee-migration-1.0.8-bin.tar.gz -C /ctsms
sudo /ctsms/jakartaee-migration-1.0.8/bin/migrate.sh /home/phoenix/ctsms/web/target/ctsms-$VERSION.war /home/phoenix/ctsms/web/target/ctsms-$VERSION-migrated.war
sudo chmod 755 /home/phoenix/ctsms/web/target/ctsms-$VERSION-migrated.war
sudo rm /var/lib/tomcat10/webapps/ROOT/ -rf
sudo cp /home/phoenix/ctsms/web/target/ctsms-$VERSION-migrated.war /var/lib/tomcat10/webapps/ROOT.war
sudo systemctl daemon-reload
sudo systemctl start tomcat10

DEPARTMENT_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
USER_PASSWORD=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 3 | head -n 1)
sudo -u ctsms /ctsms/dbtool.sh -cd -dlk my_department -dp "$DEPARTMENT_PASSWORD"
sudo -u ctsms /ctsms/dbtool.sh -cu -dlk my_department -dp "$DEPARTMENT_PASSWORD" -u "phoenix" -p "$USER_PASSWORD" -pp "INVENTORY_MASTER_ALL_DEPARTMENTS,STAFF_MASTER_ALL_DEPARTMENTS,COURSE_MASTER_ALL_DEPARTMENTS,TRIAL_MASTER_ALL_DEPARTMENTS,PROBAND_MASTER_ALL_DEPARTMENTS,USER_ALL_DEPARTMENTS,INPUT_FIELD_MASTER,MASS_MAIL_MASTER_ALL_DEPARTMENTS,INVENTORY_MASTER_SEARCH,STAFF_MASTER_SEARCH,COURSE_MASTER_SEARCH,TRIAL_MASTER_SEARCH,PROBAND_MASTER_SEARCH,USER_MASTER_SEARCH,INPUT_FIELD_MASTER_SEARCH,MASS_MAIL_MASTER_SEARCH"
IP=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1  -d'/')
echo "The department passphrase for 'my_department' when adding users with /ctsms/dbtool.sh is '$DEPARTMENT_PASSWORD'."
echo "Log in at https://$IP with username 'phoenix' password '$USER_PASSWORD'."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants