diff --git a/.github/workflows/CI-full.yml b/.github/workflows/CI-full.yml index 015d38e1b5..8402ac1df1 100644 --- a/.github/workflows/CI-full.yml +++ b/.github/workflows/CI-full.yml @@ -1,4 +1,4 @@ -name: CI-application-containers +name: Build and Publish VCell Docker Images on: workflow_dispatch: @@ -6,6 +6,10 @@ on: tag: description: "Repository tag (e.g., 7.7.0.37)" required: true +# client_only: +# description: "Build only client images (true/false)" +# required: false +# default: "false" release: types: [published] @@ -60,47 +64,15 @@ jobs: - name: Install Dependencies run: pip install -r requirements.txt - - name: build vcell-cli-utils package + - name: build python packages run: | - cd vcell-cli-utils - poetry install - poetry run python -m pytest - - - name: build vcell-admin package - run: | - cd docker/swarm/vcell-admin - poetry install - poetry run python -m pytest - - - name: build pythonCopasiOpt package - run: | - cd pythonCopasiOpt/vcell-opt - poetry install - poetry run python -m pytest - - - name: build pythonVtk package - run: | - cd pythonVtk - poetry install - poetry run python -m pytest - - - name: build vcutils package - run: | - cd python-utils - poetry install - poetry run python -m pytest - - - name: build python-restclient package - run: | - cd python-restclient - poetry install - poetry run python -m pytest - - - name: build vcelldata package - run: | - cd pythonData - poetry install - poetry run python -m pytest + set -ux + for POETRY_DIR in vcell-cli-utils docker/swarm/vcell-admin pythonCopasiOpt/vcell-opt pythonVtk python-utils python-restclient pythonData;\ + do pushd $POETRY_DIR;\ + poetry install;\ + poetry run python -m pytest;\ + popd;\ + done - name: setup java 17 with maven cache uses: actions/setup-java@v4 @@ -115,12 +87,14 @@ jobs: cd docker/build echo "${{ secrets.GITHUB_TOKEN }}" | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin - ./build.sh all ${{ env.VCELL_REPO_NAMESPACE }} ${{ env.VCELL_TAG }} + export BUILD_IMAGES="all" + ./build.sh ${BUILD_IMAGES} ${{ env.VCELL_REPO_NAMESPACE }} ${{ env.VCELL_TAG }} - name: tag as latest and push to registry shell: bash run: | - for CONTAINER in vcell-exporter vcell-api vcell-rest vcell-webapp-prod vcell-webapp-dev vcell-webapp-stage vcell-webapp-island vcell-batch vcell-opt vcell-clientgen vcell-data vcell-db vcell-mongo vcell-sched vcell-submit vcell-admin;\ + export CONTAINER_SET="vcell-exporter vcell-api vcell-rest vcell-webapp-prod vcell-webapp-dev vcell-webapp-stage vcell-webapp-island vcell-batch vcell-opt vcell-clientgen vcell-data vcell-db vcell-mongo vcell-sched vcell-submit vcell-admin" + for CONTAINER in ${CONTAINER_SET};\ do docker tag ${VCELL_REPO_NAMESPACE}/$CONTAINER:${VCELL_TAG} ${VCELL_REPO_NAMESPACE}/$CONTAINER:latest;\ docker tag ${VCELL_REPO_NAMESPACE}/$CONTAINER:${VCELL_TAG} ${VCELL_REPO_NAMESPACE}/$CONTAINER:${FRIENDLY_TAG};\ docker push --all-tags ${VCELL_REPO_NAMESPACE}/$CONTAINER;\ @@ -129,3 +103,20 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 if: ${{ failure() }} + + +# if [ "${{ github.event.inputs.client_only }}" = "true" ]; then +# echo "Building only client images" +# export BUILD_IMAGES="clientgen" +# else +# echo "Building all images" +# +# fi + +# if [ "${{ github.event.inputs.client_only }}" = "true" ]; then +# echo "Building only client images" +# export CONTAINER_SET="vcell-clientgen" +# else +# echo "Building all images" +# export CONTAINER_SET="vcell-exporter vcell-api vcell-rest vcell-webapp-prod vcell-webapp-dev vcell-webapp-stage vcell-webapp-island vcell-batch vcell-opt vcell-clientgen vcell-data vcell-db vcell-mongo vcell-sched vcell-submit vcell-admin" +# fi diff --git a/docker/build/installers/VCell.install4j b/docker/build/installers/VCell.install4j index 0b5f7b2794..c6b434517b 100644 --- a/docker/build/installers/VCell.install4j +++ b/docker/build/installers/VCell.install4j @@ -1,5 +1,5 @@ - + @@ -314,26 +314,15 @@ java.desktop/sun.awt.image=ALL-UNNAMED - + Installing Virtual Cell ${compiler:vcellVersion} - - - - - - - - - - - - + - + @@ -374,8 +363,22 @@ return console.askOkCancel(message, true); - + !context.getBooleanVariable("sys.confirmedUpdateInstallation") + String pastInstallDir = (String)context.getVariable("sys.installationDir"); +String privilegedAppDir = (String)context.getVariable("sys.programFilesDir"); +String appName = "VCell_" + context.getCompilerVariable("Site"); +boolean windowsOrMac = Util.isWindows() || Util.isMacOS(); +if (pastInstallDir.contains(privilegedAppDir) && windowsOrMac){ + String homeDir = (String)context.getVariable("sys.userHome"); + if (Util.isMacOS()){ + context.setInstallationDirectory(new File(homeDir + "/Applications/" + appName)); + } else{ + String localAppDataDir = (String)context.getVariable("sys.localAppdataDir"); + context.setInstallationDirectory(new File(localAppDataDir + "\\Programs\\" + appName)); + } +} + @@ -412,7 +415,7 @@ return console.askOkCancel(message, true); - + @@ -430,13 +433,13 @@ return console.askOkCancel(message, true); - + ${compiler:sys.fullName} !context.getBooleanVariable("sys.confirmedUpdateInstallation") - + @@ -454,7 +457,7 @@ return console.askOkCancel(message, true); - + @@ -465,7 +468,7 @@ return console.askOkCancel(message, true); - + @@ -620,7 +623,95 @@ return bngperlfile.exists(); - + + import java.io.File; +File userAgnostic = new File((String)context.getVariable("sys.programFilesDir")); +String appName = "VCell_" + context.getCompilerVariable("Site"); +List<File> vcellRelatedAdminDirs = Arrays.stream(userAgnostic.listFiles()).filter(f -> f.toString().contains(appName)).toList(); +boolean existsAdminInstall = vcellRelatedAdminDirs.size() == 1; +return existsAdminInstall; + + + + + + + + + + + + + + + String folderName = "VCell_" + context.getCompilerVariable("Site"); +com.install4j.api.Util.logInfo(null, directory.getAbsolutePath()); +return directory.getAbsolutePath().contains(folderName); + + + + + + +String folderName = "VCell_" + context.getCompilerVariable("Site"); +com.install4j.api.Util.logInfo(null, file.getAbsolutePath()); +return file.getAbsolutePath().contains(folderName); + + + + + + + + ${installer:sys.programFilesDir}${installer:sys.fileSeparator}VCell_${compiler:Site} + + + + + ${installer:sys.programFilesDir}${installer:sys.fileSeparator}VCell_${compiler:Site}.app + + + + + + + + + + + ${i18n:InfoBeforeClickLabel} + + !context.isConsole() + + + + To finish this installation, the admin install of VCell will be removed +[${installer:sys.programFilesDir}${installer:sys.fileSeparator}VCell_${compiler:Site}], +as a user installation now replaces it. + + + + + textSource + displayedText + displayedTextFile + variableName + + + + + + + console.waitForEnter(); +return true; + + + + + + + + @@ -679,7 +770,16 @@ return bngperlfile.exists(); - + + import java.io.File; +File userAgnostic = new File((String)context.getVariable("sys.programFilesDir")); +String appName = "VCell_" + context.getCompilerVariable("Site"); +List<File> vcellRelatedAdminDirs = Arrays.stream(userAgnostic.listFiles()).filter(f -> f.toString().contains(appName)).toList(); +boolean existsAdminInstall = vcellRelatedAdminDirs.size() == 1; +return existsAdminInstall; + + + @@ -707,7 +807,7 @@ return console.askYesNo(message, true); - + @@ -1059,6 +1159,7 @@ context.goForward(1, true, true); ${i18n:updater.FinishTitle} + @@ -1397,7 +1498,14 @@ if (context.isUnattended()) { - + + + + + + + + @@ -1410,13 +1518,9 @@ if (context.isUnattended()) { - - - - - - - + + + @@ -1440,7 +1544,7 @@ if (context.isUnattended()) { - + diff --git a/docker/build/installers/test_local_install.sh b/docker/build/installers/test_local_install.sh new file mode 100644 index 0000000000..4af1503753 --- /dev/null +++ b/docker/build/installers/test_local_install.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#=========================================# +# For testing local build of Mac installer +#=========================================# + +#---------------------# +# Configure # +#---------------------# +CONFIG_DIR=/Users/evalencia/Documents/VCell_Repositories/VCell-Installers +MAVEN_ROOT_DIR=/Users/evalencia/Documents/VCell_Repositories/vcell +SOLVERS_PATH=/Applications/VCell_Test.app/Contents/java/app +INSTALL4J_PATH=/Applications/install4j.app/Contents/Resources/app/bin/install4jc + +#--------------------------------# + +JARS_DIR=${MAVEN_ROOT_DIR}/vcell-client/target +cp ${JARS_DIR}/vcell-client-0.0.1-SNAPSHOT.jar ${JARS_DIR}/maven-jars/vcell-client-0.0.1-SNAPSHOT.jar +COLON_SEP=`ls -m ${JARS_DIR}/maven-jars | tr -d '[:space:]' | tr ',' ':'` + +$INSTALL4J_PATH \ +--disable-signing \ +--media-types=macosFolder \ +--faster \ +--debug \ +-D \ +macKeystore=${CONFIG_DIR}/Apple_Dev_Id_Certificate_exp_20270924.p12,\ +vcellLicenseFilePath=${CONFIG_DIR}/license.txt,\ +vcell5SplashScreenPngFilePath=${CONFIG_DIR}/cat.jpg,\ +vcellNativeLibsDirSourcePath=${SOLVERS_PATH}/nativelibs,\ +vcellLocalSolversDirPath=${SOLVERS_PATH}/localsolvers,\ +vcellbngPerlPath=${SOLVERS_PATH}/bionetgen,\ +vcellIcnsFile=${MAVEN_ROOT_DIR}/docker/build/installers/icons/vcell.icns,\ +outputDir=${CONFIG_DIR}/output,\ +mavenRootDir=${MAVEN_ROOT_DIR},\ +winKeystore='',\ +applicationId='1471-8022-1038-5555',\ +SoftwareVersionString='7_7_0_5',\ +Site='Custom',\ +vcellVersion='7',\ +vcellBuild='7.0.37',\ +updateSiteBaseUrl='http://vcell.org/webstart/Fake',\ +rmiHosts='vcell-stage.cam.uchc.edu',\ +serverPrefixV0='/api/v0',\ +serverPrefixV1='/api/v1',\ +bioformatsJarFile='vcell-bioformats-0.0.9-jar-with-dependencies.jar',\ +bioformatsJarDownloadURL='http://vcell.org/webstart/vcell-bioformats-0.0.9-jar-with-dependencies.jar',\ +vcellClasspathColonSep=${COLON_SEP} \ +${MAVEN_ROOT_DIR}/docker/build/installers/VCell.install4j diff --git a/docker/swarm/deploy-installers.sh b/docker/swarm/deploy-installers.sh index 929c49f359..98ef330483 100755 --- a/docker/swarm/deploy-installers.sh +++ b/docker/swarm/deploy-installers.sh @@ -87,6 +87,7 @@ if [ ! -z "$installer_deploy_dir" ]; then # vcell_build=19 # version=7_0_0_19 version=$(echo "${vcell_version}_${vcell_build}" | tr '.' _) + mv "./generated_installers/VCell_${vcell_siteCamel}_macos_${version}.dmg" "./generated_installers/VCell_${vcell_siteCamel}_macos_${version}_64bit.dmg" if ! scp "./generated_installers/VCell_${vcell_siteCamel}_windows-x64_${version}_64bit.exe" \ "./generated_installers/VCell_${vcell_siteCamel}_unix_${version}_32bit.sh" \ "./generated_installers/VCell_${vcell_siteCamel}_macos_${version}_64bit.dmg" \