This document describes the high-level architecture of the State Tool and related applications (currently: State Service and State Installer).
The State Tool is a CLI application providing access to the ActiveState Platform features. It is the primary consumer of ActiveState Platform APIs which provide runtime, library and application builds. Using these reproducible, indemnified, and self-serve artifacts, the State Tool modifies the host environment in order to provide package and virtual environment management.
The State Service provides the State Tool with a central point of access to the ActiveState Platform APIs, host environment modification, and other features like caching.
The State Installer provides a cross-platform installer for the suite of State Tool applications. Shell script wrappers are provided as a convenience.
Various files (e.g. images, templates, etc.) used by any application.
Artifacts resulting from building applications.
Individual "main" applications.
Packages used exclusively for the parent application.
Developer-focused documentation.
YAML-formatted config that is processed by ytt
(https://github.com/vmware-tanzu/carvel-ytt) to produce yml files used for CI
(stored in .github/workflows/
).
Shell scripts wrapping the installer application for user convenience.
Packages that are made available for use by any application, but are restricted from use by external code.
Packages that are made available for use by "runner" packages. In essence,
internal/runners/internal/runbits
. A synonymous and deprecated directory
exists at pkg/cmdlets/
.
Packages that provide command behavior for the State Tool application.
Localization keys and associated values.
Packages that are made available for use by any application, including external
code. Note we are changing our strategy with regards to these packages,
and these will eventually be moved into the internal/
directory.
Packages focused on interacting with platform API's. Much of the behavior is
generated, but there are also critical components providing platform-dependent
client-side logic (e.g. pkg/platform/runtime
).
Packages that provide setup and interaction with the activestate.yaml files.
Helper scripts for development and deployment processes.
End-to-end tests.
Go language dependencies.
While the entry point of control flow in every application is some version of a
main file (e.g. cmd/state/main.go
), the code that tends to be modified the
most lives in internal/runners/
, pkg/
, and internal/
.
State Tool interactions are routed from command line arguments to the
appropriate "runner" where the runner can be thought of as a "handler" or
"controller". Various output formats (which can be thought of as "views") are
available and defined by logic within internal/output
. Similarly, commonly
used logic is defined in packages like pkg/project
.
Currently, the State Service is in its beginning stages of importance. As it matures, it will become more central to code changes. For the State Service, the interactions are GraphQL queries that are routed to handlers.
The project file contains information that connects a project to the platform,
and also provides local behavior similar to make
. The most commonly used
scripts are preprocess
and build
. Run state scripts
for a full listing.