-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(desktop): correct Antares Desktop packaging
- Loading branch information
1 parent
ecc9a64
commit 95d7544
Showing
5 changed files
with
157 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
block_cipher = None | ||
|
||
a = Analysis( | ||
["antarest/worker/archive_worker_service.py"], | ||
pathex=[], | ||
binaries=[], | ||
datas=[("resources", "resources")], | ||
hiddenimports=["pythonjsonlogger.jsonlogger"], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
pyz = PYZ( | ||
a.pure, | ||
a.zipped_data, | ||
cipher=block_cipher, | ||
) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name="AntaresWebWorker", | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=True, | ||
disable_windowed_traceback=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Examples can be found at https://github.com/AntaresSimulatorTeam/Antares_Simulator_Examples | ||
These can be copied into the studies directory. | ||
These can be copied into the `studies` directory. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,100 @@ | ||
#!/bin/bash | ||
|
||
# Antares Web Packaging -- Desktop Version | ||
# | ||
# This script is launch by the GitHub Workflow `.github/workflows/deploy.yml`. | ||
# It builds the Desktop version of the Web Application and the Worker Application. | ||
# Make sure you run the `npm install` stage before running this script. | ||
|
||
set -e | ||
|
||
ANTARES_SOLVER_VERSION="8.5" | ||
ANTARES_SOLVER_FULL_VERSION="8.5.1" | ||
ANTARES_SOLVER_FULL_VERSION_INT=$(echo $ANTARES_SOLVER_FULL_VERSION | sed 's/\.//g') | ||
ANTARES_SOLVER_FULL_VERSION="8.5.0" | ||
ANTARES_SOLVER_FULL_VERSION_INT="850" | ||
|
||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | ||
PROJECT_DIR=$(dirname -- "${SCRIPT_DIR}") | ||
DIST_DIR="${PROJECT_DIR}/dist/package" | ||
RESOURCES_DIR="${PROJECT_DIR}/resources" | ||
ANTARES_SOLVER_DIR="${DIST_DIR}/AntaresWeb/antares_solver" | ||
|
||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
ANTARES_SOLVER_FOLDER_NAME="rte-antares-$ANTARES_SOLVER_FULL_VERSION-installer-64bits" | ||
ANTARES_SOLVER_ZIPFILE_NAME="$ANTARES_SOLVER_FOLDER_NAME.zip" | ||
else | ||
ANTARES_SOLVER_FOLDER_NAME="antares-$ANTARES_SOLVER_FULL_VERSION-Ubuntu-20.04" | ||
ANTARES_SOLVER_ZIPFILE_NAME="$ANTARES_SOLVER_FOLDER_NAME.tar.gz" | ||
ANTARES_SOLVER_ZIPFILE_NAME="antares-solver_ubuntu20.04.tar.gz" | ||
fi | ||
|
||
LINK="https://github.com/AntaresSimulatorTeam/Antares_Simulator/releases/download/v$ANTARES_SOLVER_FULL_VERSION/$ANTARES_SOLVER_ZIPFILE_NAME" | ||
DESTINATION="../dist/AntaresWeb/antares_solver" | ||
|
||
echo "Downloading AntaresSimulator from $LINK" | ||
wget $LINK | ||
echo "INFO: Preparing the Git Commit ID..." | ||
git log -1 HEAD --format=%H > ${RESOURCES_DIR}/commit_id | ||
|
||
echo "Unzipping $ANTARES_SOLVER_ZIPFILE_NAME and move Antares solver to $DESTINATION" | ||
7z x $ANTARES_SOLVER_ZIPFILE_NAME | ||
if [[ "$OSTYPE" != "msys"* ]]; then | ||
7z x "$ANTARES_SOLVER_FOLDER_NAME.tar" | ||
echo "INFO: Generating the Desktop version of the Web Application..." | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
pushd ${PROJECT_DIR} | ||
pyinstaller --distpath ${DIST_DIR} AntaresWebWin.spec | ||
popd | ||
else | ||
pushd ${PROJECT_DIR} | ||
pyinstaller --distpath ${DIST_DIR} AntaresWebLinux.spec | ||
popd | ||
fi | ||
|
||
mkdir $DESTINATION | ||
echo "INFO: Generating the Worker Application..." | ||
pushd ${PROJECT_DIR} | ||
pyinstaller --distpath ${DIST_DIR} AntaresWebWorker.spec | ||
popd | ||
|
||
echo "INFO: Creating destination directory '${ANTARES_SOLVER_DIR}'..." | ||
mkdir -p "${ANTARES_SOLVER_DIR}" | ||
|
||
echo "INFO: Downloading '$ANTARES_SOLVER_ZIPFILE_NAME' in '$ANTARES_SOLVER_DIR'..." | ||
cd "$ANTARES_SOLVER_DIR" || exit | ||
wget $LINK | ||
|
||
echo "INFO: Uncompressing '$ANTARES_SOLVER_ZIPFILE_NAME'..." | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/antares-$ANTARES_SOLVER_VERSION-solver.exe" $DESTINATION | ||
mv $ANTARES_SOLVER_FOLDER_NAME/bin/sirius_solver.dll $DESTINATION | ||
mv $ANTARES_SOLVER_FOLDER_NAME/bin/zlib1.dll $DESTINATION | ||
7z x $ANTARES_SOLVER_ZIPFILE_NAME | ||
else | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/antares-$ANTARES_SOLVER_VERSION-solver" $DESTINATION | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/libsirius_solver.so" $DESTINATION | ||
tar xzf $ANTARES_SOLVER_ZIPFILE_NAME | ||
fi | ||
rm $ANTARES_SOLVER_ZIPFILE_NAME | ||
|
||
echo "Copy basic configuration files" | ||
cp -r ../resources/deploy/* ../dist/ | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
sed -i "s/700: path\/to\/700/$ANTARES_SOLVER_FULL_VERSION_INT: .\/AntaresWeb\/antares_solver\/antares-$ANTARES_SOLVER_VERSION-solver.exe/g" ../dist/config.yaml | ||
echo "INFO: Moving executables in '$ANTARES_SOLVER_DIR'..." | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/antares-$ANTARES_SOLVER_VERSION-solver.exe" "$ANTARES_SOLVER_DIR" | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/sirius_solver.dll" "$ANTARES_SOLVER_DIR" | ||
mv "$ANTARES_SOLVER_FOLDER_NAME/bin/zlib1.dll" "$ANTARES_SOLVER_DIR" | ||
rm -rf $ANTARES_SOLVER_FOLDER_NAME | ||
fi | ||
|
||
echo "INFO: Copying basic configuration files..." | ||
rm -rf "${DIST_DIR}/examples" # in case of replay | ||
cp -r "${RESOURCES_DIR}"/deploy/* "${DIST_DIR}" | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
sed -i "s/700: path\/to\/700/$ANTARES_SOLVER_FULL_VERSION_INT: .\/AntaresWeb\/antares_solver\/antares-$ANTARES_SOLVER_VERSION-solver.exe/g" "${DIST_DIR}/config.yaml" | ||
else | ||
sed -i "s/700: path\/to\/700/$ANTARES_SOLVER_FULL_VERSION_INT: .\/AntaresWeb\/antares_solver\/antares-$ANTARES_SOLVER_VERSION-solver/g" ../dist/config.yaml | ||
sed -i "s/700: path\/to\/700/$ANTARES_SOLVER_FULL_VERSION_INT: .\/AntaresWeb\/antares_solver\/antares-$ANTARES_SOLVER_VERSION-solver/g" "${DIST_DIR}/config.yaml" | ||
fi | ||
|
||
echo "Creating shortcuts" | ||
echo "INFO: Creating shortcuts..." | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
cp ../resources/AntaresWebServerShortcut.lnk ../dist/ | ||
cp "${RESOURCES_DIR}/AntaresWebServerShortcut.lnk" "${DIST_DIR}" | ||
else | ||
echo "INFO: Updating executable permissions..." | ||
for excutable in "${DIST_DIR}/AntaresWeb/AntaresWebServer" "${DIST_DIR}/AntaresWeb/AntaresTool" "${DIST_DIR}/AntaresWebWorker"; do | ||
chmod +x "${excutable}" | ||
done | ||
fi | ||
|
||
echo "Unzipping example study" | ||
cd ../dist/examples/studies || exit | ||
7z x example_study.zip | ||
echo "INFO: Unzipping example study..." | ||
cd "${DIST_DIR}/examples/studies" || exit | ||
if [[ "$OSTYPE" == "msys"* ]]; then | ||
7z x example_study.zip | ||
else | ||
unzip -q example_study.zip | ||
fi | ||
rm example_study.zip | ||
|
||
echo "Cleaning up" | ||
rm $ANTARES_SOLVER_ZIPFILE_NAME | ||
rm -rf $ANTARES_SOLVER_FOLDER_NAME | ||
echo "INFO: Antares Web Packaging DONE." |