Skip to content

Commit

Permalink
update to miniforge (#20)
Browse files Browse the repository at this point in the history
 updated to miniforge
  • Loading branch information
ReimarBauer authored Feb 22, 2024
1 parent 32cdb28 commit 5ecfcf9
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 71 deletions.
92 changes: 46 additions & 46 deletions .github/workflows/test_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,54 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mambaforge+MSS
- name: Install miniforge+MSS
run: |
cd $GITHUB_WORKSPACE
chmod +x LinuxMac.sh
./LinuxMac.sh -a
- name: Test MSS installed by direct call
run: |
/home/runner/mambaforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
/home/runner/Miniforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
- name: Test MSS installed in activated env
run: |
. /home/runner/mambaforge/etc/profile.d/conda.sh
. /home/runner/mambaforge/etc/profile.d/mamba.sh
. /home/runner/Miniforge/etc/profile.d/conda.sh
. /home/runner/Miniforge/etc/profile.d/mamba.sh
mamba init
mamba activate mssenv
msui --version | grep "Mission Support System (MSS)"
install-mss-on-existing-linux-mambaforge-installation:
install-mss-on-existing-linux-miniforge-installation:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3
- name: Install mambaforge by curl(1/3)
- uses: actions/checkout@v4
- name: Install miniforge by curl(1/3)
run: |
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" --output mambaforge.sh
chmod +x mambaforge.sh
script -q -c "./mambaforge.sh -u -b -p ~/mambaforge"
eval "$(/home/runner/mambaforge/bin/conda shell.bash hook)"
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" --output miniforge.sh
chmod +x miniforge.sh
script -q -c "./miniforge.sh -u -b -p ~/Miniforge"
eval "$(/home/runner/Miniforge/bin/conda shell.bash hook)"
mamba init
- name: check mamba info(2/3)
run: |
eval "$(/home/runner/mambaforge/bin/conda shell.bash hook)"
eval "$(/home/runner/Miniforge/bin/conda shell.bash hook)"
mamba info
- name: Install MSS by LinuxMac.sh -a (3/3)
run: |
eval "$(/home/runner/mambaforge/bin/conda shell.bash hook)"
eval "$(/home/runner/Miniforge/bin/conda shell.bash hook)"
cd $GITHUB_WORKSPACE
chmod +x LinuxMac.sh
./LinuxMac.sh -a
- name: Test MSS installed
run: |
/home/runner/mambaforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
/home/runner/Miniforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
install-mss-on-macos-from-scratch:
Expand All @@ -74,67 +74,67 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mambaforge+MSS
- name: Install miniforge+MSS
run: |
cd $GITHUB_WORKSPACE
chmod +x LinuxMac.sh
./LinuxMac.sh -a
- name: Test MSS installed
run: |
/Users/runner/mambaforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
/Users/runner/Miniforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
install-mss-on-existing-macos-mambaforge-installation:
install-mss-on-existing-macos-miniforge-installation:
runs-on: macos-latest

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v3
- name: Install mambaforge by curl(1/3)
- uses: actions/checkout@v4
- name: Install miniforge by curl(1/3)
run: |
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh" --output mambaforge.sh
chmod +x mambaforge.sh
script -q output.txt ./mambaforge.sh -u -b -p ~/mambaforge
eval "$(/Users/runner/mambaforge/bin/conda shell.bash hook)"
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh" --output miniforge.sh
chmod +x miniforge.sh
script -q output.txt ./miniforge.sh -u -b -p ~/Miniforge
eval "$(/Users/runner/Miniforge/bin/conda shell.bash hook)"
mamba init
- name: check mamba info(2/3)
run: |
eval "$(/Users/runner/mambaforge/bin/conda shell.bash hook)"
eval "$(/Users/runner/Miniforge/bin/conda shell.bash hook)"
mamba info
- name: Install MSS by LinuxMac.sh -a (3/3)
run: |
eval "$(/Users/runner/mambaforge/bin/conda shell.bash hook)"
eval "$(/Users/runner/Miniforge/bin/conda shell.bash hook)"
cd $GITHUB_WORKSPACE
chmod +x LinuxMac.sh
./LinuxMac.sh -a
- name: Test MSS installed
run: |
/Users/runner/mambaforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
/Users/runner/Miniforge/envs/mssenv/bin/msui --version | grep "Mission Support System (MSS)"
install-mss-on-windows-from-scratch:
runs-on: windows-latest
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mambaforge+MSS (1/2) (needs new shell to recognise mamba)
- name: Install miniforge+MSS (1/2) (needs new shell to recognise mamba)
run: |
cd %GITHUB_WORKSPACE%
Windows.bat -a
- name: Install mambaforge+MSS (2/2)
- name: Install miniforge+MSS (2/2)
run: |
cd %GITHUB_WORKSPACE%
set PATH=%PATH%;%USERPROFILE%\mambaforge\condabin
set PATH=%PATH%;%USERPROFILE%\Miniforge\condabin
Windows.bat -a
- name: Test MSS installed
run: |
set PATH=%PATH%;%USERPROFILE%\mambaforge\condabin
set PATH=%PATH%;%USERPROFILE%\Miniforge\condabin
call conda.bat activate mssenv
msui --version | findstr /i /c:"Mission Support System (MSS)"
Expand All @@ -145,41 +145,41 @@ jobs:
run:
shell: powershell
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mambaforge by curl(1/2)
- name: Install miniforge by curl(1/2)
run: |
curl.exe -fsSLo mambaforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe
Start-Process .\mambaforge.exe -Wait -ArgumentList "/InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=$($env:USERPROFILE)\mambaforge"
curl.exe -fsSLo miniforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
Start-Process .\miniforge.exe -Wait -ArgumentList "/InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=$($env:USERPROFILE)\Miniforge"
- name: check mamba info(2/2)
run: |
$env:Path += ";$($env:USERPROFILE)\mambaforge\condabin"
$env:Path += ";$($env:USERPROFILE)\Miniforge\condabin"
mamba info
install-mss-on-existing-windows-mambaforge-installation:
install-mss-on-existing-windows-miniforge-installation:
runs-on: windows-latest
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install mambaforge by curl(1/3)
- name: Install miniforge by curl(1/3)
run: |
curl.exe -fsSLo mambaforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe
start /wait "" mambaforge.exe /InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=%USERPROFILE%\mambaforge
curl.exe -fsSLo miniforge.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe
start /wait "" miniforge.exe /InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=%USERPROFILE%\Miniforge
- name: check mamba info(2/3)
run: |
set PATH=%PATH%;%USERPROFILE%\mambaforge\condabin
set PATH=%PATH%;%USERPROFILE%\Miniforge\condabin
mamba info
- name: Install MSS by Windows.bat -a (3/3)
run: |
set PATH=%PATH%;%USERPROFILE%\mambaforge\condabin
set PATH=%PATH%;%USERPROFILE%\Miniforge\condabin
Windows.bat -a
- name: Test MSS installed
run: |
set PATH=%PATH%;%USERPROFILE%\mambaforge\condabin
set PATH=%PATH%;%USERPROFILE%\Miniforge\condabin
call conda.bat activate mssenv
msui --version | findstr /i /c:"Mission Support System (MSS)"
Expand Down
32 changes: 16 additions & 16 deletions LinuxMac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ completeSize=4 # integer
mssSize=2 # integer

echo "
We recommend to start from Mambaforge for the MSS installation.
We recommend to start from Miniforge for the MSS installation.
Mambaforge comes with the popular conda-forge channel preconfigured, but you can modify the configuration to use any channel you like.
Miniforge comes with the popular conda-forge channel preconfigured, but you can modify the configuration to use any channel you like.
The next steps are to check for an existing Mambaforge Installation.
The next steps are to check for an existing Miniforge Installation.
If possible we try to:
install MambaForge including mamba then Create a mssenv then Install MSS.
install Miniforge including mamba then Create a mssenv then Install MSS.
"

sleep 2
Expand All @@ -64,8 +64,8 @@ fi
sleep 2


# neither conda nor mamba -> mambaforge
which mamba || { echo "Downloading mambaforge..." &&
# neither conda nor mamba -> Miniforge
which mamba || { echo "Downloading Miniforge..." &&
if [[ $unameOS = "MacOSX" ]]
then
freespace=$(df -g . | tail -1 | awk '{print $4+0}')
Expand All @@ -75,20 +75,20 @@ which mamba || { echo "Downloading mambaforge..." &&
if [[ $freespace -lt $completeSize ]]; then
echo "Aborting. You need at least $completeSize GB of space to install mamba and MSS" && exit 1;
fi &&
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-${unameOS}-${architectureOS}.sh" --output mambaforge-installer.sh &&
ls -l mambaforge-installer.sh &&
echo "Installing mambaforge..." &&
chmod +x mambaforge-installer.sh &&
curl -L0 "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-${unameOS}-${architectureOS}.sh" --output miniforge-installer.sh &&
ls -l miniforge-installer.sh &&
echo "Installing miniforge..." &&
chmod +x miniforge-installer.sh &&

if [[ $unameOS = "MacOSX" ]]
then
if [[ $automatic = "No" ]]; then script -q output.txt ./mambaforge-installer.sh -u; else script -q output.txt ./mambaforge-installer.sh -u -b -p ~/mambaforge; fi
if [[ $automatic = "No" ]]; then script -q output.txt ./miniforge-installer.sh -u; else script -q output.txt ./miniforge-installer.sh -u -b -p ~/Miniforge; fi
else
if [[ $automatic = "No" ]]; then script -q -c "./mambaforge-installer.sh -u" output.txt; else script -q -c "./mambaforge-installer.sh -u -b -p ~/mambaforge" output.txt; fi
if [[ $automatic = "No" ]]; then script -q -c "./miniforge-installer.sh -u" output.txt; else script -q -c "./miniforge-installer.sh -u -b -p ~/Miniforge" output.txt; fi
fi && cat output.txt &&
location=$(< output.txt grep "PREFIX=" | tr -d "[:cntrl:]" | sed -e "s/.*PREFIX=//g") && rm output.txt &&
if [[ "$location" != "" ]]; then . "$location/etc/profile.d/conda.sh" && . "$location/etc/profile.d/mamba.sh" & export PATH="$location/bin:$PATH" && mamba init; else . "$HOME/.bashrc"; fi
if [[ "$SHELL" = *zsh ]]; then conda init zsh; fi && rm mambaforge-installer.sh &&
if [[ "$SHELL" = *zsh ]]; then conda init zsh; fi && rm miniforge-installer.sh &&
which mamba || { echo "mamba still not found, please restart your console and try again"; exit 1; }
}

Expand All @@ -102,8 +102,9 @@ echo "mamba installed"
if [[ $freespace -lt $mssSize ]]; then
echo "Aborting. You need at least $mssSize GB of space to install mamba and MSS" && exit 1;
fi &&
. "$HOME/mambaforge/etc/profile.d/conda.sh" &&
. "$HOME/mambaforge/etc/profile.d/mamba.sh" &&
echo $HOME
. "$HOME/Miniforge/etc/profile.d/conda.sh" &&
. "$HOME/Miniforge/etc/profile.d/mamba.sh" &&
mamba init &&
mamba update -n base mamba -y && # update mamba to the newest version
mamba activate mssenv || {
Expand All @@ -114,7 +115,6 @@ echo "mamba installed"

echo "Installing MSS..."
mamba install mss python -y
"$HOME/mambaforge/bin/conda" init
mamba clean --all -y
mamba list -f mss | grep "conda-forge" || { echo "MSS was not successfully installed, aborting"; exit 1; }
echo "To start msui from the MSS Software,"
Expand Down
18 changes: 9 additions & 9 deletions Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ if "%1"=="a" (set automatic=a) else (if "%1"=="-a" (set automatic=a) else (set a
if "%2"=="retry" (set retry=retry) else (set retry=No)
set script=%~f0

echo We recommend to start from Mambaforge for the MSS installation.
echo Mambaforge comes with the popular conda-forge channel preconfigured,
echo We recommend to start from miniforge for the MSS installation.
echo miniforge comes with the popular conda-forge channel preconfigured,
echo but you can modify the configuration to use any channel you like.
echo The next steps are to check for an existing Installation.
echo If possible we try to:
echo install MambaForge including mamba then Create a mssenv then Install MSS.
echo install Miniforge including mamba then Create a mssenv then Install MSS.


echo Checking existing Anaconda/Miniconda installs not in path...
Expand All @@ -53,18 +53,18 @@ if %errorlevel% == 0 (goto mambainstalled)

:installmamba
wmic LogicalDisk where "DeviceID='%USERPROFILE:~0,2%' and FreeSpace > 4000" get FreeSpace 2>&1 >nul || (echo You need at least 4GB of space to install mamba and MSS, aborting. & pause & exit /B 1)
echo Downloading mambaforge...
echo Downloading miniforge...
echo =========================

if "%retry%"=="retry" (echo Mamba still not found after installation, aborting & pause & exit /B 1)
if "%retry%"=="retry" (echo Mamba still not found after installation, do start a new miniforge shell and do try again, aborting & pause & exit /B 1)
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OSBIT=32BIT || set OSBIT=64BIT
if %OSBIT%==64BIT curl -L0 https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe --output mambaforge.exe
echo Installing mambaforge (Enable: Register Mambaforge as my default Python and add it to the path
if %OSBIT%==64BIT curl -k -L0 https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe --output miniforge.exe
echo Installing miniforge (Enable: Register miniforge as my default Python and add it to the path
echo ==============================================================================================

if "%automatic%"=="a" (start /wait "" mambaforge.exe /InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=%USERPROFILE%\mambaforge) else (start /wait "" mambaforge.exe)
if "%automatic%"=="a" (start /wait "" miniforge.exe /InstallationType=JustMe /RegisterPython=1 /AddToPath=1 /S /D=%USERPROFILE%\miniforge) else (start /wait "" miniforge-installer.exe)

del "mambaforge.exe"
del "miniforge.exe"

start /i /b %script% %automatic% retry & exit 0

Expand Down

0 comments on commit 5ecfcf9

Please sign in to comment.