-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
pipeline/relation_embedder/batcher/local.docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Run locally using `docker compose build lambda && docker compose run --rm --service-ports lambda` | ||
services: | ||
lambda: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: lambda_rie | ||
volumes: | ||
- ~/.aws:/root/.aws | ||
ports: | ||
- "9000:8080" | ||
environment: | ||
- AWS_PROFILE=platform-developer | ||
- metrics_namespace=catalogue-dev_batcher | ||
- use_downstream=stdio | ||
- max_batch_size=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [ "$#" -lt 1 ]; then | ||
echo "Usage: $0 <PIPELINE_DATE> [--skip-build]" | ||
exit 1 | ||
fi | ||
|
||
export PIPELINE_DATE=$1 | ||
SKIP_BUILD=false | ||
if [ "$#" -eq 2 ] && [ "$2" == "--skip-build" ]; then | ||
SKIP_BUILD=true | ||
fi | ||
|
||
PROJECT_NAME="batcher" | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
cd "$DIR"/.. | ||
|
||
# Read template.env, substitute variables, and write to .env | ||
if [ -f template.env ]; then | ||
envsubst < template.env > .env | ||
fi | ||
|
||
# Build the project, skipping if requested | ||
if [ "$SKIP_BUILD" = true ]; then | ||
echo "Skipping build" | ||
else | ||
pushd ../../.. | ||
sbt "project $PROJECT_NAME" ";stage" | ||
popd | ||
fi | ||
|
||
# Build the docker image | ||
docker compose -f local.docker-compose.yml \ | ||
build lambda | ||
|
||
# Run the docker image | ||
docker compose -f local.docker-compose.yml \ | ||
run --rm --service-ports lambda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters