File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/instructlab.cpython-36.opt-1.pyc
3
-�_g� � @ s2 d dl Z d dlmZmZmZ G dd� dee�ZdS )� N)�Plugin�IndependentPlugin� PluginOptc @ sX e Zd ZdZd ZdZdZdZdZe dde
dd�e d d
e
dd�e dd
dd�gZdd� ZdS )�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�ilabz ilab-userz
cloud-userzuser that runs instructlab)�defaultZval_type�descz
ilab-conf-dir� zinstructlab data directoryz get-cacheFz#Capture models and osci cached data)r r
c s* d}d}d}d}d}�j ||�}�j ||�}�j ||�� �j�j � d��j � d��j |d��j |d �g� d
ddd
dg}dddddddddg } y�jd�d d }
W n tk
r� d }
Y nX �j|� d�|� d�g|
d� �j� �fdd�| D �|
d� �jd d� |D �|
d� �j|d!|
d"� �jd#��r>�j|� |
d� �jt �j
�� �jd$�}ytj|�}W n( t
k
�r� �jd%|� d&�� d S X |�r&|j}
�jd'��r��j |
�jd'��}
�j |
|���j�j |
|�� �j��fd(d�| D �� �j�j |
|�d!d)� �jd#��r&�j�j |
|�� d S )*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/.githubz
taxonomy diffz#taxonomy diff --taxonomy-base=emptyzsystem infoz
model listzconfig show�dataZ generatedZtaxonomyZ
taxonomy_dataZchatlogsZcheckpointsZdatasetsZinternalZphasedzinstructlab*r � z/rhel_ai_config.yamlz/config.yaml)� containerc s g | ]}�j � |��qS � )� path_join)�.0�data_dir)�cont_local_path�selfr �!/usr/lib/python3.6/instructlab.py�
<listcomp>g s z%Instructlab.setup.<locals>.<listcomp>c S s g | ]}d |� ��qS )zilab r )r �subr r r r l s T)� recursiver z get-cachez ilab-userzUser "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 Instructlabz
ilab-conf-dirc s g | ]}�j � |��qS r )r )r r )�data_dirs_baser r r r � s )r )r Zadd_forbidden_pathZget_all_containers_by_regex� ExceptionZ
add_copy_specZadd_cmd_outputZadd_dir_listingZ
get_optionZadd_container_logs�list�
containers�pwd�getpwnam�KeyErrorZ _log_warn�pw_dir)r Zcont_share_conf_pathZ
cont_opt_path� cache_dirZ
config_dirZlocal_share_dirZcont_cache_pathZcont_config_pathZsubcmdsZ data_dirsZilab_conZ ilab_userZuser_pwdZilab_dirr )r r r r �setup) s�
zInstructlab.setupN)r )r r )r )
�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesr Zcommandsr �strZoption_listr"