Skip to content

Commit

Permalink
feat: migrate to miniconda
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopr committed Jul 26, 2022
1 parent b21a456 commit 8e64626
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 47 deletions.
13 changes: 13 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: visualdynamics
channels:
- defaults
- conda-forge
dependencies:
- flask=2.0.3
- flask-babel==2.0.0
- flask-login==0.5.0
- flask-migrate==3.1.0
- flask-sqlalchemy==2.5.1
- python=3.7.13
- sqlalchemy=1.4.32
- waitress=2.0.0
26 changes: 0 additions & 26 deletions requirements.txt

This file was deleted.

44 changes: 23 additions & 21 deletions run
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
SHELL_NAME="${SHELL##*/}"
############################################################
# Help #
############################################################
Help() {
echo $SHELL_NAME

# Display Help
echo "How to run VisualDynamics?"
echo
Expand All @@ -23,8 +26,9 @@ StartService() {
echo ">> To end the server press Ctrl + C"
fi

source venv/bin/activate
source ./config
eval "$(/home/$USER/miniconda3/bin/conda shell.$SHELL_NAME hook)"
conda activate visualdynamics
source config

if [ $1 == 'dev' ]; then
export FLASK_ENV=development
Expand Down Expand Up @@ -53,11 +57,18 @@ InstallService() {

if [ $resp = 'Y' ] || [ $resp = 'y' ]; then
echo
chmod +x ./scripts/config.sh
source ./scripts/config.sh
# chmod +x ./scripts/config.sh
# source ./scripts/config.sh
source config

chmod +x ./scripts/pyenv.sh
source ./scripts/pyenv.sh
if [ -d "/home/$USER/miniconda3/" ]; then
echo "Miniconda found, skipping..."
else
echo "Installing Miniconda"
curl https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh > miniconda.sh
chmod +x miniconda.sh
bash miniconda.sh
fi

if [ -f "/etc/arch-release" ]; then
chmod +x ./scripts/arch-steps.sh
Expand All @@ -67,30 +78,21 @@ InstallService() {
source ./scripts/debian-steps.sh
fi

echo ">>> Initializing Python Virtual Environment"
pip3 install virtualenv > /dev/null
virtualenv venv > /dev/null

# Install and initialize our virtual environment
source venv/bin/activate

echo ">>> Installing Python deps"
# Install our project dependencies
pip3 install -r requirements.txt > /dev/null
echo ">>> Python deps installed"
echo ">>> Initializing Environment and Dependencies"
eval "$(/home/$USER/miniconda3/bin/conda shell.$SHELL_NAME hook)"
# Init and install Conda and Project Dependencies
conda env create -f ./environment.yml
conda activate visualdynamics
echo ">>> Environment and Dependencies Initialized"

echo ">>> Resetting database"
# Clear our SQLite DB

python3 clear_database.py
echo ">>> Database resetted"

echo ">>> Validating GROMACS"
chmod +x ./scripts/gromacs.sh
source ./scripts/gromacs.sh

source ./config

echo ">>> GROMACS Validated"

# Compile our app translations
Expand Down

0 comments on commit 8e64626

Please sign in to comment.