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

Fix names in CI k8 #3677

Closed
wants to merge 1 commit into from
Closed
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# ### appsec-event-rules is now a private repo. The GH_TOKEN provided can't read private repos.
# ### skipping this, waiting for a proper solution
# - name: Load WAF rules
# if: matrix.version == 'dev'
# if: matrix.ci_environment == 'dev'
# run: ./utils/scripts/load-binary.sh waf_rule_set
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -96,7 +96,7 @@ jobs:
strategy:
matrix:
library: ${{ fromJson(needs.impacted_libraries.outputs.impacted_libraries) }}
version:
ci_environment:
- prod
- dev
fail-fast: false
Expand All @@ -109,13 +109,13 @@ jobs:
library: ${{ matrix.library }}
scenarios: ${{ needs.scenarios.outputs.scenarios }}
scenarios_groups: ${{ needs.scenarios.outputs.scenarios_groups }}
binaries_artifact: ${{ matrix.version == 'dev' && format('binaries_dev_{0}', matrix.library) || '' }}
ci_environment: ${{ matrix.version }}
binaries_artifact: ${{ matrix.ci_environment == 'dev' && format('binaries_dev_{0}', matrix.library) || '' }}
ci_environment: ${{ matrix.ci_environment }}
build_python_base_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-python-base-images') }}
build_buddies_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-buddies-images') }}
build_proxy_image: ${{ contains(github.event.pull_request.labels.*.name, 'build-proxy-image') }}
build_lib_injection_app_images: ${{ contains(github.event.pull_request.labels.*.name, 'build-lib-injection-app-images') }}
_experimental_parametric_job_count: ${{ matrix.version == 'dev' && 2 || 1 }} # test both use cases
_experimental_parametric_job_count: ${{ matrix.ci_environment == 'dev' && 2 || 1 }} # test both use cases

system_tests_docker_mode:
name: Ruby Docker Mode
Expand Down
30 changes: 14 additions & 16 deletions .github/workflows/run-lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
description: "Library to test"
required: true
type: string
version:
description: "Version of the image to test"
ci_environment:
description: "Either prod or dev"
required: true
type: string
env:
Expand All @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.compute-matrix.outputs.matrix }}
matrix_supported_langs: ${{ steps.compute-matrix.outputs.matrix_supported_langs }}
matrix_supported_weblogs: ${{ steps.compute-matrix.outputs.matrix_supported_weblogs }}
matrix_profiling_supported: ${{ steps.compute-matrix.outputs.matrix_profiling_supported }}
matrix_skip_basic: ${{ steps.compute-matrix.outputs.matrix_skip_basic }}
init_image: ${{ steps.compute-matrix.outputs.init_image }}
Expand Down Expand Up @@ -81,33 +81,33 @@ jobs:
#All weblog variants
result = weblogs["${{ inputs.library }}"]
#Only supported weblog variants
results_supported_langs = []
results_supported_weblogs = []
results_profiling_supported = []
results_skip_basic = []
for weblog in weblogs["${{ inputs.library }}"]:
if weblog["supported"] == "true":
results_supported_langs.append(weblog["name"])
results_supported_weblogs.append(weblog["name"])
if "skip-profiling" not in weblog or weblog["skip-profiling"] != "true":
results_profiling_supported.append(weblog["name"])
if "skip-basic" in weblog and weblog["skip-basic"] == "true":
results_skip_basic.append(weblog["name"])

#Use the latest init image for prod version, latest_snapshot init image for dev version
if "${{ inputs.version }}" == 'prod':
if "${{ inputs.ci_environment }}" == 'prod':
result_init_image = prod_init_images["${{ inputs.library }}"]
else:
result_init_image = dev_init_images["${{ inputs.library }}"]

with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'matrix={json.dumps(result)}', file=fh)
print(f'init_image={json.dumps(result_init_image)}', file=fh)
print(f'matrix_supported_langs={json.dumps(results_supported_langs)}', file=fh)
print(f'init_image={result_init_image}', file=fh)
print(f'matrix_supported_weblogs={json.dumps(results_supported_weblogs)}', file=fh)
print(f'matrix_profiling_supported={json.dumps(results_profiling_supported)}', file=fh)
print(f'matrix_skip_basic={json.dumps(results_skip_basic)}', file=fh)

print(json.dumps(result, indent=2))
print(json.dumps(result_init_image, indent=2))
print(json.dumps(results_supported_langs, indent=2))
print(json.dumps(results_supported_weblogs, indent=2))
print(json.dumps(results_profiling_supported, indent=2))
print(json.dumps(results_skip_basic, indent=2))

Expand All @@ -123,13 +123,12 @@ jobs:
strategy:
matrix:
weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix) }}
lib_init_image: ${{ fromJson(needs.compute-matrix.outputs.init_image) }}
exclude:
- weblog: {"name":"dd-djm-spark-test-app", "supported":"true", "skip-profiling":"true", "skip-basic":"true"}
fail-fast: false
env:
TEST_LIBRARY: ${{ inputs.library }}
LIB_INIT_IMAGE: ${{ matrix.lib_init_image }}
LIB_INIT_IMAGE: ${{ needs.compute-matrix.outputs.init_image }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -177,7 +176,7 @@ jobs:
if: always() && steps.compress_logs.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: logs_lib-injection_validation_${{ inputs.library}}_${{matrix.weblog.name}}_${{ endsWith(matrix.lib_init_image, 'latest_snapshot') == true && 'latest_snapshot' || 'latest'}}
name: logs_lib-injection_validation_${{ inputs.library}}_${{matrix.weblog.name}}_${{ endsWith(needs.compute-matrix.outputs.init_image, 'latest_snapshot') == true && 'latest_snapshot' || 'latest'}}
path: artifact.tar.gz

k8s-lib-injection-tests:
Expand All @@ -191,14 +190,13 @@ jobs:
- compute-matrix
strategy:
matrix:
weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix_supported_langs) }}
lib_init_image: ${{ fromJson(needs.compute-matrix.outputs.init_image) }}
weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix_supported_weblogs) }}
cluster_agent_version: ['7.56.2', '7.57.0', '7.59.0']
fail-fast: false
env:
TEST_LIBRARY: ${{ inputs.library }}
WEBLOG_VARIANT: ${{ matrix.weblog }}
LIB_INIT_IMAGE: ${{ matrix.lib_init_image }}
LIB_INIT_IMAGE: ${{ needs.compute-matrix.outputs.init_image }}
SYSTEM_TESTS_REPORT_ENVIRONMENT: dev
SYSTEM_TESTS_REPORT_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
LIBRARY_INJECTION_TEST_APP_IMAGE: ghcr.io/datadog/system-tests/${{ matrix.weblog }}:${{ inputs.build_lib_injection_app_images != true && 'latest' || github.sha }}
Expand Down Expand Up @@ -263,5 +261,5 @@ jobs:
if: always() && steps.compress_logs.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: logs_k8s-lib-injection_${{ inputs.library}}_${{matrix.weblog}}_${{matrix.cluster_agent_version}}_${{ endsWith(matrix.lib_init_image, 'latest_snapshot') == true && 'dev' || 'prod'}}
name: logs_k8s-lib-injection_${{ inputs.library}}_${{matrix.weblog}}_${{matrix.cluster_agent_version}}_${{ endsWith(needs.compute-matrix.outputs.init_image, 'latest_snapshot') == true && 'dev' || 'prod'}}
path: artifact.tar.gz
2 changes: 1 addition & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
with:
build_lib_injection_app_images: ${{ inputs.build_lib_injection_app_images }}
library: ${{ inputs.library }}
version: ${{ inputs.binaries_artifact == '' && 'prod' || 'dev' }}
ci_environment: ${{ inputs.ci_environment }}

end-to-end:
needs:
Expand Down
Loading