Terra project from VSI
- Python 3.7 or newer
- pipenv
- docker
- bash
- docker compose plugin (2.x)
source 'setup.env'
just terra sync
just terra run
There are a number of reasons pipenv running python 3.7 or newer may not be available, especially on older operating systems. To automatically setup pipenv in a directory for you, run just terra setup --dir {directory to install pipenv in}. This does not require elevated permissions.
just terra setup will attempt to setup pipenv using a series of different strategies:
- It will look for the Python 3 executable (
python3orpython). If this is found, it will be used to setuppipenv
- A specific python executable can be specified using the
--pythonflag
- If
pythoncannot be found, it will look for theconda3/conda/conda2executable and use that to first setup Python 3.7, and then setuppipenv
- A specific executable of conda can be specified using the
--condaflag
- If all else fails, MiniConda will be downloaded from the internet, installed, and used to first setup Python 3.7, and then setup
pipenv - If an invalid version of python or conda is detected, the download approach can be forced using the
--downloadflag. - If for some reason,
curl/wget/perl/python/rubyhave an https error downloading miniconda when using the--downloadflag, then the--conda-installflag can be used to point to a pre-downloaded version of the anaconda or miniconda installer. - Once
pipenvis setup, it should be added to yourPATHusing thelocal.envfile. This will be done for you if you answer yes to the final question at the end.
just terra up- To start redis queue (only once)just run celery- To start a celery worker (run on each worker node)just run {app} ...- To start processing job
When done
4. just shutdown celery - To shutdown all celery workers on all nodes
5. just terra down - To shutdown redis.
These commands should be run from the app's just project directory, not Terra's or VSI Common's. Running these commands from the wrong project result in the wrong directory path transformations, and the resulting just executable will probably not work.
- It is probably best to not use the system's python, if you want a portable deployment:
just terra setup --download --dir {some dir}# to setup a conda pythonjust --wrap Terra_Pipenv --rm# to remove the old pipenv
just sync# Sync your app and terrajust makeself# To create a makeself. This should calljustify terra makeselfinternallyjust terra pyinstallerjust deploy# (not optional if using singularity:) to build docker imagesjust deploy singular# (optional) If your app has this, and you want to use singularity
After makeself and pyinstaller are run, you will have a ./just project executable to run all just related tasks, and {app name} executables too. By default, the app executables should be in the same directory as the ./just executable, but may be moved by setting the TERRA_RUN_DIR environment variable in local.env (see below).
Since there is no project directory, a local.env is first searched for in the directory of the ./just executable, and loaded. After that, the current working directory is searched for a local.env file too, and loaded. This means it is possible for up to two local.env files to be loaded. In a multi-user environment, the local.env file in the ./just directory should be used for containing values to make your app run for everyone, and the other local.env for any customizations a user needs for themselves or even multiple project (in multiple directories).
./just: line 662: ./external/terra/external/vsi_common/freeze/just_wrapper: Permission denied- This happen in the very uncommon case when the
/tmpfolder hasnoexecon it. This is a form of fake security that can only lead to things breaking. - Solution: Set TMPDIR to a folder you do have exec permissions on, such as your home
- Example:
TMPDIR=~/ ./just ...
- This happen in the very uncommon case when the
sed: invalid option -- 'E'- On ancient versions of sed, only the
-roption is accepted, and does not accept the BSD compatible-Eversion of the same flag - Solution: You should no longer need to do this, it is auto detected, but setting
VSI_SED_COMPATtognudisables BSD compatibility mode. - Example:
VSI_SED_COMPAT=gnu ./just ...or uselocal.env
- On ancient versions of sed, only the