-
Notifications
You must be signed in to change notification settings - Fork 15
Setting Up a Single‐Node DMOD Deployment
Install dependencies, starting with Usage Dependencies. That process isn't universal. For Linux environments, most of them can be installed using the OS package manager (e.g., zypper
in openSUSE):
# Also, go ahead (heh) and get the Go and Make dependencies that the deployx plugin needs below
sudo zypper install bash docker docker-compose git-core openssl go make
Note
Package names may vary slightly across different OS/distributions.
Important
Depending on your system, you may need add your user (and/or others) to the docker
user group.
After Docker is installed, you can install a required, custom Docker plugin: deployx. That repo provides its own instructions, but it will likely look something like this:
# Move to an appropriate development directory in which to clone the plugin repo
cd <dev_dir>
# Clone the repo and move to it
git clone https://github.com/aaraney/deployx.git && cd deployx
# Build and install the plugin for your user
make build && make install
Then install the OS-level Development Dependencies (technically only strictly required if doing development). As with Usage Dependencies, this isn't universally described, but the OS-level dependencies can usually be handled on a Linux machine with a command similar to:
sudo zypper install python311 python311-devel python311-pip gcc-c++
Note
If you are not using a Python virtual environment, you could proceed with installing Python dependencies now in the global environment. We don't suggest this, though, so we'll wait for that step until after the repo directory is cloned and we have our venv/
directory.
Now we clone the DMOD repo to a local directory:
# Replace <repo_url> with that of either a fork or the main upstream repo (https://github.com/NOAA-OWP/DMOD.git).
# Likewise, replace <repo_local_dir> with the local destination directory, which does not need to already exist.
git clone <repo_url> <repo_local_dir>
# Then enter the repo dir (remaining examples assume running from this directory, unless otherwise noted)
cd <repo_local_dir>
While not strictly required, it is highly suggested you create a virtual environment for Python after the Python development dependency is installed. The rest of this walkthrough assumes this was done. Once that is done, a helper script is available to update or install the Python packages as needed within the virtual environment.
Important
If necessary, replace the python
command below with either python3
, python311
, etc., depending on the version you need and how things are installed on your system.
# A reminder: this is assumed to be run from within DMOD repo directory
python -m venv venv
# Make sure to use '-D' to install just project requirements
./scripts/update_package.sh -D
As described in this section, we need to create a DMOD environment config. For most deployments, you should just be able to copy the example environment config to get started. You can modify settings at any time to suit needs once comfortable with doing so.
cp example.env .env
Note
It is recommended you use the file name .env
, as this is the default. More advanced usage of different file names and multiple files is support by most DMOD tools and scripts.
Important
There is no default config guaranteed to work in all situations. Network subnet conflicts is a particularly common reason why our selected defaults may not all be suitable for your situation. In such cases, manual editing of your .env
file will be necessary. See the details of the config item descriptions (in the example.env
, if not also copied to the .env
) to get context for the different config items.
Next, perform the necessary setup for SSL certificates for a deployment. As discussed in that document, there is a script that can essentially do the bulk of this for you:
# Will create things under a 'ssl/' dir in working directory; you could add '-d <dir_name>' to specify elsewhere
./scripts/gen_certs -init -email "[email protected]"
Important
Make sure DMOD_SSL_DIR
in the deployment config is set to the full path of the top-level SSL directory.