diff --git a/bash_scripts/create_conda_env.sh b/bash_scripts/create_conda_env.sh new file mode 100644 index 0000000..900a09a --- /dev/null +++ b/bash_scripts/create_conda_env.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Check if the accelerator argument is provided +if [ -z "$1" ]; then + echo "Usage: $0 " + echo "Available options for : tpu, gpu, cpu" + exit 1 +fi + +ACCELERATOR=$1 + +# Activate Conda +source ~/miniconda3/etc/profile.d/conda.sh + +# Create a new Conda environment +conda create -n stx python=3.10 -y + +# Activate the environment +conda activate stx + +# Install packages with pip +pip install -e . + +# Install JAX with the appropriate accelerator support +if [ "$ACCELERATOR" == "tpu" ]; then + pip install -U "jax[tpu]" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html +elif [ "$ACCELERATOR" == "gpu" ]; then + pip install -U "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html +elif [ "$ACCELERATOR" == "cpu" ]; then + pip install -U jax +else + echo "Invalid accelerator type: $ACCELERATOR" + echo "Available options: tpu, gpu, cpu" + exit 1 +fi + +echo "Installation complete with $ACCELERATOR support." diff --git a/bash_scripts/install_conda.sh b/bash_scripts/install_conda.sh new file mode 100644 index 0000000..bbbe038 --- /dev/null +++ b/bash_scripts/install_conda.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status +set -e + +# Step 1: Download Miniconda +CONDA_INSTALLER="Miniconda3-latest-Linux-x86_64.sh" +CONDA_URL="https://repo.anaconda.com/miniconda/$CONDA_INSTALLER" + +echo "Downloading Miniconda installer..." +if ! wget -q --show-progress "$CONDA_URL"; then + echo "Error: Failed to download Miniconda installer." + exit 1 +fi + +# Step 2: Install Miniconda (silently with default settings) +echo "Installing Miniconda..." +bash "$CONDA_INSTALLER" -b + +# Clean up the installer after installation +rm -f "$CONDA_INSTALLER" + +# Step 3: Initialize Conda (Assuming bash shell) +CONDA_PATH="$HOME/miniconda3" + +# Ensure Conda is initialized on every new shell +if ! grep -q "source $CONDA_PATH/etc/profile.d/conda.sh" ~/.bashrc; then + echo "source $CONDA_PATH/etc/profile.d/conda.sh" >> ~/.bashrc + echo "Conda initialization added to .bashrc" +fi + +# Apply the .bashrc changes to the current shell session +echo "Initializing Conda for the current shell..." +source "$CONDA_PATH/etc/profile.d/conda.sh" + +echo "Miniconda installation and initialization complete." + +# Optional: Update conda to the latest version +echo "Updating Conda to the latest version..." +conda update -n base -c defaults conda -y diff --git a/bash_scripts/run-algorithms.sh b/bash_scripts/run-algorithms.sh index c4cee0a..3aabdb4 100644 --- a/bash_scripts/run-algorithms.sh +++ b/bash_scripts/run-algorithms.sh @@ -1,5 +1,7 @@ #!/bin/bash +# A simple script to run various algorithms - used for testing purposes + echo "Running All Algorithms..." python stoix/systems/ppo/anakin/ff_ppo.py arch.total_timesteps=300 arch.total_num_envs=8 arch.num_evaluation=1 system.rollout_length=8