Skip to content

Latest commit

 

History

History
81 lines (57 loc) · 6.05 KB

Workflow.md

File metadata and controls

81 lines (57 loc) · 6.05 KB
Updated: +v1.1.3

The Tree-of-Life's Workflow

Tree-of-Life is designed to serve Python-based or Python-dependent projects. Once executed, it installs a system independent Python distribution (using Miniconda) and the required Python libraries (dependencies) of the host project. Also, its architecture allows the developer to write the project's executable files that are configured accordingly to the project's dependencies and consequently made available for the user after installation.

Read on how to implement Tree-of-Life in your project here.

Installation

The aim of Tree-of-Life is to setup the host project in the users' computer with the minimum effort from the user by providing double-click (or single-run) installation:

python tree_of_life.py

Tree-of-Life aims to be platform independent, it should run where ever Python can run. Python itself provides a excellent interface between developers and the different OS platforms; therefore, Tree-of-Life is written fully in Python an is compatible with Python 2.7 and 3.x series. I consider safe to rely on Python because nowadays (year 2018) virtually every computer has Python installed and the above command can be executed straightforwardly. Installing Python from scratch in the user's computer lies outside this project.

If you are a developer, you are invited to read the tree_of_life.py file to understand its workflow from the developer's point of view.

From the user's point of view, the installation workflow is as follows:

  1. Queries user if to install the Python-dependencies automatically or manually.
    1. If, automatic (recommended):
      1. checks available disk space
      2. checks if previous Miniconda installation exists
      3. Installs the latest version of Miniconda locally in the projects folder and according to the user's platform
      4. installs the project's Python ENV as described in the yml file inside the install folder
    2. If, manual (proficient Python users):
      1. warns the user that he/she must install the required dependencies manually
      2. Does NOT install any Python packages
  2. Creates the executable files following the executables.py file
    1. executable files are linked to the project's Python dependencies via shebang
    2. the shebang is defined in agreement to the first main query:
      1. if Miniconda and the Python ENV were installed automatically, shebangs will point to that env
      2. if the user decided to install the Python dependencies manually, the shebangs will point to the current Python executable
      3. In manuall installations, shebangs must also be configured by the user to point to the correct Python environment, in case the proficient user wants to use shebangs at all.
    3. exec files are given executable permissions system wide. If you want to restrict exec files permissions you can alter those after installation.
  3. Creates the installation_vars.py file. This file registers all installation variables that are required for updating purposes. If this file is removed or altered manually, future updates will fail an can compromise the whole installation.
  4. All installation output regarding information and debugging purposes is written to a .log file.

Updater

Tree-of-Life provides an updater script to allow the user to keep up to date with the host project's latest version. The updater is part of the executable files and is created during the installation process inside the bin folder.

The updater was designed to keep the user's installation up to date with the developers GitHub project. But, by no means it restricts a GitHub repository; by default, the updater simply requires a web link to a ZIP file containing the project. (for developers) You can read the updater workflow in the update_script_code variable inside executables.py.

From the user's point of view, the update routines are as follow:

  1. Downloads the latest version of the software
  2. Unpacks it to a temporary folder
  3. Removes the previous version (its folders)
  4. files that do not belong to the project but are stored in the main project folder are NOT removed during update.
  5. Moves the new version files to the project installation folder
  6. If the installation was performed in automatic mode:
    1. checks if the ENV needs to be updated, if yes, updates it
  7. Rebuilds the executable files. In this way, these are also updated
  8. Rebuilds the installations_vars.py
  9. All updater output regarding information and debugging purposes is written to a .log file.

Read more on the updater script here.

The executable files

By design, Tree-of-Life considers the host project's executable files as Python scripts.

Tree-of-Life is designed to serve Python-based or Python-dependent projects.

But this is definitively not mandatory and can be easily adapted to fit other needs.

Tree-of-Life uses shebangs to point the executable files to the project's Python ENV, that is, to the correct Python interpreter.

For UNIX systems the executable files are created without extension, so that the user is naturally driven to execute them as follows:

.bin/exec_1

On Windows, executable files are created with the .py extension (by default). However, they should not be executed with $ python exec_1.py, because in this way the called Python interpreter will prevail in disregard of the shebang. You should warn the users to use $ exec_1.py directly, so that the system will use the Python ENV pointed by the shebang.