<commit_before># Deploying

To deploy your code changes, generally you would:

1. Merge changes into `release` Git branch and `git push` the branch;
2. Wait for the [continuous integration system](https://dev.azure.com/shirshegsm/mediacloud/_build) to pull images, rebuild the ones that have changed, and push the updated images to [Docker Hub](https://hub.docker.com/u/dockermediacloud) repository;
3. Using either Portainer or Docker CLI, pull the updated images from the Docker Hub repository and recreate app containers for which the images have been modified.

## Ports

### Docker swarm

Hosts that participate in the same Docker swarm should be able to connect **to each other** using the [following protocols and ports](https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts):

* TCP:
  * 2376
  * 2377
  * 7946
* UDP:
  * 7946
  * 4789
* ESP (IP protocol 50)

### Webapp

Host that exposes webapp to the public will have to have the following ports open:

* TCP/80
* TCP/443

## ZFS pool

We use ZFS filesystems for storing container data on the host system (which gets mounted to each container as a bind mount):

```bash
sudo apt install -y zfsutils-linux

# SAMPLE DEPLOYMENTS ONLY: create an empty file to serve as a backing disk for a pool
sudo dd if=/dev/zero of=/zfspool bs=1G count=10
sudo chown root:root /zfspool
sudo chmod 600 /zfspool

# Create a single "space" ZFS pool for all data<commit_msg>Reformat more ports<commit_after># Deploying

To deploy your code changes, generally you would:

1. Merge changes into `release` Git branch and `git push` the branch;
2. Wait for the [continuous integration system](https://dev.azure.com/shirshegsm/mediacloud/_build) to pull images, rebuild the ones that have changed, and push the updated images to [Docker Hub](https://hub.docker.com/u/dockermediacloud) repository;
3. Using either Portainer or Docker CLI, pull the updated images from the Docker Hub repository and recreate app containers for which the images have been modified.

## Ports

### Docker swarm

Hosts that participate in the same Docker swarm should be able to connect **to each other** using the [following protocols and ports](https://docs.docker.com/engine/swarm/swarm-tutorial/#open-protocols-and-ports-between-the-hosts):

* TCP:
  * 2376
  * 2377
  * 7946
* UDP:
  * 7946
  * 4789
* ESP (IP protocol 50)

### Webapp

Host that exposes webapp to the public will have to have the following ports open:

* TCP:
  * 80
  * 443

## ZFS pool

We use ZFS filesystems for storing container data on the host system (which gets mounted to each container as a bind mount):

```bash
sudo apt install -y zfsutils-linux

# SAMPLE DEPLOYMENTS ONLY: create an empty file to serve as a backing disk for a pool
sudo dd if=/dev/zero of=/zfspool bs=1G count=10
sudo chown root:root /zfspool
sudo chmod 600 /zfspool

# Create a single "space" ZFS pool for all data
{'fraction_non_alphanumeric': 0.08073896681491619, 'fraction_numerical': 0.024632227163872734, 'mean_word_length': 4.212121212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2604984', 'n_tokens_mistral': 986, 'n_tokens_neox': 865, 'n_words': 396}