-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
131 additions
and
12 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
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,34 @@ | ||
#!/bin/bash | ||
|
||
# Source .bashrc to load aliases | ||
if [ -f ~/.bashrc ]; then | ||
source ~/.bashrc | ||
fi | ||
|
||
# Print the aliases | ||
echo "Alias List with Descriptions:" | ||
echo "" | ||
echo "1. rmge ='micromamba activate rmg_env'" | ||
echo " - Activates the 'rmg_env' environment using Conda." | ||
echo "" | ||
echo "2. arce ='micromamba activate arc_env'" | ||
echo " - Activates the 'arc_env' environment using Conda." | ||
echo "" | ||
echo "3. rmg ='python-jl /home/rmguser/Code/RMG-Py/rmg.py input.py'" | ||
echo " - Runs the RMG program with 'input.py' using Python in the Julia environment." | ||
echo "" | ||
echo "4. deact ='micromamba deactivate'" | ||
echo " - Deactivates the current Micromamba environment." | ||
echo "" | ||
echo "5. rmgcode='cd /home/rmguser/Code/RMG-Py/'" | ||
echo " - Changes the current directory to the RMG-Py code directory." | ||
echo "" | ||
echo "6. rmgdb ='cd /home/rmguser/Code/RMG-database/" | ||
echo " - Changes the current directory to the RMG database directory." | ||
echo "" | ||
echo "7. arcode ='cd /home/rmguser/Code/ARC'" | ||
echo " - Changes the current directory to the ARC code directory." | ||
echo "" | ||
|
||
# Execute the command specified as CMD in Dockerfile, or the command passed to docker run | ||
exec "$@" |
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,62 @@ | ||
#!/bin/bash | ||
|
||
# Function to initialize Micromamba | ||
initialize_micromamba() { | ||
eval "$(micromamba shell hook --shell bash)" | ||
} | ||
|
||
|
||
# Function to check and adjust permissions for mounted directories | ||
check_and_adjust_permissions() { | ||
# Loop through all mounted directories | ||
for dir in /home/rmguser/*; do | ||
# Check if it's a directory | ||
if [ -d "$dir" ]; then | ||
# Adjust permissions for the directory | ||
chown -R rmguser:rmguser "$dir" | ||
fi | ||
done | ||
} | ||
|
||
# Function to run for interactive mode | ||
run_interactive() { | ||
check_and_adjust_permissions | ||
echo "Container started in interactive mode" | ||
|
||
/home/rmguser/alias_print.sh | ||
|
||
/bin/bash | ||
} | ||
|
||
# Function to run for non-interactive mode | ||
run_non_interactive() { | ||
check_and_adjust_permissions | ||
echo "Container started in non-interactive mode" | ||
initialize_micromamba | ||
|
||
case "$1" in | ||
rmg) | ||
# Activate rmg_env and run RMG with python-jl | ||
echo "Running with RMG environment..." | ||
micromamba activate rmg_env | ||
python-jl /home/rmguser/Code/RMG-Py/rmg.py "$2" | ||
;; | ||
arc) | ||
# Activate arc_env and run ARC | ||
echo "Running with ARC environment..." | ||
micromamba activate arc_env | ||
python /home/rmguser/Code/ARC/ARC.py "$2" | ||
;; | ||
*) | ||
echo "Invalid option. Please specify 'rmg' or 'arc' as the first argument." | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
# Check if the container is run in interactive mode | ||
if [ -t 0 ] && [ -t 1 ]; then | ||
run_interactive | ||
else | ||
run_non_interactive "$@" | ||
fi |