-
Notifications
You must be signed in to change notification settings - Fork 174
perf(ci): remove container from go, go-postgres, go-bench jobs #19743
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
Open
davdhacs
wants to merge
15
commits into
master
Choose a base branch
from
davdhacs/remove-container-go-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−31
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b9c014f
fix: host-runner compatibility for tests and scripts
davdhacs 3f50506
Merge remote-tracking branch 'origin/master' into davdhacs/host-runne…
davdhacs fe90602
Merge remote-tracking branch 'origin/master' into davdhacs/host-runne…
davdhacs 58ea483
fix: use sed instead of grep -v in yq_multidoc
davdhacs f0fa0ff
perf(ci): remove container from go, go-postgres, go-bench jobs
davdhacs 794e37d
Merge remote-tracking branch 'origin/master' into davdhacs/remove-con…
davdhacs 48fa9ab
fix(ci): remove go-bench skip from container removal PR
davdhacs 4d5fb97
Merge remote-tracking branch 'origin/master' into davdhacs/remove-con…
davdhacs c6818c6
ci: simplify postgres setup in go-postgres and go-bench jobs
davdhacs c1f7fb0
fix: restore --locale=C for postgres initdb
davdhacs 74b1148
ci: temporarily force cache save to seed host-runner GOCACHE
davdhacs 0f06e68
ci: trigger warm cache run (no-op)
davdhacs 4feb78c
ci: revert forced cache save, finalize postgres comments
davdhacs 1c4e602
ci: simplify pg_isready with --timeout instead of shell loop
davdhacs 7442774
Merge branch 'master' into davdhacs/remove-container-go-tests
davdhacs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -31,16 +31,19 @@ jobs: | |||
| env: | ||||
| BUILD_TAG: 0.0.0 | ||||
| SHORTCOMMIT: "0000000" | ||||
| container: | ||||
| image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3@sha256:39fd328dcc903b7d8a2f3eb6d9e5ddbf79569227a5667296b4b927f74c11b32a # ratchet:quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3 | ||||
| volumes: | ||||
| - /usr:/mnt/usr | ||||
| - /opt:/mnt/opt | ||||
| steps: | ||||
| - name: Checkout | ||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | ||||
|
|
||||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # ratchet:actions/setup-go@v6 | ||||
| with: | ||||
| fetch-depth: 0 | ||||
| go-version-file: go.mod | ||||
| cache: false | ||||
|
|
||||
| # setup-go sets GOTOOLCHAIN=local; override so sub-module tools | ||||
| # with newer go directives can auto-download. | ||||
| - name: Override GOTOOLCHAIN | ||||
| run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV" | ||||
|
|
||||
| - uses: ./.github/actions/job-preamble | ||||
| with: | ||||
|
|
@@ -115,37 +118,38 @@ jobs: | |||
| env: | ||||
| BUILD_TAG: 0.0.0 | ||||
| SHORTCOMMIT: "0000000" | ||||
| container: | ||||
| image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3@sha256:39fd328dcc903b7d8a2f3eb6d9e5ddbf79569227a5667296b4b927f74c11b32a # ratchet:quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3 | ||||
| volumes: | ||||
| - /usr:/mnt/usr | ||||
| - /opt:/mnt/opt | ||||
| steps: | ||||
| - name: Set Postgres version | ||||
| run: | | ||||
| echo "/usr/pgsql-${{ matrix.pg }}/bin" >> "${GITHUB_PATH}" | ||||
|
|
||||
| - name: Checkout | ||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | ||||
|
|
||||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # ratchet:actions/setup-go@v6 | ||||
| with: | ||||
| fetch-depth: 0 | ||||
| go-version-file: go.mod | ||||
| cache: false | ||||
|
|
||||
| - name: Override GOTOOLCHAIN | ||||
| run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV" | ||||
|
|
||||
| - uses: ./.github/actions/job-preamble | ||||
| with: | ||||
| gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }} | ||||
|
|
||||
| # trust: allow passwordless local connections (tests don't configure a password) | ||||
| # locale=C: tests (e.g. central/splunk) assume byte-order collation for ID comparisons | ||||
| - name: Run Postgres | ||||
| run: | | ||||
| su postgres -c 'initdb -D /tmp/data' | ||||
| su postgres -c 'pg_ctl -D /tmp/data start' | ||||
| docker run --rm -d --name postgres --network=host \ | ||||
| -e POSTGRES_HOST_AUTH_METHOD=trust \ | ||||
| -e POSTGRES_INITDB_ARGS="--locale=C" \ | ||||
| docker.io/library/postgres:${{ matrix.pg }} | ||||
|
|
||||
| - name: Cache Go dependencies | ||||
| uses: ./.github/actions/cache-go-dependencies | ||||
| with: | ||||
| key-suffix: ${{ matrix.gotags }} | ||||
|
|
||||
| - name: Is Postgres ready | ||||
| run: pg_isready -h 127.0.0.1 | ||||
| run: pg_isready -h 127.0.0.1 --timeout=60 || { docker logs postgres; exit 1; } | ||||
|
|
||||
| - name: Go Unit Tests | ||||
| run: ${{ matrix.gotags }} make go-postgres-unit-tests | ||||
|
|
@@ -177,36 +181,42 @@ jobs: | |||
| directory: 'junit-reports' | ||||
|
|
||||
| go-bench: | ||||
| strategy: | ||||
| matrix: | ||||
| pg: [ '15' ] | ||||
| runs-on: ubuntu-latest | ||||
| container: | ||||
| image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3@sha256:39fd328dcc903b7d8a2f3eb6d9e5ddbf79569227a5667296b4b927f74c11b32a # ratchet:quay.io/stackrox-io/apollo-ci:stackrox-test-0.5.3 | ||||
| volumes: | ||||
| - /usr:/mnt/usr | ||||
| - /opt:/mnt/opt | ||||
| steps: | ||||
| - name: Set Postgres version | ||||
| run: | | ||||
| echo "/usr/pgsql-15/bin" >> "${GITHUB_PATH}" | ||||
|
|
||||
| - name: Checkout | ||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6 | ||||
| with: | ||||
| fetch-depth: 0 | ||||
|
|
||||
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # ratchet:actions/setup-go@v6 | ||||
| with: | ||||
| go-version-file: go.mod | ||||
| cache: false | ||||
|
|
||||
| - name: Override GOTOOLCHAIN | ||||
| run: echo "GOTOOLCHAIN=auto" >> "$GITHUB_ENV" | ||||
|
|
||||
| - uses: ./.github/actions/job-preamble | ||||
| with: | ||||
| gcp-account: ${{ secrets.GCP_SERVICE_ACCOUNT_STACKROX_CI }} | ||||
|
|
||||
| # trust: allow passwordless local connections (tests don't configure a password) | ||||
| # locale=C: tests (e.g. central/splunk) assume byte-order collation for ID comparisons | ||||
| - name: Run Postgres | ||||
| run: | | ||||
| su postgres -c 'initdb -D /tmp/data' | ||||
| su postgres -c 'pg_ctl -D /tmp/data start' | ||||
| docker run --rm -d --name postgres --network=host \ | ||||
| -e POSTGRES_HOST_AUTH_METHOD=trust \ | ||||
| -e POSTGRES_INITDB_ARGS="--locale=C" \ | ||||
| docker.io/library/postgres:${{ matrix.pg }} | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use our own image? Or maybe the db we are using in upstream? stackrox/image/postgres/Dockerfile Line 2 in 2948960
The problem with docker.io is that we need to login first to prevent rate-limits. Al |
||||
|
|
||||
| - name: Cache Go dependencies | ||||
| uses: ./.github/actions/cache-go-dependencies | ||||
|
|
||||
| - name: Is Postgres ready | ||||
| run: pg_isready -h 127.0.0.1 | ||||
| run: pg_isready -h 127.0.0.1 --timeout=60 || { docker logs postgres; exit 1; } | ||||
|
|
||||
| - name: Go Bench Tests | ||||
| run: make go-postgres-bench-tests | ||||
|
|
||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add matrix here then we need to change required jobs. Let's skip it for now and hardcode 15 as any failures should be caught in unit tests, here we only validate if bench tests are runable.