Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Dec 11, 2023
1 parent c3c9c21 commit e90c50e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 38 deletions.
8 changes: 8 additions & 0 deletions docs.openc3.com/docs/configuration/protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ The Length Protocol depends on a length field at a fixed location in the defined
| Max Length | The maximum allowed value in the length field | No | nil (no maximum length) |
| Fill Length and Sync Pattern | Setting this flag to true causes the length field and sync pattern (if present) to be filled automatically on outgoing packets. | No | false |

The most confusing aspect of the Length Protocol is calculating the Length Value Offset. This is especially true in the commonly used CCSDS Space Packet Protocol. The best way to illustrate this is with an example. Suppose you have CCSDS Space Packets prepended with a Sync Pattern of 0x1ACFFC1D. This would look like the following:

| Sync (4 bytes) | Header (4 bytes) | Length (2 bytes) | Data (4 bytes) |
| -------------- | ---------------- | ---------------- | -------------- |
| 0x1ACFFC1D | 0x0001CADB | 0x0003 | 0xDEADBEEF |

In this case the total length of the packet is 14 bytes: **4 + 4 + 2 + 4 = 14**. With 4 bytes of data, the length field is 3 because in CCSDS the length field is calculated as (data length - 1). So how would we calculate the Length Value Offset? COSMOS reads all the bytes in the packet (including the Sync Pattern) so the total length is 14 bytes. The length field is 3 so the Length Value Offset (offset to apply to the length field value) should be 11 (**3 + 11 = 14**).

### Terminated Protocol

The Terminated Protocol delineates packets using termination characters found at the end of every packet. It continuously reads data until the termination characters are found at which point it returns the packet data. For example, all the packets using the interface are followed by 0xABCD. This data can either be a part of each packet that is kept or something which is known only by the Terminated Protocol and simply thrown away.
Expand Down
56 changes: 18 additions & 38 deletions docs.openc3.com/docs/getting-started/key_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,14 @@ title: Key Concepts

## Projects

The main COSMOS [repo](https://github.com/OpenC3/cosmos) contains all the source code used to build and run COSMOS. However, users (not developers) of COSMOS should use the COSMOS [project](https://github.com/OpenC3/cosmos-project) to launch COSMOS. The project consists of the [openc3.sh](https://github.com/OpenC3/cosmos-project/blob/main/openc3.sh) and [openc3.bat](https://github.com/OpenC3/cosmos-project/blob/main/openc3.bat) files for starting and stopping COSMOS, the [compose.yaml](https://github.com/OpenC3/cosmos-project/blob/main/compose.yaml) for configuring the COSMOS containers, and the [.env](https://github.com/OpenC3/cosmos-project/blob/main/.env) file for setting runtime variables.
The main COSMOS [repo](https://github.com/OpenC3/cosmos) contains all the source code used to build and run COSMOS. However, users (not developers) of COSMOS should use the COSMOS [project](https://github.com/OpenC3/cosmos-project) to launch COSMOS. The project consists of the [openc3.sh](https://github.com/OpenC3/cosmos-project/blob/main/openc3.sh) and [openc3.bat](https://github.com/OpenC3/cosmos-project/blob/main/openc3.bat) files for starting and stopping COSMOS, the [compose.yaml](https://github.com/OpenC3/cosmos-project/blob/main/compose.yaml) for configuring the COSMOS containers, and the [.env](https://github.com/OpenC3/cosmos-project/blob/main/.env) file for setting runtime variables. Additionally, the COSMOS project contains user modifiable config files for both Redis and Traefik.

## Containerization

### Images

Per [Docker](https://docs.docker.com/get-started/overview/#images), "An image is a read-only template with instructions for creating a Docker container." The base operating system COSMOS uses is called [Alpine Linux](https://www.alpinelinux.org/). It is a simple and compact image with a full package system that allows us to install our dependencies. Starting with Alpine, we create a [Dockerfile](https://docs.docker.com/engine/reference/builder/) to add Ruby and Python and a few other packages to create our own docker image. We further build upon that image to create a NodeJS image to support our frontend and additional images to support our backend.

The image list for Open Source COSMOS consists of the following:

| Name | Description |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| [openc3-ruby](https://github.com/OpenC3/cosmos/blob/main/openc3-ruby/Dockerfile) | Alpine image containing Ruby and Python |
| [openc3-base](https://github.com/OpenC3/cosmos/blob/main/openc3/Dockerfile) | Builds on openc3-ruby and includes all the COSMOS source code |
| [openc3-node](https://github.com/OpenC3/cosmos/blob/main/openc3-node/Dockerfile) | Builds on openc3-base and includes NodeJS for COSMOS frontend development |
| [openc3-cosmos-init](https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/Dockerfile) | Builds on openc3-node, copies all the COSMOS tools and builds them |
| [openc3-operator](https://github.com/OpenC3/cosmos/blob/main/openc3-operator/Dockerfile) | Sets up the base image to run microservice_operator.rb |
| [openc3-cosmos-cmd-tlm-api](https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-cmd-tlm-api/Dockerfile) | Builds on openc3-base and includes and starts Ruby on Rails |
| [openc3-cosmos-script-runner-api](https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-script-runner-api/Dockerfile) | Builds on openc3-base and includes and starts Ruby on Rails |
| [openc3-redis](https://github.com/OpenC3/cosmos/blob/main/openc3-redis/Dockerfile) | Builds on the public redis image and copies in custom COSMOS config |
| [openc3-minio](https://github.com/OpenC3/cosmos/blob/main/openc3-minio/Dockerfile) | Builds on the public minio image |
| [openc3-traefik](https://github.com/OpenC3/cosmos/blob/main/openc3-traefik/Dockerfile) | Builds on the public traefik image and copies in custom COSMOS config |

The image list for [Enterprise COSMOS](https://openc3.com/enterprise) consists of the following additional images:

| Name | Description |
| ---------------------------- | ------------------------------------------------------------------------------ |
| openc3-enterprise-gem | Builds on openc3-base and copies in Enterprise specific files |
| openc3-enterprise-metrics | Builds on openc3-enterprise-gem and starts Ruby on Rails |
| openc3-enterprise-keycloak | Builds on the public keycloak image and copies the COSMOS realm.json |
| openc3-enterprise-nfs | Builds on base Alpine and creates a NFS server mounting the /exports directory |
| openc3-enterprise-postgresql | Builds on the public PostgreSQL database for use by Keycloak |

### Containers

Per [Docker](https://www.docker.com/resources/what-container/), "a container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another." Also per [Docker](https://docs.docker.com/guides/walkthroughs/what-is-a-container/), "A container is an isolated environment for your code. This means that a container has no knowledge of your operating system, or your files. It runs on the environment provided to you by Docker Desktop. Containers have everything that your code needs in order to run, down to a base operating system." COSMOS utilizes containers to provide a consistent runtime environment. Containers make it easy to deploy to local on-prem servers, cloud environments, or air-gapped networks.
Expand All @@ -57,19 +32,14 @@ The COSMOS Open Source containers consist of the following:
| cosmos-openc3-minio-1 | Provides a S3 like bucket storage interface and also serves as a static webserver for the tool files |
| cosmos-openc3-traefik-1 | Provides a reverse proxy and load balancer with routes to the COSMOS endpoints |

The image list for [Enterprise COSMOS](https://openc3.com/enterprise) consists of the following:

| Name | Description |
| ------------------------------------- | -------------------------------------------------------- |
| cosmos-enterprise-openc3-metrics-1 | Rails server that provides metrics on COSMOS performance |
| cosmos-enterprise-openc3-keycloak-1 | Single-Sign On service for authentication |
| cosmos-enterprise-openc3-postgresql-1 | SQL Database for use by Keycloak |

### Kubernetes

Per [Kubernetes.io](https://kubernetes.io/), "Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery." [COSMOS Enterprise](https://openc3.com/enterprise) provides [Helm charts](https://helm.sh/docs/topics/charts/) for easy deployment to Kubernetes in various cloud environments.
The container list for [Enterprise COSMOS](https://openc3.com/enterprise) consists of the following:

COSMOS Enterprise also provides [Terraform](https://www.terraform.io/) scripts to deploy COSMOS infrastructure on various cloud environments.
| Name | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------------- |
| cosmos-enterprise-openc3-metrics-1 | Rails server that provides metrics on COSMOS performance |
| cosmos-enterprise-openc3-keycloak-1 | Single-Sign On service for authentication |
| cosmos-enterprise-openc3-postgresql-1 | SQL Database for use by Keycloak |
| openc3-nfs \* | Network File System pod only for use in Kubernetes to share code libraries between containers |

### Docker Compose

Expand All @@ -79,6 +49,12 @@ Per [Docker](https://docs.docker.com/compose/), "Compose is a tool for defining

COSMOS uses an [environment file](https://docs.docker.com/compose/environment-variables/env-file/) along with Docker Compose to pass environment variables into the COSMOS runtime. This [.env](https://github.com/OpenC3/cosmos-project/blob/main/.env) file consists of simple key value pairs that contain the version of COSMOS deployed, usernames and passwords, and much more.

### Kubernetes

Per [Kubernetes.io](https://kubernetes.io/), "Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery." [COSMOS Enterprise](https://openc3.com/enterprise) provides [Helm charts](https://helm.sh/docs/topics/charts/) for easy deployment to Kubernetes in various cloud environments.

COSMOS Enterprise also provides [Terraform](https://www.terraform.io/) scripts to deploy COSMOS infrastructure on various cloud environments.

## Frontend

### Vue.js
Expand All @@ -89,6 +65,10 @@ The COSMOS frontend is fully browser native and is implented in the Vue.js frame

While COSMOS itself is written in Vue.js, we utilize a technology called [single-spa](https://single-spa.js.org/) to allow COSMOS developers to create applications in any javascript framework they choose. Single-spa is a micro frontend framework and acts as a top level router to render the application being requested. COSMOS provides sample applications ready to plug into single-spa in Angular, React, Svelt, and Vue.

### Astro UX

Per [AstroUXDS](https://www.astrouxds.com/), "The Astro Space UX Design System enables developers and designers to build rich space app experiences with established interaction patterns and best practices." COSMOS utilizes the Astro design guidelines for color, typograpy, and iconograpy. In some cases, e.g. [Astro Clock](https://www.astrouxds.com/components/clock/), COSMOS directly incorporates Astro components.

## Backend

### Redis
Expand Down

0 comments on commit e90c50e

Please sign in to comment.