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

sync: stage to production #1305

Merged
merged 45 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9b50f74
obscure data in fleetshard-sync status logs (#1253)
johannes94 Sep 12, 2023
ce96b7e
ROX-18427: read central DB ID override from optional ConfigMap (#1198)
vladbologa Sep 12, 2023
4a72f25
ROX-16085: Support integration env in grafana dashboard. (#1254)
porridge Sep 13, 2023
3e65804
ROX-19558: Mount gitops config to Fleet Manager (#1241)
kurlov Sep 13, 2023
8220021
ROX-11640: RHSSO dynamic clients rotation API (#1236)
ivan-degtiarenko Sep 13, 2023
91e25de
Add tools image for CI runs (#1226)
SimonBaeumer Sep 14, 2023
761b8aa
Remove unsued `image/build/local` Makefile target (#1258)
SimonBaeumer Sep 14, 2023
d46e849
ROX-18914: Add E2E tests for Canary Upgrade (#1196)
kurlov Sep 14, 2023
a409ef4
Add egress diagram to docs (#1130)
SimonBaeumer Sep 14, 2023
0cf5133
Refactor build scripts to remove duplicated code (#1262)
SimonBaeumer Sep 14, 2023
e5d198a
ROX-19013 Add gitops to fleetmanager (#1233)
ludydoo Sep 14, 2023
8686188
Fix probe image build env vars (#1267)
SimonBaeumer Sep 14, 2023
65fe0ef
Fix probe build sourcing the script - round 3 (#1268)
SimonBaeumer Sep 14, 2023
e0e3630
Rebase.
dhaus67 Sep 15, 2023
7976996
ROX-19013: Add gitops to fleetshard (#1234)
ludydoo Sep 15, 2023
9dbcc55
ROX-19480: Add GitOps provider alert (#1269)
ludydoo Sep 15, 2023
b864bcc
ROX=19699: Combine data for creating latency SLO chart (#1266)
kurlov Sep 15, 2023
1317368
ROX-19480: Fix GitOps provider alert (#1270)
ludydoo Sep 15, 2023
46cd215
fix(authz): update roles for admin auth (#1271)
dhaus67 Sep 15, 2023
cb69a91
Fix local dev env when using ACS 4.2 without OLM (#1214)
vladbologa Sep 15, 2023
1557c0b
ROX-19694: Run CI and build/push probe on stage branch. (#1260)
porridge Sep 18, 2023
de93725
ROX-19725: Push observability stage branch to stage env (#1273)
porridge Sep 18, 2023
7aeeeb0
ROX-19690: Push to stage environment from stage branch, not main (#1261)
porridge Sep 18, 2023
0498c81
ROX-19727: Sync up stage branch to main as of now (#1274)
porridge Sep 18, 2023
b315a83
Use Openshift golang-1.20 builder image (#1275)
vladbologa Sep 18, 2023
3af8ea0
Add kind cluster type (#1256)
SimonBaeumer Sep 18, 2023
b0c2b6d
Refactor operator config to use field.Error (#1276)
SimonBaeumer Sep 19, 2023
56f96c5
fix typo causing skip of DNS creation on restore (#1277)
johannes94 Sep 19, 2023
427ca8f
ROX-19718: Add flag for fleetmanager gitops (#1283)
ludydoo Sep 19, 2023
ec0f65b
Specify reconcile interval in workers (#1265)
ivan-degtiarenko Sep 19, 2023
8987720
Add request body to rotate-secrets endpoint (#1272)
ivan-degtiarenko Sep 19, 2023
48c9997
Disable automounting for egress proxy (#1286)
rukletsov Sep 20, 2023
af2d40a
ROX-19808: Remove GitOps admin handler (#1290)
ludydoo Sep 21, 2023
e650482
ROX-19692: Add a release preparation workflow. (#1284)
porridge Sep 21, 2023
1257314
ROX-19735 - add operator configs to gitops (#1278)
SimonBaeumer Sep 21, 2023
7caaafe
ROX-19692: New workflow to auto-create production merge PRs. (#1291)
porridge Sep 21, 2023
309f342
ROX-19810: Bump controller-runtime and stackrox deps (#1292)
kurlov Sep 21, 2023
205fd1c
Call /current_account before reserving quota (#1289)
ivan-degtiarenko Sep 21, 2023
e10a3d7
Remove multi target build (#1259)
SimonBaeumer Sep 22, 2023
4a7932e
fixed restore endpoint (#1298)
johannes94 Sep 22, 2023
edc992c
ROX-19281: Fix nil pointer dereference in E2E tests when Central is n…
kovayur Sep 22, 2023
154418f
Rename ACSMS -> ACSCS in dev scripts (#1252)
ivan-degtiarenko Sep 25, 2023
bf77c61
Log result of current_account call execution (#1297)
ivan-degtiarenko Sep 25, 2023
c83d4df
Cleanup errors.go (#1299)
ivan-degtiarenko Sep 25, 2023
cbd8905
Merge branch 'rc-2023-09-26.1' into stage
porridge Sep 26, 2023
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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- stage
paths-ignore:
- '*.md'
- '*.sh'
Expand Down Expand Up @@ -105,6 +106,15 @@ jobs:
export PATH=${PATH}:$GOPATH/bin
make verify binary test test/integration
timeout-minutes: 14
- name: Build and publish fleet-manager-tools image to quay.io
if: github.event_name == 'push'
env:
QUAY_USER: ${{ secrets.QUAY_RHACS_ENG_FM_RW_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_RHACS_ENG_FM_RW_PASSWORD }}
QUAY_IMAGE_REPOSITORY: rhacs-eng/fleet-manager-tools
run: |
chmod +x ./build_push_fleet_manager_tools.sh
./build_push_fleet_manager_tools.sh
- name: Build and publish fleet* image to quay.io
if: github.event_name == 'push'
env:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/create-prod-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Create PR to merge stage into production
on:
push:
branches:
- stage

jobs:
prepare-prod-pr:
runs-on: ubuntu-latest
name: Prepare production PR
steps:

- name: Open a pull request
uses: tretuna/[email protected]
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: 'stage'
TO_BRANCH: 'production'
2 changes: 1 addition & 1 deletion .github/workflows/deploy-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Stage Env
on:
push:
branches:
- main
- stage

jobs:
call-deploy-workflow:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/probe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- stage
- production

jobs:
Expand All @@ -30,9 +31,9 @@ jobs:
${{ runner.os }}-go-
- name: Build and publish probe image to quay.io
env:
QUAY_PROBE_USER: ${{ secrets.QUAY_RHACS_ENG_PROBE_RW_USERNAME }}
QUAY_PROBE_TOKEN: ${{ secrets.QUAY_RHACS_ENG_PROBE_RW_PASSWORD }}
QUAY_PROBE_IMAGE_REPOSITORY: rhacs-eng/blackbox-monitoring-probe-service
QUAY_USER: ${{ secrets.QUAY_RHACS_ENG_PROBE_RW_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_RHACS_ENG_PROBE_RW_PASSWORD }}
QUAY_IMAGE_REPOSITORY: rhacs-eng/blackbox-monitoring-probe-service
run: |
chmod +x ./build_push_probe.sh
./build_push_probe.sh
45 changes: 45 additions & 0 deletions .github/workflows/start-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Start release
on:
workflow_dispatch:
inputs:
commit:
description: 'Commit to merge into the stage branch (branch name, tag name or SHA)'
required: true
default: 'main'
type: string
release_version:
description: 'Release version in the format YYYY-MM-DD.N'
required: true
default: 'YYYY-MM-DD.1'
type: string

jobs:
prepare-stage-pr:
runs-on: ubuntu-latest
name: Prepare stage PR
steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# action-create-branch does not accept symbolic refs, so we need to parse it here.
- name: Canonicalize the commit ID
run: |
echo "commit_hash=$(git rev-parse --verify --quiet 'remotes/origin/${{ inputs.commit }}' || git rev-parse --verify --quiet '${{ inputs.commit }}')" >> "$GITHUB_ENV"
- name: Create Release Candidate branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
branch: 'rc-${{ inputs.release_version }}'
sha: '${{ env.commit_hash }}'

- name: Open a pull request
uses: tretuna/[email protected]
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: 'rc-${{ inputs.release_version }}'
TO_BRANCH: 'stage'
2 changes: 1 addition & 1 deletion .openshift-ci/e2e-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

RUN dnf update -y --disablerepo=\* --enablerepo=baseos,appstream && dnf -y install make which git gettext jq gcc && dnf clean all && rm -rf /var/cache/dnf

COPY --from=registry.ci.openshift.org/stolostron/builder:go1.20-linux /usr/local/go /usr/local/go
COPY --from=registry.ci.openshift.org/openshift/release:golang-1.20 /usr/local/go /usr/local/go
COPY --from=quay.io/openshift/origin-cli:4.13 /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/operator-sdk:v1.25 /usr/local/bin/operator-sdk /usr/local/bin

Expand Down
2 changes: 1 addition & 1 deletion .openshift-ci/image-push/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if [[ -z "$QUAY_RHACS_ENG_RW_PASSWORD" ]]; then
fi

log
log "** Entrypoint for ACS MS Image Push **"
log "** Entrypoint for ACSCS Image Push **"
log

registry_host=$(echo "$IMAGE_PUSH_REGISTRY" | cut -d / -f 1)
Expand Down
2 changes: 1 addition & 1 deletion .openshift-ci/tests/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ up.sh
log "Environment up and running"
log "Waiting for fleet-manager to complete leader election..."
# Don't have a better way yet to wait until fleet-manager has completed the leader election.
$KUBECTL -n "$ACSMS_NAMESPACE" logs -l application=fleet-manager -c fleet-manager -f --tail=-1 |
$KUBECTL -n "$ACSCS_NAMESPACE" logs -l application=fleet-manager -c fleet-manager -f --tail=-1 |
grep -q --line-buffered --max-count=1 'Running as the leader and starting' || true
sleep 1

Expand Down
14 changes: 8 additions & 6 deletions .openshift-ci/tests/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export GITROOT
source "${GITROOT}/dev/env/scripts/lib.sh"

RUN_AUTH_E2E_DEFAULT="false"
RUN_CENTRAL_E2E_DEFAULT="true"

if [[ "${OPENSHIFT_CI:-}" == "true" ]]; then
# We are running in an OpenShift CI context, configure accordingly.
Expand Down Expand Up @@ -39,9 +40,10 @@ if [[ "$SPAWN_LOGGER" == "true" && "$LOG_DIR" == "" ]]; then
fi
export LOG_DIR
export RUN_AUTH_E2E=${RUN_AUTH_E2E:-$RUN_AUTH_E2E_DEFAULT}
export RUN_CENTRAL_E2E=${RUN_CENTRAL_E2E:-$RUN_CENTRAL_E2E_DEFAULT}

log
log "** Entrypoint for ACS MS E2E Tests **"
log "** Entrypoint for ACSCS E2E Tests **"
log

log "Cluster type: ${CLUSTER_TYPE}"
Expand Down Expand Up @@ -95,7 +97,7 @@ if [[ "$SPAWN_LOGGER" == "true" ]]; then
apply "${MANIFESTS_DIR}/rhacs-operator/00-namespace.yaml"
sleep 2
log "Spawning logger, log directory is ${LOG_DIR}"
stern -n "$ACSMS_NAMESPACE" '.*' --color=never --template '[{{.ContainerName}}] {{.Message}}{{"\n"}}' >"${LOG_DIR}/namespace-${ACSMS_NAMESPACE}.txt" 2>&1 &
stern -n "$ACSCS_NAMESPACE" '.*' --color=never --template '[{{.ContainerName}}] {{.Message}}{{"\n"}}' >"${LOG_DIR}/namespace-${ACSCS_NAMESPACE}.txt" 2>&1 &
stern -n "$STACKROX_OPERATOR_NAMESPACE" '.*' --color=never --template '[{{.ContainerName}}] {{.Message}}{{"\n"}}' >"${LOG_DIR}/namespace-${STACKROX_OPERATOR_NAMESPACE}.txt" 2>&1 &
fi

Expand Down Expand Up @@ -135,10 +137,10 @@ if [[ "$DUMP_LOGS" == "true" ]]; then
log
fi

log "** BEGIN ACSMS PODS **"
$KUBECTL -n "$ACSMS_NAMESPACE" get pods || true
$KUBECTL -n "$ACSMS_NAMESPACE" describe pods || true
log "** END ACSMS PODS **"
log "** BEGIN ACSCS PODS **"
$KUBECTL -n "$ACSCS_NAMESPACE" get pods || true
$KUBECTL -n "$ACSCS_NAMESPACE" describe pods || true
log "** END ACSCS PODS **"
log

log "** BEGIN OPERATOR STATE **"
Expand Down
24 changes: 12 additions & 12 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -462,78 +462,78 @@
"filename": "templates/service-template.yml",
"hashed_secret": "13032f402fed753c2248419ea4f69f99931f6dbc",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "30025f80f6e22cdafb85db387d50f90ea884576a",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "355f24fd038bcaf85617abdcaa64af51ed19bbcf",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "3d8a1dcd2c3c765ce35c9a9552d23273cc4ddace",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "4ac7b0522761eba972467942cd5cd7499dd2c361",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "7639ab2a6bcf2ea30a055a99468c9cd844d4c22a",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "b56360daf4793d2a74991a972b34d95bc00fb2da",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "c9a73ef9ee8ce9f38437227801c70bcc6740d1a1",
"is_verified": false,
"line_number": 557
"line_number": 564
},
{
"type": "Base64 High Entropy String",
"filename": "templates/service-template.yml",
"hashed_secret": "14736999d9940728c5294277831a702f7882dece",
"is_verified": false,
"line_number": 594
"line_number": 601
},
{
"type": "Secret Keyword",
"filename": "templates/service-template.yml",
"hashed_secret": "4e199b4a1c40b497a95fcd1cd896351733849949",
"is_verified": false,
"line_number": 681,
"line_number": 688,
"is_secret": false
},
{
"type": "Secret Keyword",
"filename": "templates/service-template.yml",
"hashed_secret": "9d51dabe59aa776bef2909d3689374ebb93ab2be",
"is_verified": false,
"line_number": 725
"line_number": 732
}
],
"test/support/certs.json": [
Expand Down Expand Up @@ -564,5 +564,5 @@
}
]
},
"generated_at": "2023-09-06T14:19:26Z"
"generated_at": "2023-09-15T13:53:14Z"
}
22 changes: 3 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS build

ENV GOFLAGS="-mod=mod"
FROM registry.ci.openshift.org/openshift/release:golang-1.20 AS build

RUN mkdir /rds_ca
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /rds_ca/aws-rds-ca-global-bundle.pem

RUN mkdir /src
WORKDIR /src
RUN CGO_ENABLED=0 go install -ldflags "-s -w -extldflags '-static'" github.com/go-delve/delve/cmd/dlv@latest
COPY go.* ./
RUN go mod download
COPY . ./

FROM build as build-debug
RUN GOARGS="-gcflags 'all=-N -l'" make binary

FROM build as build-standard
RUN make binary

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8 as debug
COPY --from=build-debug /go/bin/dlv /src/fleet-manager /src/fleetshard-sync /usr/local/bin/
COPY --from=build-debug /src /src
COPY --from=build /rds_ca /usr/local/share/ca-certificates
EXPOSE 8000
WORKDIR /
ENTRYPOINT [ "/usr/local/bin/dlv" , "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "/usr/local/bin/fleet-manager", "serve"]

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8 as standard

RUN microdnf install shadow-utils
Expand All @@ -34,8 +17,9 @@ RUN useradd -u 1001 unprivilegeduser
# Switch to non-root user
USER unprivilegeduser

COPY --chown=unprivilegeduser --from=build-standard /src/fleet-manager /src/fleetshard-sync /usr/local/bin/
COPY --chown=unprivilegeduser --from=build /src/fleet-manager /src/fleetshard-sync /usr/local/bin/
COPY --chown=unprivilegeduser --from=build /rds_ca /usr/local/share/ca-certificates

EXPOSE 8000
WORKDIR /
ENTRYPOINT ["/usr/local/bin/fleet-manager", "serve"]
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile.hybrid → Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# This dockerfile is used for local builds to support architectures like arm64.
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8

RUN microdnf install shadow-utils

RUN useradd -u 1001 unprivilegeduser
# Switch to non-root user

RUN mkdir /rds_ca
ADD https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem /usr/local/share/ca-certificates/aws-rds-ca-global-bundle.pem

COPY \
fleet-manager \
fleetshard-sync \
/usr/local/bin/

RUN chown unprivilegeduser /usr/local/bin/fleet-manager
RUN chown unprivilegeduser /usr/local/bin/fleetshard-sync
RUN chown unprivilegeduser /rds_ca
RUN chown unprivilegeduser /usr/local/share/ca-certificates

USER unprivilegeduser

EXPOSE 8000

ENTRYPOINT ["/usr/local/bin/fleet-manager", "serve"]
Expand Down
33 changes: 33 additions & 0 deletions Dockerfile.tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8

ENV KUBECTL_VERSION=v1.28.1

COPY \
fleet-manager \
fleetshard-sync \
acsfleetctl \
/usr/local/bin/

RUN microdnf install tar gzip

# Install kubeval
RUN curl -LO https://github.com/instrumenta/kubeval/releases/download/v0.16.1/kubeval-linux-amd64.tar.gz
RUN curl -LO "https://github.com/instrumenta/kubeval/releases/download/v0.16.1/checksums.txt"
RUN cat checksums.txt | grep linux-amd64 | sha256sum --check
RUN tar -xf kubeval-linux-amd64.tar.gz

RUN mv kubeval /usr/bin/kubeval
RUN chmod +x /usr/bin/kubeval
RUN rm kubeval-linux-amd64.tar.gz

# Install kubeclt
RUN curl -o /usr/bin/kubectl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
RUN chmod +x /usr/bin/kubectl
RUN curl -LO "https://dl.k8s.io/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256"
RUN echo "$(cat kubectl.sha256) /usr/bin/kubectl" | sha256sum --check

LABEL name="fleet-manager-tools" \
vendor="Red Hat" \
version="0.0.1" \
summary="FleetManagerTools" \
description="RHACS fleet-manager tools used for CI pipelines"
Loading
Loading