-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #702 Closes #703 - Adds gdb pretty printing support, - Moves `.conda ` and `.config` folders to parent directory to share with `mrc` development. - Uses @trxcllnt 's new devcontainer base container which adds features such as mamba, automatic conda env mounting, etc. - introduces script to install `pytest-kafka` - Supports running GraphViz and SID visualizations from inside devcontainer accessable to host. Authors: - Christopher Harris (https://github.com/cwharris) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: #717
- Loading branch information
Showing
14 changed files
with
192 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
# Replicates the install instructions from the CI runner image | ||
sudo apt update | ||
|
||
# Install openjdk | ||
sudo apt install -y openjdk-11-jdk | ||
|
||
# Clone the repo into home and run setup.py develop | ||
|
||
if [[ ! -d ~/pytest-kafka ]]; then | ||
git clone https://gitlab.com/karolinepauls/pytest-kafka.git ~/pytest-kafka | ||
fi; | ||
|
||
cd ~/pytest-kafka | ||
|
||
python setup.py develop |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Ensure our ~/.config directory has the correct permissions. If ~/.config did | ||
# not exist, and you mount ~/.config/gh from the host, then ~/.config will be | ||
# created with root permissions which can break things | ||
|
||
if [[ ! -f ~/.config/.gdbinit ]]; then | ||
cp /opt/morpheus/etc/.gdbinit ~/.config/.gdbinit | ||
fi |
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add-auto-load-safe-path /opt/conda | ||
|
||
source /opt/morpheus/etc/enable_conda_libstd_pretty_print.py |
55 changes: 55 additions & 0 deletions
55
.devcontainer/opt/morpheus/etc/enable_conda_libstd_pretty_print.py
This file contains 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# -*- python -*- | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
import gdb | ||
|
||
conda_env_path = os.environ.get("CONDA_PREFIX", None) | ||
|
||
if (conda_env_path is not None): | ||
|
||
gcc_path = os.environ.get("GCC", None) | ||
|
||
if (gcc_path is None): | ||
print( | ||
"Could not find gcc from $GCC: '{}'. Ensure gxx_linux-64, gcc_linux-64, sysroot_linux-64, and gdb have been installed into the current conda environment" | ||
.format(gcc_path)) | ||
else: | ||
# Get the GCC version | ||
result = subprocess.run([gcc_path, '-dumpversion'], stdout=subprocess.PIPE) | ||
gcc_version = result.stdout.decode("utf-8").strip() | ||
|
||
# Build the gcc python path | ||
gcc_python_path = os.path.join(conda_env_path, "share", "gcc-{}".format(gcc_version), "python") | ||
|
||
if (os.path.exists(gcc_python_path)): | ||
|
||
# Add to the path for the pretty printer | ||
sys.path.insert(0, gcc_python_path) | ||
|
||
# Now register the pretty printers | ||
from libstdcxx.v6 import register_libstdcxx_printers | ||
register_libstdcxx_printers(gdb.current_objfile()) | ||
|
||
print("Loaded stdlibc++ pretty printers") | ||
else: | ||
print("Could not find gcc python files at: {}".format(gcc_python_path)) | ||
print( | ||
"Ensure gxx_linux-64, gcc_linux-64, sysroot_linux-64, and gdb have been installed into the current conda environment" | ||
) |