Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/instructlab.cpython-312.pyc |
�
-�_g� � �8 � d dl Z d dlmZmZmZ G d� dee� Zy)� N)�Plugin�IndependentPlugin� PluginOptc �n � e Zd ZdZd ZdZdZdZdZ e dde
d� � e d
de
d� � e d
dd�� gZd� Zy)�InstructlabaL
This plugin is used to capture information about
Instructlab installations.
InstructLab is an open source project for enhancing
large language models (LLMs) used in generative
artificial intelligence (gen AI) applications.
Instructlab can run either as a container, or directly
outside a container.
�instructlab)�ai)r �ilab)r
� ilab-userz
cloud-userzuser that runs instructlab)�default�val_type�desc�
ilab-conf-dir� zinstructlab data directory� get-cacheFz#Capture models and osci cached data)r r c �� � d}d}d}d}d}| j ||� }| j ||� }| j ||� }| j | j |d� | j |d� | j |d� | j |d � g� g d
�} g d�}
| j d� d
d }| j |� d�|� d�g|�� | j |
D �cg c] }| j ||� �� c}|�� | j | D �
cg c] }
d|
� ��� c}
|�� | j
|d|�� | j d� r| j |� |�� | j t | j � � | j d� } t j |� }|r�|j }| j d� r!| j || j d� � }| j ||� }| j | j ||� � | j |
D �cg c] }| j ||� �� c}� | j
| j ||� d�� | j d� r"| j | j ||� � y y y # t $ r d }Y ���w xY wc c}w c c}
w # t $ r | j d|� d�� Y y w xY wc c}w )Nz/usr/share/instructlab/configz/opt/app-root/srcz.cache/instructlabz.config/instructlabz.local/share/instructlabz
taxonomy/.gitztaxonomy/.githubz*src/.local/share/instructlab/taxonomy/.gitz-src/.local/share/instructlab/taxonomy/.github)z
taxonomy diffz#taxonomy diff --taxonomy-base=emptyzsystem infoz
model listzconfig show) �data� generated�taxonomy�
taxonomy_data�chatlogs�checkpoints�datasets�internal�phasedzinstructlab*r � z/rhel_ai_config.yamlz/config.yaml)� containerzilab T)� recursiver r r zUser "z�" does not exist, will not collect Instructlab information. Use `-k instructlab.ilab-user` option to define the user to use to collect data for Instructlabr )r )� path_join�add_forbidden_path�get_all_containers_by_regex� Exception�
add_copy_spec�add_cmd_output�add_dir_listing�
get_option�add_container_logs�list�
containers�pwd�getpwnam�KeyError� _log_warn�pw_dir)�self�cont_share_conf_path�
cont_opt_path� cache_dir�
config_dir�local_share_dir�cont_cache_path�cont_config_path�cont_local_path�subcmds� data_dirs�ilab_con�data_dir�sub� ilab_user�user_pwd�ilab_dir�data_dirs_bases �@/usr/lib/python3/dist-packages/sos/report/plugins/instructlab.py�setupzInstructlab.setup) s8 � �>��+�
� )� � +�
� 5�� �.�.�� �B���>�>�-��D���.�.���H������N�N�?�*�
,��N�N�?�,>�?��N�N�=�G�
I��N�N�=�J�
L�
!
� �
��
� � ��7�7��G��J�1�M�H�
���$�%�%9�
:� �!��
.�
0�� �
�
���&�
(�� �^�^�O�X�
6�
(�� �
�
���&-�.�s�u�S�E�]�.�� �
�
������ �
�
�?�?�;�'����"�#�"�
�
�
����T�_�_� 5�6��O�O�K�0� � ��|�|�I�.�H� ����H�����/��>�>��d�o�o�o�>��� "�^�^�H�o�F�N����t�~�~�h�
�C�D���� )� �� ���~�x�8� �
�
� � ����x��3��
!�
�
���{�+��"�"��N�N�8�Y�7�� ,�% ��S � ��H� ��
(��
/��$ � ��N�N���� $B� B�
C�
� ��$ s6 �J$ � J6�J;�K �,K$�$J3�2J3� K!� K!N)
�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profilesr) �commandsr �str�option_listrB � � rA r r sb � �� �J��K��H�)�J��H� �+�|�c�3� 5��/�2��3� 5��+�u�<� >��K�srN r )r* �sos.report.pluginsr r r r rM rN rA �<module>rP s! �� � C� C�M�&�+� MrN