Skip to content

Commit

Permalink
Hook up docker and gradle
Browse files Browse the repository at this point in the history
- Action Server builds alongside the rest of the aerie core when using gradlew

- This will include the Action server as an Aerie core service and launches with the rest of aerie for development and production
  • Loading branch information
goetzrrGit committed Feb 12, 2025
1 parent 20168aa commit 2c1a721
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
13 changes: 13 additions & 0 deletions action-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22.13.1-bookworm-slim

# Install jemalloc
RUN apt-get update \
&& apt-get install --no-install-recommends -y libjemalloc-dev

# Set the path for jemalloc
RUN echo "/usr/lib/$(uname -m)-linux-gnu/libjemalloc.so" >> /etc/ld.so.preload

# Set working directory
COPY . /app
WORKDIR /app
CMD [ "npm", "start" ]
13 changes: 13 additions & 0 deletions action-server/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22.13.1-bookworm-slim

# Install jemalloc
RUN apt-get update \
&& apt-get install --no-install-recommends -y libjemalloc-dev

# Set the path for jemalloc
RUN echo "/usr/lib/$(uname -m)-linux-gnu/libjemalloc.so" >> /etc/ld.so.preload

# Set working directory
COPY . /app
WORKDIR /app
CMD [ "npm", "dev" ]
26 changes: 26 additions & 0 deletions action-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
id 'com.github.node-gradle.node' version '5.0.0'
}

node {
version = '22.13.1'
download = true
}

task assemble(type: NpmTask) {
dependsOn npmInstall
args = ['--silent', 'run', 'build']
}

task build {
dependsOn assemble
}

task clean(type: Delete) {
delete 'build'
}

task e2eTest(type: NpmTask) {
dependsOn npmInstall
args = ['--silent', 'run', 'test']
}
27 changes: 27 additions & 0 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
version: "3.7"
services:
aerie_action:
build:
context: ./action-server
dockerfile: Dockerfile
#dockerfile: Dockerfile.dev #-- Uncomment for development
container_name: aerie_action
depends_on: [ "postgres" ]
environment:
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
LOG_FILE: console
LOG_LEVEL: debug
MERLIN_GRAPHQL_URL: http://hasura:8080/v1/graphql
ACTION_SERVER_PORT: 27186
AERIE_DB_HOST: postgres
AERIE_DB_PORT: 5432
# ACTION_DB_USER: "${ACTION_USERNAME}"
# ACTION_DB_PASSWORD: "${ACTION_PASSWORD}"
ACTION_LOCAL_STORE: /usr/src/app/action_file_store
ACTION_WORKER_NUM: 8
ACTION_MAX_WORKER_NUM: 8
image: aerie_action
ports: [ "27186:27186" ]
#ports: [ "27186:27186",'9229:9229'] #-- Uncomment for development
restart: always
volumes:
- ./action-server:/app:cached
- aerie_file_store:/usr/src/app/action_file_store
aerie_gateway:
container_name: aerie_gateway
depends_on: ["postgres"]
Expand Down
27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
version: "3.7"
services:
aerie_action:
build:
context: ./action-server
dockerfile: Dockerfile
#dockerfile: Dockerfile.dev #-- Uncomment for development
container_name: aerie_action
depends_on: [ "postgres" ]
environment:
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
LOG_FILE: console
LOG_LEVEL: debug
MERLIN_GRAPHQL_URL: http://hasura:8080/v1/graphql
ACTION_SERVER_PORT: 27186
AERIE_DB_HOST: postgres
AERIE_DB_PORT: 5432
# ACTION_DB_USER: "${ACTION_USERNAME}"
# ACTION_DB_PASSWORD: "${ACTION_PASSWORD}"
ACTION_LOCAL_STORE: /usr/src/app/action_file_store
ACTION_WORKER_NUM: 8
ACTION_MAX_WORKER_NUM: 8
image: aerie_action
ports: [ "27186:27186" ]
#ports: [ "27186:27186",'9229:9229'] #-- Uncomment for development
restart: always
volumes:
- ./action-server:/app:cached
- aerie_file_store:/usr/src/app/action_file_store
aerie_gateway:
container_name: aerie_gateway
depends_on: ["postgres"]
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include 'merlin-worker'
include 'scheduler-server'
include 'scheduler-worker'
include 'sequencing-server'
include 'action-server'

// Command-line interface direct to services
include 'constraints'
Expand Down

0 comments on commit 2c1a721

Please sign in to comment.