Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
75 changes: 75 additions & 0 deletions docker-compose-opensearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: '3.8'
services:
opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)
image: opensearchproject/opensearch:latest
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster # Name the cluster
- node.name=opensearch-node1 # Name the node that will run in this container
- discovery.seed_hosts=opensearch-node1,opensearch-node2 # Nodes to look for when discovering the cluster
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 # Nodes eligibile to serve as cluster manager
- bootstrap.memory_lock=true # Disable JVM heap memory swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=yourStrongPassword123! # Sets the demo admin user password when using demo configuration (for OpenSearch 2.12 and later)
ulimits:
memlock:
soft: -1 # Set memlock to unlimited (no soft or hard limit)
hard: -1
nofile:
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
networks:
- opensearch-net # All of the containers will join the same Docker bridge network
opensearch-node2:
image: opensearchproject/opensearch:latest # This should be the same image used for opensearch-node1 to avoid issues
container_name: opensearch-node2
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node2
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=yourStrongPassword123!
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data2:/usr/share/opensearch/data
networks:
- opensearch-net
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:latest # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
container_name: opensearch-dashboards
ports:
- 5601:5601 # Map host port 5601 to container port 5601
expose:
- "5601" # Expose port 5601 for web access to OpenSearch Dashboards
environment:
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query
DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true" # For testing only
OPENSEARCH_SSL_VERIFICATIONMODE: none
networks:
- opensearch-net

volumes:
opensearch-data1:
name: macro_opensearch_1
external: true
opensearch-data2:
name: macro_opensearch_2
external: true

networks:
opensearch-net:
name: opensearch-net
driver: bridge
127 changes: 127 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
version: '3.8'
services:
macrodb:
image: postgres:16
container_name: macrodb
ports:
- '5432:5432'
expose:
- '5432'
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- PGPASSWORD=password
volumes:
- db:/var/lib/postgresql/data
- ./database/Initiate.sql:/etc/Initiate.sql
- ./database/Clear.sql:/etc/Clear.sql
networks:
- macro_api_network

macrocache:
image: 'redis/redis-stack:latest'
container_name: macrocache
ports:
- '6379:6379' # Expose Redis on the default port
- '8001:8001' # Expose Redis Stack Server UI/tools
environment:
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- cache:/data
networks:
- macro_api_network
redis-node-0:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6369
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-0
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_CLUSTER_CREATOR=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6369:6369'
depends_on: [redis-node-1, redis-node-2, redis-node-3, redis-node-4]
networks:
- macro_api_network

redis-node-1:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6380
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-1
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6380:6380'
networks:
- macro_api_network

redis-node-2:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6381
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-2
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6381:6381'
networks:
- macro_api_network

redis-node-3:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6382
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-3
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6382:6382'
networks:
- macro_api_network

redis-node-4:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6383
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-4
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6383:6383'
networks:
- macro_api_network

redis-node-5:
image: bitnami/redis-cluster:7.0
environment:
- REDIS_PORT_NUMBER=6384
- REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE=hostname
- REDIS_CLUSTER_ANNOUNCE_HOSTNAME=redis-node-5
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_NODES=redis-node-0:6369,redis-node-1:6380,redis-node-2:6381, redis-node-3:6382,redis-node-4:6383, redis-node-5:6384
ports:
- '6384:6384'
networks:
- macro_api_network

networks:
macro_api_network:
name: macro_api_network
driver: bridge
macro_fusion_network:
# external: true
volumes:
db:
name: macro_db_volume
external: true
# driver: local
cache:
name: macro_cache_volume
# external: true
driver: local
8 changes: 8 additions & 0 deletions infra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.turbo
*.js
!.eslintrc.js
!.prettierrc.js
!library.js

node_modules
dist
1 change: 1 addition & 0 deletions infra/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.7.3
12 changes: 12 additions & 0 deletions infra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Macro Cloud Infra

This monorepo contains the code for all Macro Cloud IaC.

## IaC
Infrastructure is written with [pulumi](https://www.pulumi.com/docs/) with typescript and bun.

We use AWS for all infrastructure so ask to be added to the aws org and setup [pulumi with aws](https://www.pulumi.com/registry/packages/aws/installation-configuration/). All of our infra is on `us-east-1`.

The stacks directory represents the infrastructure for each service and pulumi should be run from inside a stack directory. From `stacks/my-service/` run `pulumi up --stack [dev | prod]` to deploy.

We use datadog (on `us-central-1`) for logging.
Loading