Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ if has devbox
then
unstrict_env # seems to be required for devbox :(
eval "$(devbox generate direnv --print-envrc)"
# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# check out <https://www.jetpack.io/devbox/docs/ide_configuration/direnv>
# for more details

# Regarding shell-completion for zsh: This is not so easy to do here due to the way, direnv
# works. Let's revisit this, when <https://github.com/direnv/direnv/issues/443> has been solved.
echo -e \
'🪧 For shell-completion within zsh, please execute:' "\n" \
"\t" 'fpath=("${DEVBOX_PACKAGES_DIR}/share/zsh/site-functions" ${fpath})' "\n" \
"\t" 'compinit'
fi

local bbl_state_dir=${BBL_STATE_PATH:-'../app-autoscaler-env-bbl-state/bbl-state'}
Expand Down
51 changes: 19 additions & 32 deletions ci/README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
# app-autoscaler-ci

This repository provides all public scripts and pipeline deployments used
by the app autoscaler team. The public pipeline is hosted at: <https://concourse.app-runtime-interfaces.ci.cloudfoundry.org>.
This repository provides all public scripts and pipeline deployments used by the app “autoscaler-team”. The public pipeline is hosted at: <https://concourse.app-runtime-interfaces.ci.cloudfoundry.org>

To reproduce this pipeline, you can use your own private configuration files for the `pipeline.yml` files as described below.

## Autoscaler

This directory contains the concourse `pipeline.yml` for the autoscaler [pipeline](https://concourse.app-runtime-interfaces.ci.cloudfoundry.org/teams/app-autoscaler/pipelines/app-autoscaler-release)
and all of the associated scripts. To use this manifest, you need to provide a private configuration file
for all of the template parameters.
🚸 __Important__: Regarding the concourse-pipelines, please note that there is a dedicated credhub-instance that differs from the one that is used for the bosh-director to render manifests. It needs to contain the credhub-secrets that are referenced in the pipeline-definition. Their paths must be prefixed by `/concourse/<team-name>` (e.g. `/concourse/app-autoscaler`). The login to that instance can be done via calling the script [terragrunt/scripts/concourse/start-credhub-cli.sh](<https://github.com/cloudfoundry/app-runtime-interfaces-infrastructure/blob/main/terragrunt/scripts/concourse/start-credhub-cli.sh>) in the repository <https://github.com/cloudfoundry/app-runtime-interfaces-infrastructure>.

NOTE: If you are recreating this pipeline, for personal use and do not have authority to update
tracker or push to github. The `pipeline.yml` file needs to have any `tracker` sections commented
out as well as the app-autoscaler private key

## dockerfiles
## Autoscaler
This directory contains the concourse `pipeline.yml` for the autoscaler-[pipeline](<https://concourse.app-runtime-interfaces.ci.cloudfoundry.org/teams/app-autoscaler/pipelines/app-autoscaler-release>) and all of the associated scripts. To use this manifest, you need to provide a private configuration file for all of the template parameters.

These docker images in this repo are built and pushed with GitHub actions, they are hosted on ghcr.io
🪧 _NOTE_: If you are recreating this pipeline, for personal use and do not have authority to update tracker or push to github. The `pipeline.yml` file needs to have any `tracker` sections commented out as well as the app-autoscaler private key.

## Terrgrunt
## Dockerfiles
These docker images in this repo are built and pushed with GitHub actions, they are hosted on <ghcr.io>.

This directory contains the terragrunt managed stacks of resouces in account app-runtime-interfaces-wg GCP project.
## Terragrunt
This directory contains the terragrunt managed stacks of resources in the account app-runtime-interfaces-wg GCP project. It comes with its dedicated instructions in <./terragrunt/app-autoscaler/concourse/README.md> on how to set-up concourse-related resources.

## Deploy pipeline

__Setup__

```
```shell
make set-target
make set-autoscaler-pipeline
```

## Unpause pipeline and jobs

```
# You will be prompted to select the specific jobs you want to unpause.
You will be prompted to select the specific jobs you want to unpause.
```shell
make unpause-pipeline
```

## Prometheus

This is deployed using the script [deploy-prometheus](infrastructure/scripts/deploy-prometheus.sh).
To deploy localy you will need:

- bosh ca certificate and place this it is `${HOME}/.ssh/bosh.ca.crt`.
- <https://github.com/bosh-prometheus/prometheus-boshrelease> cloned in ../
- <https://github.com/cloudfoundry/app-autoscaler-env-bbl-state> cloned in ../
This is deployed using the script [deploy-prometheus](<./infrastructure/scripts/deploy-prometheus.sh>). To deploy locally you will need:
+ bosh ca certificate and place this it is `${HOME}/.ssh/bosh.ca.crt`.
+ <https://github.com/bosh-prometheus/prometheus-boshrelease> cloned in ../
+ <https://github.com/cloudfoundry/app-autoscaler-env-bbl-state> cloned in ../

Then you can run the script directly.

### setup

- The Slack channel is stored in the cf credhub under `/bosh-autoscaler/prometheus/alertmanager_slack_channel`
- The Slack Message can be customised in the [slack-receiver-template.yml](operations/slack-receiver-template.yml)
### Setup
+ The Slack channel is stored in the cf credhub under `/bosh-autoscaler/prometheus/alertmanager_slack_channel`
+ The Slack Message can be customised in the [slack-receiver-template.yml](<./operations/slack-receiver-template.yml>)
12 changes: 6 additions & 6 deletions ci/terragrunt/app-autoscaler/concourse/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# App-autoscaler team and pipelines management for Concourse

Concourse URL: <https://concourse.app-runtime-interfaces.ci.cloudfoundry.org/>
Concourse-URL: <https://concourse.app-runtime-interfaces.ci.cloudfoundry.org>

## Dependencies

None. Terraform scripts are contained with terragrunt config.

## Requirements
Make sure that the concourse-target `app-autoscaler-release` for <https://concourse.app-runtime-interfaces.ci.cloudfoundry.org> is known to the fly-cli. You may call `concourse_login 'app-autoscaler-release'` which is defined in <../../../autoscaler/scripts/common.sh>.

Add fly target `app-autoscaler-release https://concourse.app-runtime-interfaces.ci.cloudfoundry.org`

Login to your fly target prior to executing terragrunt
Login to your fly target prior to executing terragrunt:
```shell
fly login --target='app-autoscaler-release'
```

## Usage

Expand Down
9 changes: 3 additions & 6 deletions ci/terragrunt/doc/internal_documentation.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Internal documentation

## Why Terragrunt?

Terragrunt is used for the following reasons:
+ Without terragrunt, it would be necessary to manually initialise the backends in the bucket.
+ Terragrunt is able to install and manage several related Terraform-Modules uniquely in spite of having a separated terraform state for each one. The latter has the advantage to be able to separately destroy/refactor them. Concourse in the context of this terraform-project is organised in layers (called “stacks” in Terragrunt).

* Without terragrunt, it would be necessary to manually initialise the backends in the bucket.
* Terragrunt is able to install and manage several related Terraform-Modules uniquely in spite of having a separated terraform state for each one. The latter has the advantage to be able to separately destroy/refactor them. Concourse in the context of this terraform-project is organised in layers (called “stacks” in Terragrunt).

This degree of automation enables automatic testing and continuous delivery of this concourse and its infrastructure.
This degree of automation enables automatic testing and continuous delivery of this concourse and its infrastructure.
18 changes: 13 additions & 5 deletions ci/terragrunt/flake.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
description = "Flake for ??? featuring a nix-shell";
description = "Flake for managing the terragrunt-resources, featuring a nix-shell";

inputs = {
# Choose your nix-branch from <https://github.com/NixOS/nixpkgs/branches>,
# preferably stable ones!
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
};

outputs = { self, nixpkgs }:
outputs = {self, nixpkgs}:
let
# Instead of using the subsequent list of self-defined helpers, one could use
# `flake-utils.url = "github:numtide/flake-utils";` as input which provides
Expand All @@ -22,25 +22,33 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;

config = {
allowBroken = false;
checkMeta = true;
};
});
in {
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [
fly
google-cloud-sdk
jq
kapp
kubectl
kubernetes-helm
terraform
terragrunt
vendir
ytt
];
};
});
};
}
}
14 changes: 7 additions & 7 deletions nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
doCheck = false;

meta = {
description = "A plug-in for the cf-cli for managing automated scaling of apps.";
longDescription = ''
App-AutoScaler plug-in provides the command line interface to manage
[App AutoScaler](<https://github.com/cloudfoundry/app-autoscaler-release>)
policies, retrieve metrics and scaling event history.
App-AutoScaler plug-in provides the command line interface to manage
[App AutoScaler](<https://github.com/cloudfoundry/app-autoscaler-release>)
policies, retrieve metrics and scaling event history.
'';
homepage = "https://github.com/cloudfoundry/app-autoscaler-cli-plugin";
license = [lib.licenses.asl20];
Expand Down Expand Up @@ -113,7 +114,7 @@
doCheck = false;

meta = with lib; {
description = "A cf CLI plugin for interacting with Log Cache.";
description = "A plug-in for the cf-cli to interact with Log Cache.";
homepage = "https://github.com/cloudfoundry/log-cache-cli";
license = licenses.asl20;
};
Expand All @@ -135,10 +136,9 @@
ldflags = ["-w -X main.Version=${version}"];

meta = with lib; {
description = "";
description = "A plug-in for the cf-cli to manage multitarget-apps.";
longDescription = ''
This is a Cloud Foundry CLI plugin (formerly known as CF MTA Plugin) for performing
operations on
This is a Cloud Foundry CLI plugin (formerly known as CF MTA Plugin) for performing operations on
[Multitarget Applications (MTAs)](<https://www.sap.com/documents/2021/09/66d96898-fa7d-0010-bca6-c68f7e60039b.html>)
in Cloud Foundry, such as deploying, removing, viewing, etc. It is a client for the
[CF MultiApps Controller](<https://github.com/cloudfoundry-incubator/multiapps-controller>)
Expand Down
Loading