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

Jv rox 21500 long running clusters should be able to run any commit #42

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 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
48 changes: 33 additions & 15 deletions .github/workflows/create-demo-clusters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@ jobs:
outputs:
slack-channel: ${{ fromJSON(format('["{0}","{1}"]', steps.fetch.outputs.dry-slack-channel, steps.fetch.outputs.slack-channel))[inputs.dry-run != true] }}
jira-projects: ${{ steps.fetch.outputs.jira-projects }}
cluster-with-fake-load-truncated-name: ${{ steps.truncate_cluster_names.outputs.cluster-with-fake-load-truncated-name }}
cluster-with-real-load-truncated-name: ${{ steps.truncate_cluster_names.outputs.cluster-with-real-load-truncated-name }}
steps:
- name: Read workflow properties file
id: fetch
env:
PROPERTIES_URL: /repos/${{ github.repository }}/contents/.github/properties?ref=${{ github.ref_name }}
run: gh api -H "$ACCEPT_RAW" "$PROPERTIES_URL" >> "$GITHUB_OUTPUT"
- name: Truncate cluster names
id: truncate_cluster_names
run: |
truncated_fake_cluster_name="$(echo "${{ inputs.cluster-with-fake-load-name }}" | cut -c 1-28)"
truncated_real_cluster_name="$(echo "${{ inputs.cluster-with-real-load-name }}" | cut -c 1-28)"
echo "cluster-with-fake-load-truncated-name=$truncated_fake_cluster_name" >> "$GITHUB_OUTPUT"
echo "cluster-with-real-load-truncated-name=$truncated_real_cluster_name" >> "$GITHUB_OUTPUT"

wait-for-images:
name: Wait for images on Quay.io
Expand Down Expand Up @@ -213,7 +222,7 @@ jobs:

create-long-running-cluster-for-fake-load:
name: Create GKE long-running cluster for fake load
needs: [wait-for-images]
needs: [properties, wait-for-images]
if: >-
inputs.dry-run != true &&
inputs.create-long-cluster == true
Expand All @@ -229,15 +238,15 @@ jobs:
with:
token: ${{ secrets.INFRA_TOKEN }}
flavor: gke-default
name: ${{ inputs.cluster-with-fake-load-name }}
name: ${{ needs.properties.outputs.cluster-with-fake-load-truncated-name }}
lifespan: 168h
args: nodes=5,machine-type=e2-standard-8
wait: true

# TODO ROX-19190 Don't DRY. Make this and the above into a separate action.
create-long-running-cluster-for-real-load:
name: Create GKE long-running cluster for real load
needs: [wait-for-images]
needs: [properties, wait-for-images]
if: >-
inputs.dry-run != true &&
inputs.create-long-cluster == true
Expand All @@ -253,7 +262,7 @@ jobs:
with:
token: ${{ secrets.INFRA_TOKEN }}
flavor: gke-default
name: ${{ inputs.cluster-with-real-load-name }}
name: ${{ needs.properties.outputs.cluster-with-real-load-truncated-name }}
lifespan: 168h
args: nodes=5,machine-type=e2-standard-8
wait: true
Expand All @@ -266,7 +275,7 @@ jobs:
rox-password: ${{ steps.launch-central.outputs.rox-password }}
central-ip: ${{ steps.launch-central.outputs.central-ip }}
env:
NAME: ${{ inputs.cluster-with-fake-load-name }}
NAME: ${{ needs.properties.outputs.cluster-with-real-load-truncated-name }}
KUBECONFIG: artifacts/kubeconfig
INFRA_TOKEN: ${{secrets.INFRA_TOKEN}}
USE_GKE_GCLOUD_AUTH_PLUGIN: "True"
Expand All @@ -279,10 +288,17 @@ jobs:
exit 1
fi
- name: Check out stackrox code
uses: actions/checkout@v4
with:
ref: ${{inputs.version}}
repository: stackrox/stackrox
run: |
git clone https://github.com/stackrox/stackrox.git
cd stackrox
git checkout ${{inputs.version}}
cd ..
pwd
#uses: actions/checkout@v4
#with:
# ref: ${{inputs.version}}
# repository: stackrox/stackrox
# fetch-depth: 0
- name: Checkout local action
uses: actions/checkout@v4
with:
Expand All @@ -309,7 +325,7 @@ jobs:
pagerduty-integration-key: ${{ secrets.RELEASE_MANAGEMENT_PAGERDUTY_INTEGRATION_KEY }}
registry-username: ${{ secrets.QUAY_RHACS_ENG_RO_USERNAME }}
registry-password: ${{ secrets.QUAY_RHACS_ENG_RO_PASSWORD }}
stackrox-dir: ${{ github.workspace }}
stackrox-dir: ${{ github.workspace }}/stackrox
name: ${{ env.NAME }}

- name: Post to Slack
Expand All @@ -320,14 +336,14 @@ jobs:
channel-id: ${{ needs.properties.outputs.slack-channel }}
payload: >-
{
"text": "Long-running cluster created. Setup your local access with `scripts/release-tools/setup-central-access.sh | bash -s -- ${{ inputs.cluster-with-fake-load-name }}`",
"text": "Long-running cluster created. Setup your local access with `scripts/release-tools/setup-central-access.sh | bash -s -- ${{ needs.properties.outputs.cluster-with-fake-load-truncated-name }}`",

"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":tada: *Long-running cluster `${{ inputs.cluster-with-fake-load-name }}` created for ${{ inputs.version }} milestone of <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>.*"
"text": ":tada: *Long-running cluster `${{ needs.properties.outputs.cluster-with-fake-load-truncated-name }}` created for ${{ inputs.version }} milestone of <${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>.*"
}
},
{
Expand All @@ -337,7 +353,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":arrow_right: Setup your local access to Central by running:\n```./scripts/release-tools/setup-central-access.sh ${{ inputs.cluster-with-fake-load-name }}```\nfrom your local machine."
"text": ":arrow_right: Setup your local access to Central by running:\n```./scripts/release-tools/setup-central-access.sh ${{ needs.properties.outputs.cluster-with-fake-load-truncated-name }}```\nfrom your local machine."
}
}
]
Expand All @@ -358,7 +374,7 @@ jobs:
needs: [properties, start-acs, create-long-running-cluster-for-real-load]
runs-on: ubuntu-latest
env:
SECURED_CLUSTER_NAME: ${{ inputs.cluster-with-real-load-name }}
SECURED_CLUSTER_NAME: ${{ needs.properties.outputs.cluster-with-real-load-truncated-name }}
KUBECONFIG: artifacts/kubeconfig
INFRA_TOKEN: ${{secrets.INFRA_TOKEN}}
USE_GKE_GCLOUD_AUTH_PLUGIN: "True"
Expand All @@ -375,6 +391,7 @@ jobs:
with:
ref: ${{inputs.version}}
repository: stackrox/stackrox
fetch-depth: 0
- uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_RELEASE_AUTOMATION_SA }}"
Expand Down Expand Up @@ -417,7 +434,7 @@ jobs:
needs: [properties, start-secured-cluster]
runs-on: ubuntu-latest
env:
SECURED_CLUSTER_NAME: ${{ inputs.cluster-with-real-load-name }}
SECURED_CLUSTER_NAME: ${{ needs.properties.outputs.cluster-with-real-load-truncated-name }}
KUBECONFIG: ${{ github.workspace }}/artifacts/kubeconfig
INFRA_TOKEN: ${{secrets.INFRA_TOKEN}}
USE_GKE_GCLOUD_AUTH_PLUGIN: "True"
Expand All @@ -429,6 +446,7 @@ jobs:
repository: stackrox/${{ inputs.kube-burner-config-repo }}
path: .kube-burner-config
ref: ${{ inputs.kube-burner-config-ref }}
fetch-depth: 0
- name: Check out cloud-bulldozer/benchmark-operator code
run: |
git clone https://github.com/cloud-bulldozer/benchmark-operator.git
Expand Down
12 changes: 11 additions & 1 deletion release/start-acs/start-acs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@
# export GITHUB_OUTPUT=delete-log-github-output.txt
# export GITHUB_STEP_SUMMARY=delete-log-start-acs.txt

set -euo pipefail
set -euox pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

pushd "$STACKROX_DIR"

working_directory="$(pwd)"
gh_log notice "working_directory= $working_directory"

ls
for file in `ls`; do

Check failure on line 35 in release/start-acs/start-acs.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] release/start-acs/start-acs.sh#L35 <ShellCheck.SC2045>

Iterating over ls output is fragile. Use globs.
Raw output
./release/start-acs/start-acs.sh:35:13: error: Iterating over ls output is fragile. Use globs. (ShellCheck.SC2045)

Check notice on line 35 in release/start-acs/start-acs.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] release/start-acs/start-acs.sh#L35 <ShellCheck.SC2006>

Use $(...) notation instead of legacy backticks `...`.
Raw output
./release/start-acs/start-acs.sh:35:13: info: Use $(...) notation instead of legacy backticks `...`. (ShellCheck.SC2006)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shellcheck (suggestion)] reported by reviewdog 🐶

Suggested change
for file in `ls`; do
for file in $(ls); do

gh_log notice "$file"
done

# shellcheck source=/dev/null
source "${STACKROX_DIR}"/deploy/common/deploy.sh

Expand Down