infra

module
v0.0.1-0...-8535732 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0

README

Dev Prod

Infra

🌧️ Automated infrastructure and demo provisioning

Development

Infra (the server) and infractl (the cli) are written in Go, and use gRPC for client-server communication. The UI uses a React/Typescript/Yarn toolchain (see ui/README.md).

While a development workflow can be achieved using a locally installed toolchain, it is also possible to rely on CI. CI will lint, build and push the infra server. And then deploy it to a development cluster created using the production infra deployment. A (comment)[https://github.com/stackrox/infra/pull/711#issuecomment-1270457578] will appear on PRs with more detail.

Debugging

If opened in VS Code, you will find configurations for debugging CLI and Server.

CLI

To debug a CLI command, update the VS Code launch configuration "Debug CLI" with the desired command and update the INFRA_TOKEN value if necessary. You may also point to a different infra server with the --endpoint flag.

Server

To debug the server, you need to fulfil the prerequisites first.

  1. Have an authenticated gcloud CLI and GNU sed installed.
  2. Have your KUBECONFIG point to a cluster where Argo Workflows and the ConfigMaps and Secrets for infra are deployed. This is most easily achieved by connecting to a PR cluster or deploying infra with ENVIRONMENT=<DEVELOPMENT,PRODUCTION> make install-argo clean-argo-config helm-deploy to a new or local cluster. This cluster will only be used to run workflows.
  3. Run make prepare-local-server-debugging to set the contents of the configuration directory and compile the UI + CLI (for downloads).

Then, you can use the "Debug Server" launch configuration.

Regenerate Go bindings from protos

To regenerate the Go proto bindings, run:

make proto-generated-srcs

Building the server and cli

To compile a server and client binary, run:

make server cli-local

Building or pushing images

GitHub Actions will build and push the infra-server image based on make tag of the most recent commit. Or you can build and push locally if you have the correct tooling installed with:

make image push

Deployment

For additional information on how this service is deployed, please refer to the deployment instructions.

Runbook

For additional information on how to debug and remediate issues with the deployed service, please refer to the runbook instructions.

Directories

Path Synopsis
Package auth facilitates an OAuth login/logout flow.
Package auth facilitates an OAuth login/logout flow.
cmd
infractl/cli
Package cli implements the infractl cli ...
Package cli implements the infractl cli ...
infractl/cli/upgrade
Package upgrade implements the infractl cli upgrade command.
Package upgrade implements the infractl cli upgrade command.
infractl/cluster/artifacts
Package artifacts implements the infractl artifacts command.
Package artifacts implements the infractl artifacts command.
infractl/cluster/create
Package create implements the infractl create command.
Package create implements the infractl create command.
infractl/cluster/delete
Package delete implements the infractl delete command.
Package delete implements the infractl delete command.
infractl/cluster/get
Package get implements the infractl get command.
Package get implements the infractl get command.
infractl/cluster/lifespan
Package lifespan implements the infractl lifespan command.
Package lifespan implements the infractl lifespan command.
infractl/cluster/list
Package list implements the infractl list command.
Package list implements the infractl list command.
infractl/cluster/logs
Package logs implements the infractl logs command.
Package logs implements the infractl logs command.
infractl/common
Package common provides some helper functionality for building command line handlers.
Package common provides some helper functionality for building command line handlers.
infractl/flavor
Package flavor implements the infractl flavor ...
Package flavor implements the infractl flavor ...
infractl/flavor/get
Package get implements the infractl flavor get command.
Package get implements the infractl flavor get command.
infractl/flavor/list
Package list implements the infractl flavor list command.
Package list implements the infractl flavor list command.
infractl/status/get
Package get implements the infractl status get command.
Package get implements the infractl status get command.
infractl/status/reset
Package reset implements the infractl status reset command.
Package reset implements the infractl status reset command.
infractl/status/set
Package set implements the infractl status set command.
Package set implements the infractl status set command.
infractl/token
Package token implements the infractl token command.
Package token implements the infractl token command.
infractl/version
Package version implements the infractl version command.
Package version implements the infractl version command.
infractl/whoami
Package whoami implements the infractl whoami command.
Package whoami implements the infractl whoami command.
Package config provides configurability for the entire application.
Package config provides configurability for the entire application.
Package flavor enables the configuration and registration of flavors and their associated Argo workflows.
Package flavor enables the configuration and registration of flavors and their associated Argo workflows.
generated
api/v1
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.
pkg
buildinfo
Package buildinfo provides information about the built binary and the environment in which it was built.
Package buildinfo provides information about the built binary and the environment in which it was built.
kube
Package kube provides access to the k8s API
Package kube provides access to the k8s API
logging
Package logging provides wrappers around zap logging.
Package logging provides wrappers around zap logging.
scripts
local-dev Module
Package server facilitates running a HTTPS and gRPC server.
Package server facilitates running a HTTPS and gRPC server.
cluster
Package cluster provides an implementation for the Cluster gRPC service.
Package cluster provides an implementation for the Cluster gRPC service.
middleware
Package middleware provides functionality for instrumenting and enriching grpc connections.
Package middleware provides functionality for instrumenting and enriching grpc connections.
Package signer facilitates the generation of signed GCS URLS.
Package signer facilitates the generation of signed GCS URLS.
Package slack handles interfacing with the Slack API.
Package slack handles interfacing with the Slack API.
test
e2e

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL