Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a220fd7

Browse files
committedFeb 14, 2019
Update setup.sh file to skip if the user doesn't have root access
* This change checks if current user has sudo access or not. If the current user has sudo access then script is run as before and if the current user doesn't have sudo access then skip the script. * Run setup.sh file from Notebook with the change with and without root access * With root access ``` The user has root access. SageMaker instance route table setup is ok. We are good to go. SageMaker instance routing for Docker is ok. We are good to go! ``` * Without root access ``` sudo: a password is required The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go! ```
1 parent 906427b commit a220fd7

File tree

24 files changed

+192
-0
lines changed
  • advanced_functionality
    • pytorch_extending_our_containers/utils
    • tensorflow_bring_your_own/utils
  • hyperparameter_tuning/keras_bring_your_own
  • reinforcement_learning
    • rl_cartpole_coach/common
    • rl_deepracer_robomaker_coach_gazebo/common
    • rl_hvac_coach_energyplus/common
    • rl_knapsack_coach_custom/common
    • rl_mountain_car_coach_gymEnv/common
    • rl_network_compression_ray_custom/common
    • rl_objecttracker_robomaker_coach_gazebo/common
    • rl_portfolio_management_coach_customEnv/common
    • rl_predictive_autoscaling_coach_customEnv/common
    • rl_roboschool_ray/common
    • rl_roboschool_stable_baselines/common
    • rl_traveling_salesman_vehicle_routing_coach/common
  • sagemaker-python-sdk

24 files changed

+192
-0
lines changed
 

‎advanced_functionality/pytorch_extending_our_containers/utils/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎advanced_functionality/tensorflow_bring_your_own/utils/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎hyperparameter_tuning/keras_bring_your_own/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_cartpole_coach/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_deepracer_robomaker_coach_gazebo/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_hvac_coach_energyplus/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_knapsack_coach_custom/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_mountain_car_coach_gymEnv/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_network_compression_ray_custom/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_objecttracker_robomaker_coach_gazebo/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_portfolio_management_coach_customEnv/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_predictive_autoscaling_coach_customEnv/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_roboschool_ray/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_roboschool_stable_baselines/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎reinforcement_learning/rl_traveling_salesman_vehicle_routing_coach/common/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/chainer_mnist/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/mxnet_gluon_cifar10/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/mxnet_gluon_mnist/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/mxnet_mnist/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/pytorch_cnn_cifar10/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/tensorflow_distributed_mnist/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/tensorflow_iris_dnn_classifier_using_estimators/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/tensorflow_script_mode_quickstart/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

‎sagemaker-python-sdk/tensorflow_script_mode_using_shell_commands/setup.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
sudo -n true
4+
if [ $? -eq 0 ]; then
5+
echo "The user has root access."
6+
else
7+
echo "The user does not have root access. Everything required to run the notebook is already installed and setup. We are good to go!"
8+
exit 0
9+
fi
10+
311
# Do we have GPU support?
412
nvidia-smi > /dev/null 2>&1
513
if [ $? -eq 0 ]; then

0 commit comments

Comments
 (0)
Please sign in to comment.