From 26902b792cbb73f04d7b8b5ddd349cc1a34ea0b9 Mon Sep 17 00:00:00 2001 From: bedanley Date: Wed, 6 Nov 2024 11:04:44 -0700 Subject: [PATCH] Add finch support (#174) --- Makefile | 19 +++++++++---------- README.md | 3 ++- package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index c5129a00..6928b92c 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) HEADLESS = false - +DOCKER_CMD := $(CDK_DOCKER) +DOCKER_CMD ?= docker # Arguments defined through command line or config.yaml # PROFILE (optional argument) @@ -150,13 +151,11 @@ installTypeScriptRequirements: ## Make sure Docker is running dockerCheck: - @cmd_output=$$(docker ps); \ - if \ - [ $$? != 0 ]; \ - then \ - echo $$cmd_output; \ - exit 1; \ - fi; \ + @cmd_output=$$(pgrep -f "${DOCKER_CMD}"); \ + if [ $$? != 0 ]; then \ + echo "Process $(DOCKER_CMD) is not running. Exiting..."; \ + exit 1; \ + fi \ ## Check if models are uploaded modelCheck: @@ -229,11 +228,11 @@ cleanMisc: dockerLogin: dockerCheck ifdef PROFILE @$(foreach ACCOUNT,$(ACCOUNT_NUMBERS_ECR), \ - aws ecr get-login-password --region ${REGION} --profile ${PROFILE} | docker login --username AWS --password-stdin $(ACCOUNT).dkr.ecr.${REGION}.${URL_SUFFIX} >/dev/null 2>&1; \ + aws ecr get-login-password --region ${REGION} --profile ${PROFILE} | ${DOCKER_CMD} login --username AWS --password-stdin ${ACCOUNT}.dkr.ecr.${REGION}.${URL_SUFFIX} >/dev/null 2>&1; \ ) else @$(foreach ACCOUNT,$(ACCOUNT_NUMBERS_ECR), \ - aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin $(ACCOUNT).dkr.ecr.${REGION}.${URL_SUFFIX} >/dev/null 2>&1; \ + aws ecr get-login-password --region ${REGION} | ${DOCKER_CMD} login --username AWS --password-stdin ${ACCOUNT}.dkr.ecr.${REGION}.${URL_SUFFIX} >/dev/null 2>&1; \ ) endif diff --git a/README.md b/README.md index 78b4ee0f..2d7cadab 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ Before beginning, ensure you have: 3. Familiarity with AWS Cloud Development Kit (CDK) and infrastructure-as-code principles 4. Python 3.9 or later 5. Node.js 14 or later -6. Docker installed and running +6. Docker/Finch installed and running 7. Sufficient disk space for model downloads and conversions If you're new to CDK, review the [AWS CDK Documentation](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) and consult with your AWS support team. @@ -235,6 +235,7 @@ Set the following environment variables: export PROFILE=my-aws-profile # Optional, can be left blank export DEPLOYMENT_NAME=my-deployment export ENV=dev # Options: dev, test, or prod +export CDK_DOCKER=finch # Optional, only required if not using docker as container engine ``` --- diff --git a/package.json b/package.json index 41e648f2..f90ce33e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "migrate-properties": "node ./scripts/migrate-properties.mjs", "postinstall": "(cd lib/user-interface/react && npm install) && (cd lib/docs && npm install)", "postbuild": "(cd lib/user-interface/react && npm build) && (cd lib/docs && npm build)" -}, + }, "devDependencies": { "@aws-cdk/aws-lambda-python-alpha": "2.125.0-alpha.0", "@aws-sdk/client-iam": "^3.490.0",