Commit before cleanup

This commit is contained in:
Michael Hansen 2022-04-26 17:16:16 -04:00
commit 7fc43933e5
18 changed files with 797 additions and 29 deletions

View file

@ -13,38 +13,53 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
.PHONY: dist install docker binaries
.PHONY: dist install docker docker-gpu debian sample
SHELL := bash
# linux/amd64,linux/arm64,linux/arm/v7
DOCKER_PLATFORM ?= linux/amd64
DOCKER_OUTPUT ?= --load
DOCKER_TAG ?= mycroftai/mimic3
# Build source distributions for PyPI.
# Also tests installation.
dist:
./build-dist.sh
echo "$(DOCKER_PLATFORM)" | sed -e 's/,/\n/g' | \
while read -r platform; do \
docker buildx build . -f Dockerfile.dist --platform $(DOCKER_PLATFORM) --output "type=local,dest=dist/"; \
done
# Create virtual environment and install in editable mode locally.
install:
./install.sh
# Create self-contained Docker image.
# Also tests functionality.
docker:
docker buildx build . -f Dockerfile --platform $(DOCKER_PLATFORM) --tag mycroftai/mimic3 $(DOCKER_OUTPUT)
echo "$(DOCKER_PLATFORM)" | sed -e 's/,/\n/g' | \
while read -r platform; do \
docker buildx build . -f Dockerfile --platform $(DOCKER_PLATFORM) --tag "$(DOCKER_TAG)" $(DOCKER_OUTPUT); \
done
# Create self-container Docker image with GPU support.
# Requires nvidia-docker.
docker-gpu:
docker buildx build . -f Dockerfile.gpu --tag 'mycroftai/mimic3:gpu' $(DOCKER_OUTPUT)
docker buildx build . -f Dockerfile.gpu --tag "$(DOCKER_TAG):gpu" $(DOCKER_OUTPUT)
binaries:
# Create sample WAV files that are elsewhere for testing.
# These are different per platform (amd64, etc.).
# It's critical that deterministic mode is used to generate and test.
sample:
echo "$(DOCKER_PLATFORM)" | sed -e 's/,/\n/g' | \
while read -r platform; do \
rm -rf "dist/$${platform}"; \
docker buildx build . -f Dockerfile.binary --platform "$${platform}" --output "type=local,dest=dist/$${platform}"; \
docker buildx build . -f Dockerfile.sample --platform $(DOCKER_PLATFORM) --output "type=local,dest=tests/"; \
done
# Create Debian packages (packaged with apope voice).
# Also tests installation.
debian:
debian/build-debian.sh
test:
echo "$(DOCKER_PLATFORM)" | sed -e 's/,/\n/g' | \
while read -r platform; do \
docker buildx build . -f Dockerfile.test --platform "$${platform}"; \
docker buildx build . -f Dockerfile.debian --platform $(DOCKER_PLATFORM) --output "type=local,dest=dist/"; \
done