-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
executable file
·46 lines (36 loc) · 1.07 KB
/
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Check if an argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <run_python>"
echo "<run_python> should be 'yes' to run the Python script or 'no' to skip it."
exit 1
fi
# Load env
source .env
# Update the system
sudo yum update -y
# Install Amazon Corretto 22
echo "Installing Amazon Corretto 22..."
sudo rpm --import https://yum.corretto.aws/corretto.key
sudo curl -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
sudo yum install -y java-22-amazon-corretto-devel
# Install python3 and pip
echo "Installing Python 3 and pip..."
sudo yum install -y python3 python3-pip
# Verify installations
echo "Verifying installations..."
java -version
python3 --version
pip3 --version
# Create the w1 directory
echo "Creating directory 'w1'..."
mkdir -p w1
# Check if the Python script should be run
if [ "$1" == "yes" ]; then
echo "Running s3.py script..."
pip install -r requirements.txt
python3 s3.py w1 -d --max_threads 32
else
echo "Skipping the execution of the Python script."
fi
echo "Script execution completed."