Skip to content

Commit

Permalink
add not supported lang versions
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomonteromiguel committed May 20, 2024
1 parent 80e2feb commit 6aee53e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/run-lib-injection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.compute-matrix.outputs.matrix }}
matrix_not_supported: ${{ steps.compute-matrix.outputs.matrix_not_supported }}
init_image: ${{ steps.compute-matrix.outputs.init_image }}
steps:
- name: Compute matrix
Expand All @@ -41,6 +42,17 @@ jobs:
"python": ["dd-lib-python-init-test-django", "dd-lib-python-init-test-django-gunicorn", "dd-lib-python-init-test-django-uvicorn"],
"ruby": ["dd-lib-ruby-init-test-rails", "dd-lib-ruby-init-test-rails-explicit", "dd-lib-ruby-init-test-rails-gemsrb"]
}
#Lang version not supported for these weblogs
not_supported_weblogs={
"cpp": [],
"dotnet": [],
"golang": [],
"java": ["jdk7-app"],
"nodejs": [],
"php": [],
"python": [],
"ruby": []
}
init_images={
"cpp": [],
"dotnet": ["gcr.io/datadoghq/dd-lib-dotnet-init:latest","ghcr.io/datadog/dd-trace-dotnet/dd-lib-dotnet-init:latest_snapshot"],
Expand All @@ -52,14 +64,17 @@ jobs:
"ruby": ["gcr.io/datadoghq/dd-lib-ruby-init:latest","ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:latest_snapshot"],
}
result = weblogs["${{ inputs.library }}"]
result_not_supported = not_supported_weblogs["${{ inputs.library }}"]
result_init_image = 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_not_supported={json.dumps(result_not_supported)}', file=fh)
print(json.dumps(result, indent=2))
print(json.dumps(result_init_image, indent=2))
print(json.dumps(result_not_supported, indent=2))
lib-injection-init-image-validator:
if: inputs.library == 'dotnet' || inputs.library == 'java' || inputs.library == 'python' || inputs.library == 'ruby' || inputs.library == 'nodejs'
Expand All @@ -72,8 +87,12 @@ jobs:
- compute-matrix
strategy:
matrix:
weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix) }}
lib_init_image: ${{ fromJson(needs.compute-matrix.outputs.init_image) }}
- weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix) }}
lib_init_image: ${{ fromJson(needs.compute-matrix.outputs.init_image) }}
lang_suported: "true"
- weblog: ${{ fromJson(needs.compute-matrix.outputs.matrix_not_supported) }}
lib_init_image: ${{ fromJson(needs.compute-matrix.outputs.init_image) }}
lang_suported: "false"
fail-fast: false
env:
TEST_LIBRARY: ${{ inputs.library }}
Expand All @@ -99,15 +118,23 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build weblog init image validator
if: matrix.lang_suported == 'true'
run: lib-injection/build/build_lib_injection_weblog.sh -w ${{ matrix.weblog }} -l ${{ inputs.library }}

- name: Install runner
uses: ./.github/actions/install_runner

- name: Perform lib injection
if: matrix.lang_suported == 'true'
run: |
echo "Testing lib injection init image: $LIB_INIT_IMAGE"
./run.sh LIB_INJECTION_VALIDATION
./run.sh LIB_INJECTION_VALIDATION
- name: Perform lib injection for not supported lang
if: matrix.lang_suported == 'false'
run: |
echo "Testing lib injection init image: $LIB_INIT_IMAGE"
echo "Weblog: ${{ matrix.weblog }}"
- name: Compress logs
id: compress_logs
Expand Down
2 changes: 1 addition & 1 deletion utils/_context/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def _lib_init_image(self, lib_init_image):
}
if "dd-lib-dotnet-init" in lib_init_image:
self.kwargs["volumes"] = {
_VOLUME_INJECTOR_NAME: {"bind": " /datadog-init/monitoring-home/", "mode": "rw"},
_VOLUME_INJECTOR_NAME: {"bind": "/datadog-init/monitoring-home", "mode": "rw"},
}

def remove(self):
Expand Down

0 comments on commit 6aee53e

Please # to comment.