- Muchas notas - Fran Acién

20231003 - COSMOS on the cloud

The continuation of this note is 20231218 - OpenC3 (COSMOS) in the cloud

I am trying to deploy COSMOS on the cloud. The steps are: 3. Setup a server with terraform like 20230324 - Deploy a machine on Hertzner using Terraform 4. Install unzip 5. Download cosmos from this release 6. Run the next command curl -q -L https://curl.se/ca/cacert.pem --output ./cacert.pem 7. Then install docker compose 8. The next steps can be skipped by using the docker compose 9. It is necessary to change the endpoint of the traefik to a external one, 0.0.0.0 10. And change the configuration file to "./cosmos-traefik/traefik-allow-http.yaml:/etc/traefik/traefik.yaml" 11. Then execute docker-compose -f compose.yml up

version: "3.5"

services:
  cosmos-minio:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-minio:${COSMOS_TAG}"
    volumes:
      - "cosmos-minio-v:/data"
      - "./cacert.pem:/devel/cacert.pem"
    command: ["server", "/data"]
    restart: "unless-stopped"
    environment:
      MINIO_ROOT_USER: "${COSMOS_MINIO_USERNAME}"
      MINIO_ROOT_PASSWORD: "${COSMOS_MINIO_PASSWORD}"
      SSL_CERT_FILE: "/devel/cacert.pem"
      CURL_CA_BUNDLE: "/devel/cacert.pem"
      REQUESTS_CA_BUNDLE: "/devel/cacert.pem"
      NODE_EXTRA_CA_CERTS: "/devel/cacert.pem"

  cosmos-redis:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-redis:${COSMOS_TAG}"
    volumes:
      - "cosmos-redis-v:/data"
      - "./cacert.pem:/devel/cacert.pem"
      - "./cosmos-redis/users.acl:/config/users.acl"
    restart: "unless-stopped"
    environment:
      SSL_CERT_FILE: "/devel/cacert.pem"
      CURL_CA_BUNDLE: "/devel/cacert.pem"
      REQUESTS_CA_BUNDLE: "/devel/cacert.pem"
      NODE_EXTRA_CA_CERTS: "/devel/cacert.pem"

  cosmos-redis-ephemeral:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-redis:${COSMOS_TAG}"
    volumes:
      - "./cacert.pem:/devel/cacert.pem"
      - "./cosmos-redis/users.acl:/config/users.acl"
    restart: "unless-stopped"
    command: ["redis-server", "/config/redis_ephemeral.conf"]
    environment:
      SSL_CERT_FILE: "/devel/cacert.pem"
      CURL_CA_BUNDLE: "/devel/cacert.pem"
      REQUESTS_CA_BUNDLE: "/devel/cacert.pem"
      NODE_EXTRA_CA_CERTS: "/devel/cacert.pem"

  cosmos-cmd-tlm-api:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-cmd-tlm-api:${COSMOS_TAG}"
    restart: "unless-stopped"
    depends_on:
      - "cosmos-redis"
      - "cosmos-redis-ephemeral"
      - "cosmos-minio"
    volumes:
      - "cosmos-gems-v:/gems"
      - "./cacert.pem:/devel/cacert.pem"
    environment:
      - "RAILS_ENV=production"
      - "GEM_HOME=/gems"
    env_file:
      - ".env"

  cosmos-script-runner-api:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-script-runner-api:${COSMOS_TAG}"
    restart: "unless-stopped"
    depends_on:
      - "cosmos-redis"
      - "cosmos-redis-ephemeral"
      - "cosmos-minio"
    volumes:
      - "cosmos-gems-v:/gems:ro"
      - "./cacert.pem:/devel/cacert.pem"
    environment:
      - "RAILS_ENV=production"
      - "GEM_HOME=/gems"
    env_file:
      - ".env"

  cosmos-operator:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-operator:${COSMOS_TAG}"
    restart: "unless-stopped"
    depends_on:
      - "cosmos-redis"
      - "cosmos-redis-ephemeral"
      - "cosmos-minio"
    volumes:
      - "cosmos-gems-v:/gems:ro"
      #- ./cacert.pem:/devel/cacert.pem
    environment:
      - "GEM_HOME=/gems"
    env_file:
      - ".env"
    extra_hosts:
      - host.docker.internal:host-gateway

  cosmos-traefik:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-traefik:${COSMOS_TAG}"
    volumes:
      - "./cacert.pem:/devel/cacert.pem"
      # - "./cosmos-traefik/traefik.yaml:/etc/traefik/traefik.yaml"
      - "./cosmos-traefik/traefik-allow-http.yaml:/etc/traefik/traefik.yaml"
      # - "./cosmos-traefik/traefik-ssl.yaml:/etc/traefik/traefik.yaml"
      # - "./cosmos-traefik/traefik-letsencrypt.yaml:/etc/traefik/traefik.yaml"
      # - "./cosmos-traefik/cert.key:/etc/traefik/cert.key"
      # - "./cosmos-traefik/cert.crt:/etc/traefik/cert.crt"
    ports:
      - "0.0.0.0:2900:80"
      - "0.0.0.0:2943:443"
      # - "80:80"
      # - "443:443"
    restart: "unless-stopped"
    depends_on:
      - "cosmos-redis"
      - "cosmos-redis-ephemeral"
      - "cosmos-minio"
    environment:
      SSL_CERT_FILE: "/devel/cacert.pem"
      CURL_CA_BUNDLE: "/devel/cacert.pem"
      REQUESTS_CA_BUNDLE: "/devel/cacert.pem"
      NODE_EXTRA_CA_CERTS: "/devel/cacert.pem"

  cosmos-init:
    image: "${COSMOS_REGISTRY}/ballaerospace/cosmosc2-init:${COSMOS_TAG}"
    restart: on-failure
    depends_on:
      - "cosmos-traefik"
      - "cosmos-redis"
      - "cosmos-redis-ephemeral"
      - "cosmos-minio"
    volumes:
      - "cosmos-gems-v:/gems"
      - "./cacert.pem:/devel/cacert.pem"
    environment:
      - "GEM_HOME=/gems"
    env_file:
      - ".env"

volumes:
  cosmos-redis-v: {}
  cosmos-minio-v: {}
  cosmos-gems-v: {}

How to open a port listen incomming packets in the port

In my setup for insightsat I use a internal server to listen incomming tcp connections. I need to recreate that configuration in the server. Lets go!

I made it in the 20231218 - OpenC3 (COSMOS) in the cloud