Start Task
Getting Started
Command Line
Below CMD will remove newline charactor that come from Windows first and then
it will execute the start task file with bash
.
Start Task File
Examples
start_task.sh
#!/bin/bash
echo 'Set Python 3.10' &&
sudo update-alternatives --set python3 /usr/bin/python3.10 || echo 'Skipped: Set Python 3.10' &&
echo '########## Add PPA Repository ##########' &&
sudo apt update &&
sudo add-apt-repository ppa:deadsnakes/ppa || echo 'Skipped: Add Repository' &&
echo '########## Install Python V3.8 ##########' &&
sudo apt -y install python3.8 || echo 'Skipped: Install Python 3.8' &&
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 &&
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 &&
sudo update-alternatives --set python3 /usr/bin/python3.8 &&
python3 --version &&
sudo apt -y install python3-pip &&
sudo apt -y install python3.8-distutils &&
python3 -m pip install --upgrade pip &&
echo '########## Start Install Python Library ##########' &&
pip3 install backports.zoneinfo &&
pip3 install azure-storage-file-datalake==12.4.0 &&
pip3 install azure-keyvault-secrets==4.3.0 &&
pip3 install azure-identity==1.6.1 &&
pip3 install cffi==1.16.0 &&
pip install google-cloud-bigquery==3.13.0 &&
pip install pandas_gbq==0.17.0 &&
pip install pandas==2.0.3 &&
pip install pyarrow==14.0.1 &&
pip install -U pytz
start_task.sh
#!/bin/bash
echo 'Set Python 3.10' &&
sudo update-alternatives --set python3 /usr/bin/python3.10 || echo 'Skipped: Set Python 3.10' &&
echo '########## Add PPA Repository ##########' &&
sudo apt update &&
sudo add-apt-repository ppa:deadsnakes/ppa || echo 'Skipped: Add Repository' &&
echo '########## Install Python V3.8 ##########' &&
sudo apt -y install python3.8 || echo 'Skipped: Install Python 3.8' &&
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 &&
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 &&
sudo update-alternatives --set python3 /usr/bin/python3.8 &&
python3 --version &&
sudo apt -y install python3-pip &&
sudo apt -y install python3.8-distutils &&
python3 -m pip install --upgrade pip &&
echo '########## Start Install Python Library ##########' &&
echo $(date -u) &&
sudo pip install --upgrade pip &&
sudo pip install uv &&
sudo uv pip install --system backports.zoneinfo &&
sudo uv pip install --system azure-storage-file-datalake==12.4.0 &&
sudo uv pip install --system azure-keyvault-secrets==4.3.0 &&
sudo uv pip install --system azure-identity==1.6.1 &&
sudo uv pip install --system cffi==1.16.0 &&
sudo uv pip install --system google-cloud-bigquery==3.13.0 &&
sudo uv pip install --system pandas_gbq==0.17.0 &&
sudo uv pip install --system pandas==2.0.3 &&
sudo uv pip install --system pyarrow==14.0.1 &&
sudo uv pip install --system -U pytz
echo $(date -u) "End of Python Library installation"
start_task.sh
#!/bin/bash
echo '########## Installing Python 3.11 on Ubuntu 22.04 by using the PPA repository ##########' &&
sudo apt install python3-apt --fix-missing &&
sudo apt update &&
sudo add-apt-repository ppa:deadsnakes/ppa || echo 'Skipped: Add Repository' &&
sudo apt -y install python3.11 &&
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 &&
sudo update-alternatives --config python3 &&
sudo apt install python-is-python3 &&
python --version &&
echo '########## Install Extras for Python 3.11 ##########' &&
sudo apt-get install python3.11-full -y &&
sudo apt-get install python3-pip -y &&
sudo python3 -m pip install --upgrade pip &&
echo '########## Setting ODBC Libs ##########' &&
sudo curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&
sudo curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list &&
sudo apt-get update &&
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 &&
echo '--- Done: msodbcsql17' &&
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools &&
echo '--- Done: mssql-tools' &&
echo 'export PATH=\"$PATH:/opt/mssql-tools/bin\"' >> ~/.bashrc &&
source ~/.bashrc
Note
install_msodbcsql17.sh
if ! [[ "16.04 18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
# Optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# Optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
Reference from How to Install Microsoft ODBC Driver for SQL Server on Ubuntu