v5

Installation

Installing COSMOS

The following sections describe how to get COSMOS installed on various operating systems. A major difference between COSMOS v4 and COSMOS v5 is the usage of containers. This document should help you setup you host machine to allow you to have a running version of COSMOS in no time.

Installing COSMOS on Host Machines

INSTALL

Install Docker and install Docker Compose.

  • Minimum Resources allocated to Docker: 8GB RAM, 1 CPU, 80GB Disk
  • Recommended Resources allocated to Docker: 16GB RAM, 2+ CPUs, 100GB Disk
  • Docker on Windows with WSL2:

    • WSL2 consumes 50% of total memory on Windows or 8GB, whichever is less. However, on Windows builds before 20175 (use winver to check) it consumes 80% of your total memory. This can have a negative effect on Windows performance!
    • On Windows builds < 20175 or for more fine grained control, create C:\Users\<username>\.wslconfig. Suggested contents on a 32GB machine:

      [wsl2]
      memory=16GB
      swap=0
      
  • Modifying Docker connection timeouts (very rarely needed):
    • Docker will close idle (no data) connections after a period of 5 minutes. If you want to support a COSMOS configuration consisting of completely idle targets (no cmd/tlm) for greater than 5 minutes you can modify this setting. Find the file at C:\Users\<username>\AppData\Roaming\Docker\settings.json. Modify the value vpnKitMaxPortIdleTime to change the timeout. Note: 0 means no timeout (idle connections not dropped)

Note: As of December 2021 the COSMOS Docker containers are based on the Alpine Docker image.

DOWNLOAD

Download the latest COSMOS 5 from the Github releases. You can also clone the master branch to get the latest updates.

EXTRACT

Extract the archive somewhere on your host computer.

ENVIRONMENT

The COSMOS 5 containers are designed to work and be built in the presence of an SSL Decryption device. To support this a cacert.pem file can be placed at the base of the COSMOS 5 project that includes any certificates needed by your organization. Note: If you set the path to the ssl file in the SSL_CERT_FILE environment variables the cosmos-control setup script will copy it and place it for the docker container to load.

SSL Issues

Increasingly organizations are using some sort of SSL decryptor device which can cause curl and other command line tools like git to have SSL certificate problems. If installation fails with messages that involve "certificate", "SSL", "self-signed", or "secure" this is the problem. IT typically sets up browsers to work correctly but not command line applications. Note that the file extension might not be .pem, it could be .pem, crt, .ca-bundle, .cer, .p7b, .p7s, or potentially something else.

The workaround is to get a proper local certificate file from your IT department that can be used by tools like curl (for example mine is at C:\Shared\Ball.pem). Doesn't matter just somewhere with no spaces.

Then set the following environment variables to that path (ie. C:\Shared\Ball.pem)

SSL_CERT_FILE
CURL_CA_BUNDLE
REQUESTS_CA_BUNDLE

Here are some directions on environment variables in Windows: Windows Environment Variables
You will need to create new ones with the names above and set their value to the full path to the certificate file.

At Ball please contact cosmos@ballaerospace.com for assistance.

Offline Installation

If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the .env file. Example values:

ALPINE_VERSION=3.15
ALPINE_BUILD=0
RUBYGEMS_URL=https://rubygems.org
NPM_URL=https://registry.npmjs.org
APK_URL=http://dl-cdn.alpinelinux.org

Create a zip file which can be transferred by running cosmos-control.bat util zip

If you're on Unix, once you unzip the file run the following: find . -name "*.sh" | xargs chmod +x

RUN

Run cosmos-control.bat start (Windows), or cosmos-control.sh start (linux/Mac).

If you see an error indicating docker daemon is not running ensure Docker and Docker compose is installed and running. If it errors please try to run docker --version or docker-compose --version and try to run the start command again. If the error continues please include the version in your issue if you choose to create one.

cosmos-control.* can help solve some of the short falls of docker-compose when building the containers.

cosmos-control.* takes multiple arguments. Run with no arguments for help. An example run of cosmos-control.bat with no arguments will show a usage guide.

.\cosmos-control.bat
Usage: "cosmos-control.bat" [start, stop, cleanup, build, run, deploy, util]
*  build: build the containers for cosmos
*  start: run the docker containers for cosmos
*  stop: stop the running docker containers for cosmos
*  restart: stop and run the minimal docker containers for cosmos
*  cleanup: cleanup network and volumes for cosmos
...
Docker minio/mc issue

On some windows systems we have seen docker error when building the cosmosc2-minio-init container. It could be due to an issue downloading the minio mc container. To solve this you can manually pull the minio container. Open the minio-init Dockerfile, note the FROM line, e.g. FROM minio/mc:RELEASE.2021-12-10T00-14-28Z, and manually pull the image.

Note: Image name may be different in current Dockerfile
docker pull minio/mc:RELEASE.2021-12-10T00-14-28Z

This should download the minio/mc container locally and not have docker-compose pull the image on build. Now re-run cosmos-control start and continue on the cosmos adventure.

WAIT

COSMOS 5 will be built and when ready should be running (~15 mins for first run, ~2 for subsequent). Running docker ps can help show the running containers.

CONNECT

Connect a web browser to http://localhost:2900.

NEXT STEPS

Continue to Getting Started.


Feedback

Find a problem in the documentation?

Please create an issue on GitHub describing what we can do to make it better.

Let us know what could be better!

Both using and hacking on COSMOS should be fun, simple, and easy, so if for some reason you find it's a pain, please create an issue on GitHub describing your experience so we can make it better.