Newer
Older
.PHONY: check-build test-dev test dev setup alembic-update docker-base db build coverage clean

Andrew Kapuscinski
committed
check-build: docker-base docker-dev-images-locally test-dev

Nathan Hertz
committed
# Run tests on Dockerfile images
test-dev:
docker run nrao:workflow ./bin/run-tests.sh
docker run nrao:capability ./bin/run-tests.sh
docker run nrao:notification ./bin/run-tests.sh

Andrew Kapuscinski
committed
# Run tests on Dockerfile.local containers
test:

Janet Goldstein
committed
docker exec workspaces_workflow_1 su vlapipe -c "./bin/run-tests.sh"
docker exec workspaces_capability_1 ./bin/run-tests.sh
docker exec workspaces_notification_1 ./bin/run-tests.sh

Janet Goldstein
committed
test_cp:
docker exec workspaces_capability_1 ./bin/run-tests.sh
@echo "starting docker compose up in the background"
@echo "wait a few seconds and your environment should be done setting up"
docker compose -f docker-compose.local.yml up -d
alembic-update:
cd schema; \
env CAPO_PROFILE=local alembic upgrade head

Nathan Hertz
committed
# Build images from Dockerfile
docker build -t nrao:workflow -f services/workflow/Dockerfile.local . --build-arg capo_env=docker
docker build -t nrao:capability -f services/capability/Dockerfile.local . --build-arg capo_env=docker
docker build -t nrao:notification -f services/notification/Dockerfile.local . --build-arg capo_env=docker

Andrew Kapuscinski
committed
docker build --no-cache -t ssa-containers.aoc.nrao.edu/ops/base:workspaces -f Dockerfile.base .
docker build --no-cache -t ssa-containers.aoc.nrao.edu/ops/base:nodejs-14 -f apps/web/Dockerfile.base .
# Build cache image
cache:
docker build --no-cache -t cache:tmp -f Dockerfile.cache .
docker build --no-cache -t ssa-containers.aoc.nrao.edu/ops/ci/db:workspaces -f ./ci/psql/Dockerfile.db .
# Build docker images
docker compose -f docker-compose.local.yml build --no-cache

Andrew Kapuscinski
committed
# Generate HTML coverage report
coverage:
docker exec workspaces_workflow_1 ./bin/run-tests.sh -b
cp services/workflow/.coverage ./.coverage.wf
docker exec workspaces_capability_1 ./bin/run-tests.sh -b
cp services/capability/.coverage ./.coverage.cap
docker exec workspaces_notification_1 ./bin/run-tests.sh -b
cp services/notification/.coverage ./.coverage.no
coverage combine --append
coverage html --omit="**/test_*.py,**/_version.py,**/conftest.py,**/*interfaces.py" --skip-empty
# Clean up environment
clean:
# Clean up Docker environment
docker-compose -f docker-compose.local.yml down || true
# remove nrao: labeled containers
@docker container list --all | grep nrao: | awk '{ print $$1 }' | xargs docker container rm -f
# remove workspaces and nrao labeled images
@docker images | grep 'workspaces\|nrao' | awk '{ print $$3 }' | xargs docker rmi -f
# remove the python egg-info and pytest_cache folders
@find . \( -name "*.egg-info" -o -name ".pytest_cache" \) -exec rm -r {} \;
# Clean things up in a very nasty and destructive way that is sure to derail the rest of your afternoon
reallyclean: clean
docker system prune --volumes -f
docker volume prune -f
# Make the documentation
.PHONY: docs
docs:
cd docs && make html