diff --git a/.env b/.env
deleted file mode 100644
index 91a59aa422..0000000000
--- a/.env
+++ /dev/null
@@ -1,8 +0,0 @@
-# Sets the base name for containers and networks for docker-compose to
-# "socorro_". This is normally set by the name of this directory, but
-# if you clone the repository with a different directory name, then
-# you end up with a different project name and then everything is hosed.
-# Setting it here fixes that.
-COMPOSE_PROJECT_NAME=socorro
-
-PYTHONUNBUFFERED=true
diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml
index 0c542e4bba..a24c6e6468 100644
--- a/.github/workflows/build-and-push.yml
+++ b/.github/workflows/build-and-push.yml
@@ -18,7 +18,10 @@ jobs:
contents: read
deployments: write
id-token: write
- runs-on: ubuntu-latest
+ runs-on: ubuntu-24.04
+ env:
+ # Disable docker compose volume mounts in docker-compose.override.yml
+ COMPOSE_FILE: docker-compose.yml
steps:
- uses: actions/checkout@v4
- name: Get info
@@ -36,20 +39,21 @@ jobs:
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > version.json
- name: Output version.json
run: cat version.json
+ - name: Install just
+ run: sudo apt-get update && sudo apt-get install -y just
- name: Build Docker images
run: |
- make build
+ just build
docker compose images
- name: Verify requirements.txt contains correct dependencies
run: |
- docker run --rm local/socorro_app shell ./bin/verify_reqs.sh
+ just verify-reqs
- name: Run lint check
run: |
- docker run --rm local/socorro_app shell ./bin/lint.sh
+ just lint
- name: Run tests
run: |
- make my.env
- docker compose run --rm test-ci shell ./bin/test.sh
+ just test
- name: Set Docker image tag to "latest" for updates of the main branch
if: github.ref == 'refs/heads/main'
diff --git a/.gitignore b/.gitignore
index e6773984b1..834fa45cd1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,8 +24,7 @@ symbols/
.docker-build*
.devcontainer-build
.cache/
-docker-compose.override.yml
-my.env
+.env
# docs things
docs/_build/
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 5c6c1f2bd4..0000000000
--- a/Makefile
+++ /dev/null
@@ -1,158 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Include my.env and export it so variables set in there are available
-# in the Makefile.
-include my.env
-export
-
-# Set these in the environment to override them. This is helpful for
-# development if you have file ownership problems because the user
-# in the container doesn't match the user on your host.
-SOCORRO_UID ?= 10001
-SOCORRO_GID ?= 10001
-
-# Set this in the environment to force --no-cache docker builds.
-DOCKER_BUILD_OPTS :=
-ifeq (1, ${NOCACHE})
-DOCKER_BUILD_OPTS := --no-cache
-endif
-
-DOCKER := $(shell which docker)
-DC=${DOCKER} compose
-
-.DEFAULT_GOAL := help
-.PHONY: help
-help:
- @echo "Usage: make RULE"
- @echo ""
- @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' Makefile \
- | grep -v grep \
- | sed -n 's/^\(.*\): \(.*\)##\(.*\)/\1\3/p' \
- | column -t -s '|'
- @echo ""
- @echo "See https://socorro.readthedocs.io/ for more documentation."
-
-my.env:
- @if [ ! -f my.env ]; \
- then \
- echo "Copying my.env.dist to my.env..."; \
- cp docker/config/my.env.dist my.env; \
- fi
-
-.docker-build:
- make build
-
-.devcontainer-build:
- make devcontainerbuild
-
-.PHONY: build
-build: my.env ## | Build docker images.
- ${DC} build ${DOCKER_BUILD_OPTS} --build-arg userid=${SOCORRO_UID} --build-arg groupid=${SOCORRO_GID} --progress plain app
- ${DC} build --progress plain oidcprovider fakesentry gcs-emulator
- ${DC} build --progress plain statsd postgresql memcached elasticsearch symbolsserver
- touch .docker-build
-
-.PHONY: devcontainerbuild
-devcontainerbuild: my.env ## | Build VS Code development container.
- ${DC} build devcontainer
- touch .devcontainer-build
-
-.PHONY: devcontainer
-devcontainer: my.env .devcontainer-build ## | Run VS Code development container.
- ${DC} up --detach devcontainer
-
-.PHONY: setup
-setup: my.env .docker-build ## | Set up Postgres, Elasticsearch, local Pub/Sub, and local GCS services.
- ${DC} run --rm app shell /app/bin/setup_services.sh
-
-.PHONY: updatedata
-updatedata: my.env ## | Add/update necessary database data.
- ${DC} run --rm app shell /app/bin/update_data.sh
-
-.PHONY: run
-run: my.env ## | Run processor, webapp, fakesentry, symbolsserver, and required services.
- ${DC} up \
- --attach processor \
- --attach webapp \
- --attach fakesentry \
- --attach symbolsserver \
- processor webapp fakesentry symbolsserver
-
-.PHONY: runservices
-runservices: my.env ## | Run service containers (Postgres, Pub/Sub, etc)
- ${DC} up -d --remove-orphans \
- elasticsearch \
- gcs-emulator \
- memcached \
- postgresql \
- pubsub \
- statsd \
- symbolsserver
-
-.PHONY: runsubmitter
-runsubmitter: my.env ## | Run stage_submitter and fakecollector
- ${DC} up \
- --attach stage_submitter \
- --attach fakecollector \
- stage_submitter fakecollector
-
-.PHONY: stop
-stop: my.env ## | Stop all service containers.
- ${DC} stop
-
-.PHONY: shell
-shell: my.env .docker-build ## | Open a shell in the app container.
- ${DC} run --rm --entrypoint /bin/bash app
-
-.PHONY: clean
-clean: ## | Remove all build, test, coverage, and Python artifacts.
- -rm .docker-build*
- -rm -rf .cache
- @echo "Skipping deletion of symbols/ in case you have data in there."
-
-.PHONY: docs
-docs: my.env .docker-build ## | Generate Sphinx HTML documetation.
- ${DC} run --rm --user ${SOCORRO_UID} app shell make -C docs/ clean
- ${DC} run --rm --user ${SOCORRO_UID} app shell make -C docs/ html
-
-.PHONY: lint
-lint: my.env ## | Lint code.
- ${DC} run --rm --no-deps app shell ./bin/lint.sh
-
-.PHONY: lintfix
-lintfix: my.env ## | Reformat code.
- ${DC} run --rm --no-deps app shell ./bin/lint.sh --fix
-
-.PHONY: psql
-psql: my.env .docker-build ## | Open psql cli.
- @echo "NOTE: Password is 'postgres'."
- ${DC} run --rm postgresql psql -h postgresql -U postgres -d socorro
-
-.PHONY: test
-test: my.env .docker-build ## | Run unit tests.
- ${DC} run --rm test shell ./bin/test.sh
-
-.PHONY: test-ci
-test-ci: my.env .docker-build ## | Run unit tests in CI.
- # Run tests in test-ci which doesn't volume mount local directory
- ${DC} run --rm test-ci shell ./bin/test.sh
-
-.PHONY: testshell
-testshell: my.env .docker-build ## | Open a shell in the test environment.
- ${DC} run --rm --entrypoint /bin/bash test
-
-.PHONY: rebuildreqs
-rebuildreqs: .env .docker-build ## | Rebuild requirements.txt file after requirements.in changes.
- ${DC} run --rm --no-deps app shell pip-compile --generate-hashes --strip-extras
- ${DC} run --rm --no-deps app shell pip-compile --generate-hashes \
- --unsafe-package=python-dateutil --unsafe-package=six --unsafe-package=urllib3 legacy-es-requirements.in
-
-.PHONY: updatereqs
-updatereqs: .env .docker-build ## | Update deps in requirements.txt file.
- ${DC} run --rm --no-deps app shell pip-compile --generate-hashes --strip-extras --upgrade
-
-.PHONY: servicestatus
-servicestatus: .env .docker-build ## | Check service status
- ${DC} run --rm --no-deps app shell service-status
diff --git a/bin/lint.sh b/bin/lint.sh
index 159a5346f1..fa22ba47c5 100755
--- a/bin/lint.sh
+++ b/bin/lint.sh
@@ -16,11 +16,18 @@ FILES="socorro-cmd docker socorro webapp bin"
PYTHON_VERSION=$(python --version)
-if [[ "${1:-}" == "--fix" ]]; then
+if [[ "${1:-}" == "--help" ]]; then
+ echo "Usage: $0 [OPTIONS]"
+ echo
+ echo " Lint code"
+ echo
+ echo "Options:"
+ echo " --help Show this message and exit."
+ echo " --fix Reformat code."
+elif [[ "${1:-}" == "--fix" ]]; then
echo ">>> ruff fix (${PYTHON_VERSION})"
ruff format $FILES
ruff check --fix $FILES
-
else
echo ">>> ruff (${PYTHON_VERSION})"
ruff check $FILES
diff --git a/docker-compose.override.yml b/docker-compose.override.yml
new file mode 100644
index 0000000000..3f789a996a
--- /dev/null
+++ b/docker-compose.override.yml
@@ -0,0 +1,37 @@
+---
+# define volumes in docker-compose.override.yml so that can be ignored in CI
+services:
+ app:
+ volumes:
+ - .:/app
+ test:
+ volumes:
+ - .:/app
+
+ processor:
+ volumes:
+ - .:/app
+
+ crontabber:
+ volumes:
+ - .:/app
+
+ webapp:
+ volumes:
+ - .:/app
+
+ stage_submitter:
+ volumes:
+ - .:/app
+
+ collector:
+ volumes:
+ - .:/socorro
+
+ fakecollector:
+ volumes:
+ - .:/app
+
+ symbolsserver:
+ volumes:
+ - .:/app
diff --git a/docker-compose.yml b/docker-compose.yml
index 236ba09104..2619279998 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,14 +1,24 @@
---
+# Sets the base name for containers and networks for docker-compose to
+# "socorro_". This is normally set by the name of this directory, but
+# if you clone the repository with a different directory name, then
+# you end up with a different project name and then everything is hosed.
+# Setting it here fixes that.
+name: socorro
+
services:
# Socorro app image
app:
build:
context: .
dockerfile: docker/Dockerfile
+ args:
+ userid: ${USE_UID:-10001}
+ groupid: ${USE_GID:-10001}
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- fakesentry
- statsd
@@ -17,8 +27,6 @@ services:
- postgresql
- legacy-elasticsearch
- elasticsearch
- volumes:
- - .:/app
# For development
@@ -36,23 +44,6 @@ services:
- postgresql
- legacy-elasticsearch
- elasticsearch
- volumes:
- - .:/app
-
- # For running tests in CI
- test-ci:
- image: local/socorro_app
- env_file:
- - docker/config/local_dev.env
- - docker/config/test.env
- depends_on:
- - fakesentry
- - statsd
- - gcs-emulator
- - pubsub
- - postgresql
- - legacy-elasticsearch
- - elasticsearch
devcontainer:
build:
@@ -65,7 +56,7 @@ services:
env_file:
- docker/config/local_dev.env
- docker/config/test.env
- - my.env
+ - .env
depends_on:
- fakesentry
- statsd
@@ -81,7 +72,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- fakesentry
- statsd
@@ -91,14 +82,12 @@ services:
- elasticsearch
- symbolsserver
command: ["processor"]
- volumes:
- - .:/app
crontabber:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- fakesentry
- statsd
@@ -106,14 +95,12 @@ services:
- legacy-elasticsearch
- elasticsearch
command: ["crontabber"]
- volumes:
- - .:/app
webapp:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- fakesentry
- statsd
@@ -127,21 +114,17 @@ services:
command: ["webapp", "--dev"]
ports:
- "8000:8000"
- volumes:
- - .:/app
stage_submitter:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- fakesentry
- gcs-emulator
- pubsub
command: ["stage_submitter"]
- volumes:
- - .:/app
# https://github.com/willkg/kent
fakesentry:
@@ -178,7 +161,7 @@ services:
image: mozilla/socorro_collector:latest
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
depends_on:
- gcs-emulator
- pubsub
@@ -187,31 +170,25 @@ services:
- 8000
ports:
- "8888:8000"
- volumes:
- - .:/socorro
fakecollector:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
command: ["fakecollector"]
ports:
- "9000:8000"
- volumes:
- - .:/app
symbolsserver:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- - my.env
+ - .env
command: ["symbolsserver"]
stop_signal: SIGINT
ports:
- "8070:8070"
- volumes:
- - .:/app
# https://hub.docker.com/r/hopsoft/graphite-statsd/
statsd:
diff --git a/docker/config/my.env.dist b/docker/config/.env.dist
similarity index 77%
rename from docker/config/my.env.dist
rename to docker/config/.env.dist
index c94111304d..caf7c824ec 100644
--- a/docker/config/my.env.dist
+++ b/docker/config/.env.dist
@@ -8,15 +8,8 @@
# If you want to set the uid and gid of the app user that we use in the
# containers, you can do that with these two variables.
-# SOCORRO_UID=
-# SOCORRO_GID=
-
-# ---------------------------------------------
-# processor settings
-# ---------------------------------------------
-
-# Only use 2 threads for the processor
-producer_consumer.number_of_threads=2
+# USE_UID=
+# USE_GID=
# ---------------------------------------------
# crash-stats.mozilla.org settings
diff --git a/docs/crashstorage.rst b/docs/crashstorage.rst
index 3dc5675ca7..67502c2fbe 100644
--- a/docs/crashstorage.rst
+++ b/docs/crashstorage.rst
@@ -73,7 +73,7 @@ You can see Elasticsearch common options by passing ``--help`` to the
processor app and looking at the ``resource.elasticsearch`` options like
this::
- $ make shell
+ $ just shell
app@socorro:/app$ python ./socorro/processor/processor_app.py \
--destination.crashstorage_class=socorro.external.es.crashstorage.ESCrashStorage \
--help
diff --git a/docs/dev.rst b/docs/dev.rst
index 483bdae972..77f4bf8565 100644
--- a/docs/dev.rst
+++ b/docs/dev.rst
@@ -15,7 +15,7 @@ development environment.
Setup quickstart
================
-1. Install required software: Docker, make, and git.
+1. Install required software: Docker, just, and git.
**Linux**:
@@ -26,17 +26,17 @@ Setup quickstart
Install `Docker for Mac `_ which
will install Docker.
- Use `homebrew `_ to install make and git:
+ Use `homebrew `_ to install just and git:
.. code-block:: shell
- $ brew install make git
+ $ brew install just git
**Other**:
Install `Docker `_.
- Install `make `_.
+ Install `just `_.
Install `git `_.
@@ -52,14 +52,14 @@ Setup quickstart
.. code-block:: shell
- $ make my.env
+ $ just _env
- Then edit the file and set the ``SOCORRO_UID`` and ``SOCORRO_GID``
+ Then edit the file and set the ``USE_UID`` and ``USE_GID``
variables. These will get used when creating the app user in the base
image.
- If you ever want different values, change them in ``my.env`` and re-run
- ``make build``.
+ If you ever want different values, change them in ``.env`` and re-run
+ ``just build``.
4. Build Docker images for Socorro services.
@@ -67,23 +67,17 @@ Setup quickstart
.. code-block:: shell
- $ make build
+ $ just build
That will build the app Docker image required for development.
5. Initialize Postgres, Elasticsearch, Pub/Sub, S3, and SQS.
- Then you need to set up services. To do that, run:
-
- .. code-block:: shell
-
- $ make runservices
-
- This starts service containers. Then run:
+ To do that, run:
.. code-block:: shell
- $ make setup
+ $ just setup
This creates the Postgres database and sets up tables, stored procedures,
integrity rules, types, and a bunch of other things. It also adds a bunch of
@@ -107,7 +101,7 @@ Setup quickstart
.. code-block:: shell
- $ make updatedata
+ $ just update-data
At this point, you should have a basic functional Socorro development
@@ -115,7 +109,7 @@ environment that has no crash data in it.
.. Note::
- You can run ``make setup`` and ``make updatedata`` any time you want to
+ You can run ``just setup`` and ``just update-data`` any time you want to
throw out all state and re-initialize services.
.. Seealso::
@@ -245,7 +239,7 @@ To lint the code:
.. code-block:: shell
- $ make lint
+ $ just lint
If you hit issues, use ``# noqa``.
@@ -253,7 +247,7 @@ To run the reformatter:
.. code-block:: shell
- $ make lintfix
+ $ just lint --fix
We're using:
@@ -304,7 +298,7 @@ Do this:
.. code-block:: shell
- $ make shell
+ $ just shell
app@socorro:/app$ cd webapp
app@socorro:/app/webapp$ ./manage.py makemigration --name "BUGID_desc" APP
@@ -334,7 +328,7 @@ For example, to add ``foobar`` version 5:
.. code-block:: shell
- $ make rebuildreqs
+ $ just rebuild-reqs
to apply the updates to ``requirements.txt``
@@ -342,7 +336,7 @@ For example, to add ``foobar`` version 5:
.. code-block:: shell
- $ make build
+ $ just build
If there are problems, it'll tell you.
@@ -351,7 +345,7 @@ dependencies. To do this, run:
.. code-block:: shell
- $ make updatereqs
+ $ just rebuild-reqs --update
JavaScript Dependencies
@@ -371,7 +365,7 @@ Then rebuild your docker environment:
.. code-block:: shell
- $ make build
+ $ just build
If there are problems, it'll tell you.
@@ -387,7 +381,7 @@ To build the docs, run this:
.. code-block:: shell
- $ make docs
+ $ just docs
Testing
@@ -406,7 +400,7 @@ To run the tests, do:
.. code-block:: shell
- $ make test
+ $ just test
That runs the ``/app/bin/test.sh`` script in the test container using test
configuration.
@@ -416,7 +410,7 @@ test container:
.. code-block:: shell
- $ make testshell
+ $ just test-shell
Then you can run pytest on the Socorro tests or the webapp tests.
@@ -499,7 +493,7 @@ build new images:
.. code-block:: shell
- $ make build
+ $ just build
If there were changes to the database tables, stored procedures, types,
@@ -508,8 +502,8 @@ state and re-initialize services:
.. code-block:: shell
- $ make setup
- $ make updatedata
+ $ just setup
+ $ just update-data
Wiping crash storage and state
@@ -520,8 +514,8 @@ data, and reset the state of the system, run:
.. code-block:: shell
- $ make setup
- $ make updatedata
+ $ just setup
+ $ just update-data
Updating release data
@@ -534,7 +528,7 @@ Run:
.. code-block:: shell
- $ make updatedata
+ $ just update-data
.. _gettingstarted-chapter-configuration:
@@ -623,7 +617,7 @@ first run:
.. code-block:: shell
- $ make devcontainerbuild
+ $ just build devcontainer
Additionally on mac there is the potential that running git from inside any
container that mounts the current directory to `/app`, such as the development
@@ -643,7 +637,7 @@ pick up changes:
.. code-block:: shell
- $ make devcontainer
+ $ just run devcontainer
Upgrading to a new Python version
@@ -679,7 +673,7 @@ All helper scripts run in the shell in the container:
.. code-block::
- $ make shell
+ $ just shell
Some of the scripts require downloading production data from
`crash-stats.mozilla.org `_, and it is
@@ -713,7 +707,7 @@ Add the API token value to your ``my.env`` file::
SOCORRO_API_TOKEN=apitokenhere
-The API token is used by the download scripts (run inside ``$ make shell``),
+The API token is used by the download scripts (run inside ``$ just shell``),
but not directly by the processor.
@@ -739,7 +733,7 @@ You can also use it with ``fetch_crashids``:
app@socorro:/app$ socorro-cmd fetch_crashids --num=1 | bin/process_crashes.sh
-Run the processor and webapp with ``make run`` to process the crash reports.
+Run the processor and webapp with ``just run`` to process the crash reports.
If you find this doesn't meet your needs, you can write a shell script using
the commands and scripts that ``process_crashes.sh`` uses. They are described
@@ -888,7 +882,7 @@ Let's process crashes for Firefox from yesterday. We'd do this:
# Set SOCORRO_API_TOKEN in my.env
# Start bash in the socorro container
- $ make shell
+ $ just shell
# Generate a file of crashids--one per line
app@socorro:/app$ socorro-cmd fetch_crashids > crashids.txt
@@ -955,6 +949,6 @@ For example::
PGPASSWORD=postgres psql -h localhost -p 8574 -U postgres --no-password socorro
-You can also connect with ``make``::
+You can also connect with ``just``::
- make psql
+ just psql
diff --git a/docs/reprocessing.rst b/docs/reprocessing.rst
index 224e692342..ebdb449d97 100644
--- a/docs/reprocessing.rst
+++ b/docs/reprocessing.rst
@@ -29,7 +29,7 @@ In ``my.env``, set ``SOCORRO_REPROCESS_API_TOKEN`` to the token value.
For example, this reprocesses a single crash::
- $ make shell
+ $ just shell
app@socorro:app$ socorro-cmd reprocess c2815fd1-e87b-45e9-9630-765060180110
When reprocessing many crashes, it is useful to collect crashids and then
@@ -39,12 +39,12 @@ failure.
This reprocesses 100 crashes with a specified signature::
- $ make shell
+ $ just shell
app@socorro:app$ socorro-cmd fetch_crashids --signature="some | signature" > crashids
app@socorro:app$ cat crashids | socorro-cmd reprocess
For more complex crash sets, pass a search URL to generate the list::
- $ make shell
+ $ just shell
app@socorro:app$ socorro-cmd fetch_crashids --num=all --url="https://crash-stats.mozilla.org/search/?product=Sample&date=%3E%3D2019-05-07T22%3A00%3A00.000Z&date=%3C2019-05-07T23%3A00%3A00.000Z" > crashids
app@socorro:app$ cat crashids | socorro-cmd reprocess
diff --git a/docs/service/cron.rst b/docs/service/cron.rst
index 312a93c1ef..c8bc00a039 100644
--- a/docs/service/cron.rst
+++ b/docs/service/cron.rst
@@ -40,7 +40,7 @@ manage.py cronrun helper commands
All commands are accessed in a shell in the app container. For example::
- $ make shell
+ $ just shell
app@socorro:/app$ webapp/manage.py cronrun --help
**cronrun**
diff --git a/docs/service/processor.rst b/docs/service/processor.rst
index deea90a013..fa0e623d6f 100644
--- a/docs/service/processor.rst
+++ b/docs/service/processor.rst
@@ -52,7 +52,7 @@ processor configuration.
To use tools and also ease debugging in the container, you can run a shell::
- $ make shell
+ $ just shell
Then you can start and stop the processor and tweak files and all that jazz.
diff --git a/docs/service/stage_submitter.rst b/docs/service/stage_submitter.rst
index fbcaae268f..ab1134a978 100644
--- a/docs/service/stage_submitter.rst
+++ b/docs/service/stage_submitter.rst
@@ -49,8 +49,7 @@ To run the stage submitter and fake collector, do:
::
- $ make runservices
- $ make runsubmitter
+ $ just run-submitter
After doing this, you can enter a Socorro container shell and use
``bin/process_crash.sh`` to pull down crash data, put it into storage, and
@@ -58,7 +57,7 @@ publish the crash id to the standard queue.
::
- $ make shell
+ $ just shell
app@socorro:/app$ ./bin/process_crash.sh a206b51a-5955-4704-be1f-cf1ac0240514
diff --git a/docs/tests/system_checklist.rst b/docs/tests/system_checklist.rst
index b42ae1b8e7..928730ba48 100644
--- a/docs/tests/system_checklist.rst
+++ b/docs/tests/system_checklist.rst
@@ -60,7 +60,7 @@ Checklist
Local dev environment:
- 1. "make shell"
+ 1. "just shell"
2. "cd webapp/"
3. "./manage.py showmigrations"
diff --git a/justfile b/justfile
new file mode 100644
index 0000000000..2dc219eec3
--- /dev/null
+++ b/justfile
@@ -0,0 +1,88 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+_default:
+ @just --list
+
+_env:
+ @if [ ! -f .env ]; \
+ then \
+ echo "Copying docker/config/.env.dist to .env..."; \
+ cp docker/config/.env.dist .env; \
+ fi
+
+# Build docker images
+build *args: _env
+ docker compose build --progress plain {{args}}
+
+# Set up Postgres, Elasticsearch, local Pub/Sub, and local GCS services.
+setup: _env
+ docker compose run --rm app shell /app/bin/setup_services.sh
+
+# Add/update necessary database data.
+update-data: _env
+ docker compose run --rm app shell /app/bin/update_data.sh
+
+# Run services, defaults to socorro and fakesentry for debugging
+run *args='--attach=processor --attach=webapp --attach=fakesentry processor webapp': _env
+ docker compose up {{args}}
+
+# Run stage submitter and fake collector
+run-submitter *args='--attach=stage_submitter --attach=fakecollector': _env
+ docker compose up \
+ {{args}} \
+ stage_submitter \
+ fakecollector
+
+# Stop service containers.
+stop *args:
+ docker compose stop {{args}}
+
+# Remove service containers and networks.
+down *args:
+ docker compose down {{args}}
+
+# Open a shell in the app container.
+shell *args: _env
+ docker compose run --rm --entrypoint /bin/bash app {{args}}
+
+# Open a shell in the test environment.
+test-shell *args:
+ docker compose run --rm --entrypoint /bin/bash test {{args}}
+
+# Remove all build, test, coverage, and Python artifacts.
+clean:
+ -rm -rf .cache
+ @echo "Skipping deletion of symbols/ in case you have data in there."
+
+# Generate Sphinx HTML documetation.
+docs: _env
+ docker compose run --rm app shell make -C docs/ clean
+ docker compose run --rm app shell make -C docs/ html
+
+# Lint code, or use --fix to reformat and apply auto-fixes for lint.
+lint *args: _env
+ docker compose run --rm --no-deps app shell ./bin/lint.sh {{args}}
+
+# Open psql cli.
+psql *args:
+ docker compose run --rm postgresql psql postgresql://postgres:postgres@postgresql/socorro {{args}}
+
+# Run tests.
+test *args:
+ docker compose run --rm test shell ./bin/test.sh {{args}}
+
+# Build requirements.txt file after requirements.in changes.
+rebuild-reqs *args: _env
+ docker compose run --rm --no-deps app shell pip-compile --generate-hashes --strip-extras {{args}}
+ docker compose run --rm --no-deps app shell pip-compile --generate-hashes \
+ --unsafe-package=python-dateutil --unsafe-package=six --unsafe-package=urllib3 legacy-es-requirements.in
+
+# Verify that the requirements file is built by the version of Python that runs in the container.
+verify-reqs: _env
+ docker compose run --rm --no-deps app shell ./bin/verify_reqs.sh
+
+# Check how far behind different server environments are from main tip.
+service-status *args: _env
+ docker compose run --rm --no-deps app shell service-status {{args}}