Skip to content

Commit

Permalink
docker-compose -> docker compose
Browse files Browse the repository at this point in the history
Signed-off-by: Gary White Jr <[email protected]>
  • Loading branch information
GaryPWhite committed Feb 19, 2024
1 parent 10054f1 commit 190de69
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 43 deletions.
1 change: 0 additions & 1 deletion .docker-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ missingModules=""
#Check everything that needs to be in the $PATH is in there.
#Bash doesn't let this work if this is in an if statement for some reason it has to be chained
type -P "docker" &>/dev/null && echo "docker found..." || missingModules="${missingModules} docker"
type -P "docker-compose" &>/dev/null && echo "docker-compose found..." || missingModules="${missingModules} docker-compose"
type -P "ifconfig" &>/dev/null && echo "ifconfig found..." || missingModules="${missingModules} ifconfig (part of net-tools)"
type -P "psql" &>/dev/null && echo "psql found..." || missingModules="${missingModules} psql"
type -P "watch" &>/dev/null && echo "watch found..." || missingModules="${missingModules} watch"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ docs-view: docs


compose-run:
@ docker-compose -f docker-compose.yml up --build
@ docker compose -f docker-compose.yml up --build

compose-run-database:
@ echo "**************************************************************************"
@ echo "Make sure there are no database credentials in docker_env.txt!"
@ echo "**************************************************************************"
@ echo
@ docker-compose -f docker-compose.yml -f database-compose.yml up --build
@ docker compose -f docker-compose.yml -f database-compose.yml up --build

docker-build: docker-build-backend docker-build-frontend docker-build-database docker-build-rabbitmq

Expand Down
6 changes: 3 additions & 3 deletions docs/8knot.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Required Ubuntu Packages
```shell
sudo apt install docker &&
sudo apt install docker-compose
sudo apt install docker compose
```

If you are running Augur on the same computer, you should already have Python3.x installed. If not, for an Ubuntu 22.x Server also issue this command:
Expand All @@ -21,11 +21,11 @@ git checkout redis-remap
## Start 8knot
To see if everything works:
```shell
sudo docker-compose up --build
sudo docker compose up --build
```

If you want to run 8Knot in the background:
```shell
(nohup sudo docker-compose up --build &)
(nohup sudo docker compose up --build &)
```

6 changes: 3 additions & 3 deletions docs/dev-osx-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ Note: Augur will run on port 5000 by default (you probably need to change that i
You can stop augur with `augur backend stop`, followed by `augur backend kill`. We recommend waiting 5 minutes between commands so Augur can shutdown more gently. There is no issue with data integrity if you issue them seconds apart, its just that stopping is nicer than killing.

### Docker
1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the `environment.txt` file in the root of the repository to include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two choices:
- Change the port mappings in the `docker-compose.yml` file to match ports for Postgresql not currently in use.
- Change to variables in `environment.txt` to include the correct values for your local, non-docker-container database.
4. `sudo docker build -t augur-new -f docker/backend/Dockerfile .`
5. `sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
5. `sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
6 changes: 3 additions & 3 deletions docs/new-install-ubuntu-python-3.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ Note: Augur will run on port 5000 by default (you probably need to change that i
You can stop augur with `augur backend stop`, followed by `augur backend kill`. We recommend waiting 5 minutes between commands so Augur can shutdown more gently. There is no issue with data integrity if you issue them seconds apart, its just that stopping is nicer than killing.

### Docker
1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the `environment.txt` file in the root of the repository to include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two choices:
- Change the port mappings in the `docker-compose.yml` file to match ports for Postgresql not currently in use.
- Change to variables in `environment.txt` to include the correct values for your local, non-docker-container database.
4. `sudo docker build -t augur-new -f docker/backend/Dockerfile .`
5. `sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
5. `sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
6 changes: 3 additions & 3 deletions docs/new-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ Note: Augur will run on port 5000 by default (you probably need to change that i
You can stop augur with `augur backend stop`, followed by `augur backend kill`. We recommend waiting 5 minutes between commands so Augur can shutdown more gently. There is no issue with data integrity if you issue them seconds apart, its just that stopping is nicer than killing.

### Docker
1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the `environment.txt` file in the root of the repository to include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two choices:
- Change the port mappings in the `docker-compose.yml` file to match ports for Postgresql not currently in use.
- Change to variables in `environment.txt` to include the correct values for your local, non-docker-container database.
4. `sudo docker build -t augur-new -f docker/backend/Dockerfile .`
5. `sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
5. `sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to run the database in a Docker Container or
`sudo docker compose --env-file ./environment.txt --file docker-compose.yml up` to connect to an already running database.
6 changes: 3 additions & 3 deletions docs/source/docker/docker-compose.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ To run Augur **without** the database container:

.. code-block:: bash
docker-compose -f docker-compose.yml up
docker compose -f docker-compose.yml up
To run Augur **with** the database container:

.. code-block:: bash
docker-compose -f docker-compose.yml -f database-compose.yml up
docker compose -f docker-compose.yml -f database-compose.yml up
Stopping the containers
-------------------------

To stop the containers, run ``docker-compose down --remove-orphans``. The flag is necessary to stop the database container if you used one; run the command again to delete them.
To stop the containers, run ``docker compose down --remove-orphans``. The flag is necessary to stop the database container if you used one; run the command again to delete them.

Once you've got your container up and running, checkout out `how to use them <usage.html>`_
4 changes: 2 additions & 2 deletions docs/source/docker/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If you are less familiar with Docker, or experience issues you cannot resolve at

Credentials
------------
Before you get started with Docker, you'll need to set up a PostgreSQL instance either locally or using a remote host. Alternatively, you can also set up the database within a docker container either manually or through docker-compose.
Before you get started with Docker, you'll need to set up a PostgreSQL instance either locally or using a remote host. Alternatively, you can also set up the database within a docker container either manually or through docker compose.

.. note::

Expand Down Expand Up @@ -58,7 +58,7 @@ First, you'll need to clone the repository. In your terminal, run:
Now that you've got your external database credentials (if you are using one) and your access token, we'll need to set environment variables manually.

Your database credentials and other environment variables used at runtime are stored in a file when running manually and are taken from the active bash session when using docker-compose.
Your database credentials and other environment variables used at runtime are stored in a file when running manually and are taken from the active bash session when using docker compose.

You can provide your own ``.env`` file to pull from. The file should have the below format and set all the variables to some value.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/docker/quick-start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ Before you get off to such a quick start, go ahead and
.. code-block:: bash
sudo docker build -t augur-docker -f docker/backend/Dockerfile .
sudo docker-compose up
sudo docker compose up
2 changes: 1 addition & 1 deletion docs/source/docker/toc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Docker
quick-start
getting-started
docker
docker-compose
docker compose
usage


4 changes: 2 additions & 2 deletions docs/source/docker/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ By default, the only logs shown by the container are the logs of Augur's main da
.. code-block:: bash
# to quickly view the most recent logs
$ docker-compose logs
$ docker compose logs
# to watch the logs in real-time (like tail -f)
$ docker-compose logs -f
$ docker compose logs -f
As for worker logs. They are currently a work in progress to be made easier to view. Shortly, they will automatically populate on the host machine and it will not be necessary to step inside the container.
Expand Down
6 changes: 3 additions & 3 deletions docs/source/getting-started/dev-osx-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ killing.
Docker
~~~~~~

1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the ``environment.txt`` file in the root of the repository to
include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two
Expand All @@ -615,7 +615,7 @@ Docker
values for your local, non-docker-container database.

4. ``sudo docker build -t augur-new -f docker/backend/Dockerfile .``
5. ``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
5. ``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to run the database in a Docker Container or
``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to connect to an already running database.
6 changes: 3 additions & 3 deletions docs/source/getting-started/new-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ killing.
Docker
~~~~~~

1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the ``environment.txt`` file in the root of the repository to
include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two
Expand All @@ -515,7 +515,7 @@ Docker
values for your local, non-docker-container database.

4. ``sudo docker build -t augur-new -f docker/backend/Dockerfile .``
5. ``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
5. ``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to run the database in a Docker Container or
``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to connect to an already running database.
6 changes: 3 additions & 3 deletions docs/source/quick-start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ killing.
Docker
~~~~~~

1. Make sure docker, and docker-compose are both installed
1. Make sure docker, and docker compose are both installed
2. Modify the ``environment.txt`` file in the root of the repository to
include your GitHub and GitLab API keys.
3. If you are already running postgresql on your server you have two
Expand All @@ -169,9 +169,9 @@ Docker
values for your local, non-docker-container database.

4. ``sudo docker build -t augur-new -f docker/backend/Dockerfile .``
5. ``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
5. ``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to run the database in a Docker Container or
``sudo docker-compose --env-file ./environment.txt --file docker-compose.yml up``
``sudo docker compose --env-file ./environment.txt --file docker-compose.yml up``
to connect to an already running database.


8 changes: 4 additions & 4 deletions scripts/docker/docker-setup-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ fi


echo "Tearing down old docker stack..."
docker-compose -f docker-compose.yml -f database-compose.yml down --remove-orphans
docker compose -f docker-compose.yml -f database-compose.yml down --remove-orphans

#Run docker stack in background to catch up to later
echo "Starting set up of docker stack..."
nohup docker-compose -f docker-compose.yml -f database-compose.yml up --no-recreate &>/tmp/dockerComposeLog &
nohup docker compose -f docker-compose.yml -f database-compose.yml up --no-recreate &>/tmp/dockerComposeLog &
PIDOS=$!

#While the containers are up show a watch monitor that shows container status and live feed from logs
printf "\nNow showing active docker containers:\n"
watch -n1 --color 'docker-compose -f docker-compose.yml -f database-compose.yml ps && echo && tail -n 30 /tmp/dockerComposeLog && echo "Ctrl+C to Exit"'
watch -n1 --color 'docker compose -f docker-compose.yml -f database-compose.yml ps && echo && tail -n 30 /tmp/dockerComposeLog && echo "Ctrl+C to Exit"'
printf "\n"

#Stop the process and clean up dead containers on SIGINT.
kill -15 $PIDOS
#Cleaning up dead containers
echo "Cleaning up dead containers... "
docker-compose -f docker-compose.yml -f database-compose.yml down --remove-orphans
docker compose -f docker-compose.yml -f database-compose.yml down --remove-orphans
bash scripts/docker/cleanup.sh
12 changes: 6 additions & 6 deletions scripts/docker/docker-setup-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ then
fi
echo "AUGUR_DB_PASSWORD=$dbPassword" >> docker_env.txt
else
#docker_env.txt should always be present in a docker-compose build otherwise it can cause issues for the database.
#docker_env.txt should always be present in a docker compose build otherwise it can cause issues for the database.
if [[ ! -f "docker_env.txt" ]]
then
echo "docker_env.txt not found. Please add environment variables in this file or restart the script and choose to prompt db credentials."
exit 1
fi

#Copy host name to docker-compose env file.
#Copy host name to docker compose env file.
cat docker_env.txt | grep AUGUR_DB_HOST >> .env
fi

Expand Down Expand Up @@ -122,21 +122,21 @@ else
fi

echo "Tearing down old docker stack..."
docker-compose -f docker-compose.yml down --remove-orphans
docker compose -f docker-compose.yml down --remove-orphans

#Run docker stack in background to catch up to later
echo "Starting set up of docker stack..."
nohup docker-compose -f docker-compose.yml up --no-recreate &>/tmp/dockerComposeLog &
nohup docker compose -f docker-compose.yml up --no-recreate &>/tmp/dockerComposeLog &
PIDOS=$!

#While the containers are up show a watch monitor that shows container status and live feed from logs
printf "\nNow showing active docker containers:\n"
watch -n1 --color 'docker-compose ps && echo && tail -n 30 /tmp/dockerComposeLog && echo "Ctrl+C to Exit"'
watch -n1 --color 'docker compose ps && echo && tail -n 30 /tmp/dockerComposeLog && echo "Ctrl+C to Exit"'
printf "\n"

#Stop the process and clean up dead containers on SIGINT.
kill -15 $PIDOS
#Cleaning up dead containers
echo "Cleaning up dead containers... "
docker-compose -f docker-compose.yml down --remove-orphans
docker compose -f docker-compose.yml down --remove-orphans
bash scripts/docker/cleanup.sh

0 comments on commit 190de69

Please sign in to comment.