From 9d261eefd5600d3d650bc707c1476b788e346a6e Mon Sep 17 00:00:00 2001 From: Brian Bolt Date: Tue, 4 Jun 2024 13:44:34 -0700 Subject: [PATCH 1/4] ACAS-744: Update Dockerfile to CentOS Stream 9 and Python 3.11 --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3aa4e7c3e..2153d98bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/centos/centos:stream8 +FROM quay.io/centos/centos:stream9 ARG BUILDTIME=1970-01-01T00:00:00Z ENV ACAS_CLIENT_ABOUT_ACAS_BUILDTIME=${BUILDTIME} @@ -21,11 +21,10 @@ RUN \ dnf clean all #Install python dependencies -RUN dnf install -y python36 python3-pip -RUN alternatives --set python /usr/bin/python3 -RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 -RUN pip install argparse requests -RUN dnf install -y initscripts python3-psycopg2 +RUN dnf install -y python311 python3.11-pip initscripts +RUN alternatives --install /usr/bin/python python /usr/bin/python3.11 1 +RUN alternatives --install /usr/bin/pip pip /usr/bin/pip3.11 1 +RUN pip install argparse requests psycopg2-binary # node ENV NPM_CONFIG_LOGLEVEL warn From 73aff107587afd607c6ea8b875ac0db39bd116e1 Mon Sep 17 00:00:00 2001 From: Brian Bolt Date: Wed, 5 Jun 2024 08:25:51 -0700 Subject: [PATCH 2/4] changes to support R-4.4.0 changes --- bin/setenv.sh | 13 ++++++++++--- .../src/server/generic_data_parser.R | 10 +++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/bin/setenv.sh b/bin/setenv.sh index 105dfa3e4..f4575adc8 100644 --- a/bin/setenv.sh +++ b/bin/setenv.sh @@ -1,7 +1,14 @@ # Example: #export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0/jre/lib/amd64:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server/ -PATH=/usr/pgsql-9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ARCH=$(uname -m) + +if [ "$ARCH" = "x86_64" ]; then + LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0/jre/lib/amd64:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server/:/R-4.4.0/lib +elif [ "$ARCH" = "aarch64" ]; then + LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0/jre/lib/aarch64:/usr/lib/jvm/java-1.8.0/jre/lib/aarch64/server/:/R-4.4.0/lib +fi + +export LD_LIBRARY_PATH +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin R_LIBS=/home/runner/build/r_libs JAVA_HOME=/usr/lib/jvm/java-1.8.0 -if [ -e "/opt/rh/rh-python36/enable" ]; then source /opt/rh/rh-python36/enable; fi; \ No newline at end of file diff --git a/modules/GenericDataParser/src/server/generic_data_parser.R b/modules/GenericDataParser/src/server/generic_data_parser.R index 2d0a59065..040ac8959 100644 --- a/modules/GenericDataParser/src/server/generic_data_parser.R +++ b/modules/GenericDataParser/src/server/generic_data_parser.R @@ -2005,7 +2005,7 @@ getExperimentByNameCheck <- function(experimentName, protocol, configList, dupli protocolOfExperiment <- getProtocolByCodeName(experimentList[[1]]$protocol$codeName) - if (is.na(protocol) || protocolOfExperiment$id != protocol$id) { + if (identical(protocol, NA) || protocolOfExperiment$id != protocol$id) { if (duplicateNamesAllowed) { experiment <- NA } else { @@ -3567,7 +3567,7 @@ runMain <- function(pathToGenericDataFormatExcelFile, reportFilePath=NULL, protocol <- NULL if (!useExisting) { protocol <- getProtocolByNameAndFormat(protocolName = validatedMetaData[,paste0(racas::applicationSettings$client.protocol.label," Name")][1], configList, inputFormat) - newProtocol <- is.na(protocol[[1]]) + newProtocol <- identical(protocol[[1]], NA) if (!newProtocol) { validatedMetaData[,paste0(racas::applicationSettings$client.protocol.label," Name")][1] <- getPreferredProtocolName(protocol, validatedMetaData[,paste0(racas::applicationSettings$client.protocol.label," Name")][1]) } @@ -3728,7 +3728,7 @@ runMain <- function(pathToGenericDataFormatExcelFile, reportFilePath=NULL, } # Checks if we have a new experiment - newExperiment <- class(experiment[[1]])!="list" && is.na(experiment[[1]]) + newExperiment <- class(experiment[[1]])!="list" && identical(experiment[[1]], NA) # If there are errors, do not allow an upload (yes, this is needed a second time) errorFree <- length(messenger()$errors)==0 @@ -4628,6 +4628,10 @@ getSubjectAndTreatmentData <- function (precise, genericDataFileDataFrame, calcu validateSubjectData <- function(subjectData, dryRun) { # Validates Subject Data # For now, just passes information to validateValue Kinds + if (is.null(subjectData)) { + return(NULL) + } + # subjectData is just list() with the new thing so why is it uniqueDF <- unique(subjectData[, c("Class", "valueKind")]) uniqueDF <- uniqueDF[!(uniqueDF$valueKind %in% c('flag cause', 'flag observation', 'flag status')), ] validateValueKinds(uniqueDF$valueKind, uniqueDF$Class, dryRun, reserved = NULL) From 6867b2ce454bf288fe103779f64a554ede04feb4 Mon Sep 17 00:00:00 2001 From: Brian Bolt Date: Wed, 5 Jun 2024 16:16:10 -0700 Subject: [PATCH 3/4] Remove stream8 workaround --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58dee0f27..027bfd7d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,6 @@ ENV ACAS_CLIENT_ABOUT_ACAS_VERSION=${VERSION} ARG REVISION=UNKNOWN ENV ACAS_CLIENT_ABOUT_ACAS_REVISION=${REVISION} -# EOL for Centos8-Stream workaround -RUN sed -i 's/^mirrorlist=/#&/' /etc/yum.repos.d/*.repo && \ - sed -i 's/^#baseurl=/baseurl=/' /etc/yum.repos.d/*.repo && \ - sed -i 's/mirror.centos.org/vault.centos.org/' /etc/yum.repos.d/*.repo - # Update RUN \ dnf update -y && \ From 0af2e2f4493435580bef6bcf8f66f5551752e458 Mon Sep 17 00:00:00 2001 From: Brian Bolt Date: Thu, 6 Jun 2024 11:51:08 -0700 Subject: [PATCH 4/4] Remove comment --- modules/GenericDataParser/src/server/generic_data_parser.R | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/GenericDataParser/src/server/generic_data_parser.R b/modules/GenericDataParser/src/server/generic_data_parser.R index 040ac8959..4b9cbac7c 100644 --- a/modules/GenericDataParser/src/server/generic_data_parser.R +++ b/modules/GenericDataParser/src/server/generic_data_parser.R @@ -4631,7 +4631,6 @@ validateSubjectData <- function(subjectData, dryRun) { if (is.null(subjectData)) { return(NULL) } - # subjectData is just list() with the new thing so why is it uniqueDF <- unique(subjectData[, c("Class", "valueKind")]) uniqueDF <- uniqueDF[!(uniqueDF$valueKind %in% c('flag cause', 'flag observation', 'flag status')), ] validateValueKinds(uniqueDF$valueKind, uniqueDF$Class, dryRun, reserved = NULL)