First Steps¶
To get started, you’ll first need to clone the repository, which contains essential scripts for various operating systems. After cloning, you will use these scripts to install the necessary foundational software. Finally, you will complete the repository-specific installation to set up your environment correctly. Detailed instructions for each of these steps are provided below.
Cloning the Repository¶
Start by cloning the io-avstats repository. This repository contains essential scripts and configurations needed for the project.
git clone https://github.com/io-aero/io-avstats
Install Foundational Software¶
Once you have successfully cloned the repository, navigate to the cloned directory. Within the scripts folder, you will find scripts tailored for various operating systems. Proceed with the subsection that corresponds to your operating system for further instructions.
Ubuntu¶
To set up the project on an Ubuntu system, the following steps should be performed in a terminal window within the repository directory:
a. Grant Execute Permission to Installation Scripts¶
Provide execute permissions to the installation scripts:
chmod +x scripts/*.sh
b. Install Python and pip¶
Run the script to install Python and pip:
./scripts/run_install_python.sh
c. Install Miniconda and the Correct Python Version¶
Use the following script to install Miniconda and set the right Python version:
./scripts/run_install_miniconda.sh
d. Install Docker Desktop¶
This step is not required for WSL (Windows Subsystem for Linux) if Decker Desktop is installed in Windows and this is configured for WSL 2 based engine.
To install Docker Desktop, run:
./scripts/run_install_docker.sh
e. Optionally Install DBeaver¶
If needed, install DBeaver using the following script:
./scripts/run_install_dbeaver.sh
f. Close the Terminal Window¶
Once all installations are complete, close the terminal window.
Windows 10/11¶
To set up the project on a Windows 10/11 system, the following steps should be performed in a command prompt (cmd) within the repository directory:
a. Install Python and pip¶
Run the script to install Python and pip:
scripts/run_install_python.bat
b. Install Miniconda and the Correct Python Version¶
Use the following script to install Miniconda and set the right Python version:
scripts/run_install_miniconda.bat
c. Close the Command Prompt¶
Once all installations are complete, close the command prompt.
d. Install Docker Desktop¶
To install Docker Desktop, download the software from here:
and follow the installation instructions.
e. Optionally Install DBeaver¶
If needed, install DBeaver, download the software from here:
and follow the installation instructions.
Repository-Specific Installation¶
After installing the basic software, you need to perform installation steps specific to the io-avstats repository. This involves setting up project-specific dependencies and environment configurations. To perform the repository-specific installation, the following steps should be performed in a command prompt or a terminal window (depending on the operating system) the repository directory.
Setting Up the Python Environment¶
To begin, you’ll need to set up the Python environment using Miniconda, which is already pre-installed. You can use the provided Makefile for managing the environment.
a. For production use, run the following command:¶
make conda-prod
b. For software development, use the following command:¶
make conda-dev
These commands will create and configure a virtual environment for your Python project, ensuring a clean and reproducible development or production environment. The virtual environment is automatically activated by the Makefile, so you don’t need to activate it manually.
System Testing with Unit Tests¶
If you have previously executed make conda-dev, you can now perform a system test to verify the installation using make test. Follow these steps:
a. Run the System Test:¶
Execute the system test using the following command:
make tests
This command will initiate the system tests using the previously installed components to verify the correctness of your installation.
b. Review the Test Results:¶
After the tests are completed, review the test results in the terminal. Ensure that all tests pass without errors.
If any tests fail, review the error messages to identify and resolve any issues with your installation.
Running system tests using make tests is a valuable step to ensure that your installation is working correctly, and your environment is properly configured for your project. It helps identify and address any potential problems early in the development process.
Downloading Database Files (Optional)¶
Database files can be downloaded from the IO-Aero Google Drive directory io_aero_data/io-avstats/database/io_avstats_db to your local repository directory data. Before extracting, if a postgres directory exists within the data directory, it should be deleted.
Follow these steps to manage the database files:
a. Access the IO-Aero Google Drive Directory:¶
Navigate to the IO-Aero Google Drive and locate the directory io_aero_data/TO DO/database/TO DO.
b. Download Database Files:¶
Download the necessary database files from the specified directory to your local repository directory data.
c. Delete Existing postgres Directory (if present):¶
If a directory named postgres already exists within the data directory, you should delete it to avoid conflicts.
d. Extract Database Files:¶
The downloaded database files are in an archive format (ZIP) and should be extracted in the data directory. After completing these steps, the database files should reside in the data directory of your local repository and will be ready for use.
Creating the Docker Container with PostgreSQL DB¶
To create the Docker container with PostgreSQL database software, you can use the provided run_io_avstats script. Depending on your operating system, follow the relevant instructions below:
a. Ubuntu (sh):¶
./scripts/run_io_avstats.sh s_d_c
b. Windows 10/11 (cmd):¶
scripts\run_io_avstats.cmd s_d_c
These commands will initiate the process of creating the Docker container with PostgreSQL database software.