Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable mta acceptance test in github action #3155

Merged
merged 18 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d65d20a
WIP
bonzofenix Aug 30, 2024
64709d8
Merge branch 'main' into mta-acceptance-tests
bonzofenix Aug 30, 2024
9030217
set different route group name for postgres to avoid colision with ot…
bonzofenix Sep 2, 2024
084d12d
Add deployment_name tag to autoscaler_postgres in use-cf-services.yml
bonzofenix Sep 2, 2024
8424a71
Use different orgs for different mtar deployments
bonzofenix Sep 2, 2024
dee5032
Merge branch 'main' into mta-acceptance-tests
bonzofenix Sep 2, 2024
431e7c1
Invert conditions for space and org cleanup in autoscaler script
bonzofenix Sep 2, 2024
04d8332
Change registration interval
bonzofenix Sep 3, 2024
a87dfb9
Merge branch 'main' into mta-acceptance-tests
bonzofenix Sep 3, 2024
ce7d955
Merge branch 'main' into mta-acceptance-tests
bonzofenix Sep 3, 2024
f5d6139
Update ginkgo from 2.20.0 to 2.20.1 in devbox.json and devbox.lock
bonzofenix Sep 3, 2024
b4a1816
Add genproto dependency and update go.mod with replace directive for …
bonzofenix Sep 3, 2024
d127490
Introduce retry mechanism for SyslogEmitter with exponential backoff
bonzofenix Sep 3, 2024
b05a1dc
🤖🦾🛠️ go mod tidy & make package-specs
bonzofenix Sep 3, 2024
b0ca373
Add context to syslog emitter in metrics forwarder
bonzofenix Sep 4, 2024
df7908a
Remove unsued recurity group rule - now using router tcp
bonzofenix Sep 4, 2024
518f366
Remove 'gomoddirectives' linter from golangci configuration
bonzofenix Sep 4, 2024
ea2b062
Merge branch 'main' into mta-acceptance-tests
bonzofenix Sep 4, 2024
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
28 changes: 28 additions & 0 deletions .github/workflows/acceptance_tests_mta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Acceptance Tests - MTA
on:
pull_request:
types: [ opened, labeled, synchronize ]

concurrency:
group: "${{ github.workflow }}/${{ github.ref }}"
cancel-in-progress: true

jobs:
acceptance_tests_reusable:
name: " " # Whitespace name looks nicest on Github UI
uses: ./.github/workflows/acceptance_tests_reusable.yaml
with:
deployment_name: "autoscaler-mta-${{ github.event.pull_request.number }}"
deploy_apps: true
ops_files: |
operations/add-releases.yml
operations/instance-identity-cert-from-cf.yml
operations/add-postgres-variables.yml
operations/enable-nats-tls.yml
operations/add-extra-plan.yml
operations/set-release-version.yml
operations/enable-metricsforwarder-via-syslog-agent.yml
operations/enable-scheduler-logging.yml
operations/use-cf-services.yml
secrets:
bbl_ssh_key: "${{ secrets.BBL_SSH_KEY }}"
37 changes: 37 additions & 0 deletions .github/workflows/acceptance_tests_mta_close.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Acceptance Tests Cleanup (MTA)
on:
pull_request:
types: [closed]
env:
PR_NUMBER: "${{ github.event.pull_request.number }}"
DEPLOYMENT_NAME: "autoscaler-mta-${{ github.event.pull_request.number }}"

jobs:
deployment_cleanup:
name: Cleanup deployments
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main
steps:
- uses: actions/checkout@v4
with:
path: app-autoscaler-release
ref: main

- uses: ./app-autoscaler-release/.github/actions/setup-environment
with:
ssh-key: ${{ secrets.BBL_SSH_KEY }}

- name: "clean up"
shell: bash
run: |
#! /usr/bin/env bash
set -eu -o pipefail

# The subsequent assignments are needed *HERE* because of:
# <https://github.com/actions/runner/issues/2058> or
# <https://github.com/actions/checkout/issues/785>
export BBL_STATE_PATH="${GITHUB_WORKSPACE}/bbl/bbl-state"
declare -r AUTOSCALER_DIR="${GITHUB_WORKSPACE}/app-autoscaler-release"

make --directory="${AUTOSCALER_DIR}" deploy-cleanup
15 changes: 15 additions & 0 deletions .github/workflows/acceptance_tests_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
deployment_name:
required: true
type: string
deploy_apps:
required: false
type: boolean
ops_files:
required: false
type: string
secrets:
bbl_ssh_key:
required: true
Expand Down Expand Up @@ -79,8 +85,17 @@ jobs:
ssh-key: ${{ secrets.bbl_ssh_key}}
- name: Deploy autoscaler
shell: bash
env:
OPS_FILES: ${{ inputs.ops_files }}
run: make --directory="${AUTOSCALER_DIR}" deploy-autoscaler

- name: Deploy Apps
shell: bash
run: make --directory="${AUTOSCALER_DIR}" deploy-apps
if: ${{ inputs.deploy_apps }}



acceptance_tests:
needs: [ deploy_autoscaler ]
strategy:
Expand Down
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ linters:
- goprintffuncname
- gosec
- gosimple
- gomoddirectives
- gomodguard
- ineffassign
- misspell
Expand Down
6 changes: 5 additions & 1 deletion ci/autoscaler/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ function cleanup_apps(){
echo "No app to undeploy"
fi

if ! cf spaces | grep --quiet --regexp="^${AUTOSCALER_SPACE}$"; then
if cf spaces | grep --quiet --regexp="^${AUTOSCALER_SPACE}$"; then
cf delete-space -f "${AUTOSCALER_SPACE}"
fi

if cf orgs | grep --quiet --regexp="^${AUTOSCALER_ORG}$"; then
cf delete-org -f "${AUTOSCALER_ORG}"
fi
}


Expand Down
3 changes: 1 addition & 2 deletions ci/autoscaler/scripts/vars.source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ debug "DEPLOYMENT_NAME: ${DEPLOYMENT_NAME}"
log "set up vars: DEPLOYMENT_NAME=${DEPLOYMENT_NAME}"
deployment_name="${DEPLOYMENT_NAME}"

export AUTOSCALER_ORG="${AUTOSCALER_ORG:-"autoscaler-${PR_NUMBER}"}"
[ "${AUTOSCALER_ORG}" = "autoscaler-" ] && AUTOSCALER_ORG="${user}"
export AUTOSCALER_ORG="${AUTOSCALER_ORG:-$DEPLOYMENT_NAME}"
debug "AUTOSCALER_ORG: ${AUTOSCALER_ORG}"
log "set up vars: AUTOSCALER_ORG=${AUTOSCALER_ORG}"
autoscaler_org="${AUTOSCALER_ORG}"
Expand Down
1 change: 1 addition & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,7 @@
},
"ruby@latest": {
"last_modified": "2024-08-31T10:12:23Z",
"plugin_version": "0.0.2",
"resolved": "github:NixOS/nixpkgs/5629520edecb69630a3f4d17d3d33fc96c13f6fe#ruby",
"source": "devbox-search",
"version": "3.3.4",
Expand Down
5 changes: 3 additions & 2 deletions operations/use-cf-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
api_url: "https://api.((system_domain)):443"
oauth_url: "https://uaa.((system_domain)):443"
routes:
- name: autoscaler_postgres
registration_interval: 20s
- name: ((deployment_name))_postgres
registration_interval: 10s
port: 5432
external_port: ((postgres_external_port))
type: tcp
router_group: default-tcp
tags:
component: autoscaler_postgres
deployment: ((deployment_name))
uris:
- ((deployment_name))-postgres.tcp.((system_domain))

Expand Down
2 changes: 2 additions & 0 deletions packages/eventgenerator/spec
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ files:
- autoscaler/vendor/golang.org/x/text/unicode/bidi/* # gosub
- autoscaler/vendor/golang.org/x/text/unicode/norm/* # gosub
- autoscaler/vendor/golang.org/x/text/width/* # gosub
- autoscaler/vendor/google.golang.org/genproto/googleapis/api/* # gosub
- autoscaler/vendor/google.golang.org/genproto/googleapis/api/annotations/* # gosub
- autoscaler/vendor/google.golang.org/genproto/googleapis/api/httpbody/* # gosub
- autoscaler/vendor/google.golang.org/genproto/googleapis/rpc/status/* # gosub
Expand Down Expand Up @@ -246,6 +247,7 @@ files:
- autoscaler/vendor/google.golang.org/protobuf/reflect/protoregistry/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/runtime/protoiface/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/runtime/protoimpl/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/types/descriptorpb/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/types/known/anypb/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/types/known/durationpb/* # gosub
- autoscaler/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/* # gosub
Expand Down
2 changes: 2 additions & 0 deletions src/autoscaler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ require (
gopkg.in/yaml.v3 v3.0.1
)

replace google.golang.org/genproto => google.golang.org/genproto v0.0.0-20240827150818-7e3bb234dfed

require (
code.cloudfoundry.org/go-diodes v0.0.0-20240813203737-5032edb05ceb // indirect
code.cloudfoundry.org/go-metric-registry v0.0.0-20240828184116-9710cd731bb8 // indirect
Expand Down
Loading
Loading