cd - run dev_core locally via nomad as a prereq for CD to aws
noahehall opened this issue · comments
C
- terraform should be setup to manage the infrastructure, now we need another pipeline for code deployments
- before going to far with nomad integration, ensure the entire stack runs locally via nomad jobs consuming docker image artifacts output from the normal development cycle
T
- nomad
- create a server configuration for dev
- continue to use compose to build images, and use those tagged images in nomad task configs
- extract values needed for nomad out of the compose file and into an .env file for consumption by nomad as an input var file
- you can use yq to convert
docker compose convert
into json and consume the json- save json:
docker compose convert | yq -r -o=json > ./apps/nirvai-core-nomad/dev/.env.json
- save yaml:
docker compose convert > ./apps/nirvai-core-nomad/dev/compose.yaml
read the levant template docs
/docs/templates.md)
- save json:
read the nomad pack docs- you can use hcl2 for jobspecs
- set up local registry for use by nomad to pull images from
- nomad vault task
- convert to build + dockerfile instead of image so we can tag it via compose
${PROJECT_NAME}-${SERVICE_NAME}:${NODE_ENV:-development}
- convert to build + dockerfile instead of image so we can tag it via compose
- nomad postgres task in core-db group
- nomad bff task in core-bff group
- fix node bff sleep recursion waiting on vault to be ready
- use esbuild define logic to inject env vars into build and remove dotenv (which requires a file)
- nomad proxy task in core-proxy group
- convert to build + dockerfile instead of image so we can tag it via compose
${COMPOSE_PROJECT_NAME}-${SERVICE_NAME}:${NODE_ENV:-development}
- might as well handle the server conf on this ticket
- convert to build + dockerfile instead of image so we can tag it via compose
- you can use yq to convert
A
-
nomad successfuly runs all cotnainers (sans UI)
- skipping UI as the architecture is completely different (lambda, no server)
- while nomad runs each service, there not connected
- the work to translate docker networks into compose architecture would be futile, as theres a different set of requirements of usecases
-
new workflow
- docker based: continue to run nirvai-core via docker compose;
- anticipate 0 changes to this workflow, however preference should be for nomad to have closer parity with prod
- nomad based
- set NODE_ENV for tagging all images
- docker compose build: build images, will auto tag based on current NODE_ENV value
- start nomad: will find the images tagged with the current NODE_ENV and use them for each task group
- accordsing to @danielabar there may be issues around caching with nomad
- docker based: continue to run nirvai-core via docker compose;
-
fixed bff sleep logic: now bff wont automatically throw (removed throw ZombieError()) and will just recursively sleep and try forever