Skip to content

Commit b64352e

Browse files
authored
Merge pull request #282 from CESNET/llm_hub
QA1: support running llm_hub tool
2 parents 8b56e70 + 8d38873 commit b64352e

File tree

15 files changed

+328
-185
lines changed

15 files changed

+328
-185
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
.vault-password.*
1111

1212
# installed roles
13-
roles
13+
roles/*
14+
15+
# this is ours
16+
!roles/usegalaxy_cz.llm_hub
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- Paths are relative to the value of `tool_data_path` in galaxy.ini -->
2+
<tables>
3+
<table name="llm_models" comment_char="#" allow_duplicate_entries="False">
4+
<columns>value, name, domain, provider, free_tag</columns>
5+
<file path="llm_models.loc" />
6+
</table>
7+
</tables>

galaxy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
- galaxyproject.tusd
208208
- usegalaxy_eu.apptainer
209209
- galaxyproject.galaxy
210+
- usegalaxy_cz.llm_hub
210211
- usegalaxy_eu.tpv_auto_lint
211212
- geerlingguy.redis
212213
- role: usegalaxy_eu.flower

group_vars/galaxyservers.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ enable_flower: false
4444
enable_tiaas: true
4545
shed_tools_shadowing: false
4646

47+
# LLM Hub placeholders; provide real values in secrets.yml
48+
llm_hub:
49+
token: TOKEN
50+
endpoint: SOMEWHERE
51+
52+
4753
# Galaxy
4854
galaxy_manage_systemd: no
4955
galaxy_create_user: true # False by default, as e.g. you might have a 'galaxy' user provided by LDAP or AD.
@@ -184,6 +190,7 @@ galaxy_config:
184190
tool_data_table_config_path:
185191
- /cvmfs/data.galaxyproject.org/byhand/location/tool_data_table_conf.xml
186192
- /cvmfs/data.galaxyproject.org/managed/location/tool_data_table_conf.xml
193+
- "{{ galaxy_config_dir }}/llm_hub_data_table_conf.xml"
187194
# Tool Dependencies
188195
dependency_resolvers: {}
189196
container_resolvers:
@@ -261,6 +268,8 @@ galaxy_config_files_public:
261268
dest: "{{ galaxy_server_dir }}/static/eu_msmt_eosc.svg"
262269
- src: files/galaxy/static/e-infra_logo.svg
263270
dest: "{{ galaxy_server_dir }}/static/e-infra_logo.svg"
271+
- src: files/galaxy/config/llm_hub_data_table_conf.xml
272+
dest: "{{ galaxy_config_dir }}/llm_hub_data_table_conf.xml"
264273

265274
galaxy_config_templates:
266275
- src: templates/galaxy/config/reports.yml.j2
@@ -279,6 +288,8 @@ galaxy_config_templates:
279288
dest: "{{ galaxy_config_dir }}/file_source_templates.yml"
280289
- src: "{{ lookup('first_found', ['templates/'+inventory_hostname+'/config/auth_conf.xml.j2', 'templates/galaxy/config/auth_conf.xml.j2']) }}"
281290
dest: "{{ galaxy_config.galaxy.auth_config_file }}"
291+
- src: templates/galaxy/config/llm_hub_config.yaml
292+
dest: "{{ galaxy_config_dir }}/llm_hub_config.yaml"
282293

283294
galaxy_local_tools:
284295
- testing.xml

host_vars/galaxy-qa1.galaxy.cloud.e-infra.cz/secret.yml

Lines changed: 189 additions & 184 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Role Name
2+
=========
3+
4+
Configure support for LLM Hub tool
5+
6+
Requirements
7+
------------
8+
9+
Role Variables
10+
--------------
11+
12+
Dependencies
13+
------------
14+
15+
Example Playbook
16+
----------------
17+
18+
19+
License
20+
-------
21+
22+
MIT
23+
24+
Author Information
25+
------------------
26+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#SPDX-License-Identifier: MIT-0
2+
---
3+
# defaults file for usegalaxy_cz.llm_hub
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#SPDX-License-Identifier: MIT-0
2+
---
3+
# handlers file for usegalaxy_cz.llm_hub
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#SPDX-License-Identifier: MIT-0
2+
galaxy_info:
3+
author: Ales Krenek
4+
description: configure support for llm hub tool
5+
company: CESNET
6+
7+
# If the issue tracker for your role is not on github, uncomment the
8+
# next line and provide a value
9+
# issue_tracker_url: http://example.com/issue/tracker
10+
11+
# Choose a valid license ID from https://spdx.org - some suggested licenses:
12+
# - BSD-3-Clause (default)
13+
# - MIT
14+
# - GPL-2.0-or-later
15+
# - GPL-3.0-only
16+
# - Apache-2.0
17+
# - CC-BY-4.0
18+
license: MIT
19+
min_ansible_version: 2.1
20+
21+
# If this a Container Enabled role, provide the minimum Ansible Container version.
22+
# min_ansible_container_version:
23+
24+
galaxy_tags: []
25+
# List tags for your role here, one per line. A tag is a keyword that describes
26+
# and categorizes the role. Users find roles by searching for tags. Be sure to
27+
# remove the '[]' above, if you add tags to this list.
28+
#
29+
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
30+
# Maximum 20 tags per role.
31+
32+
dependencies: []
33+
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
34+
# if you add dependencies to this list.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
3+
- name: Retrieve current list of LLMs
4+
delegate_to: localhost
5+
shell: |
6+
echo '#<model_id> <display_name> <domain> <provider> <free_tag>' > "files/{{ inventory_hostname }}/llm_models.loc" && \
7+
curl -H "Authorization: Bearer {{ llm_hub.token }}" "{{ llm_hub.endpoint }}/models" | \
8+
jq -r --arg re "^({{ multimodals | join('|') }})" \
9+
'.data[].id | if test($re) then [.,.,"multimodal","CERIT-SC","tag"] else [.,.,"text","CERIT-SC","tag"] end | @tsv' \
10+
>> files/{{ inventory_hostname }}/llm_models.loc
11+
become: false
12+
13+
- name: Install the list of LLMs
14+
copy:
15+
src: "files/{{ inventory_hostname }}/llm_models.loc"
16+
dest: "{{ galaxy_tool_data_path }}/llm_models.loc"
17+
18+
- name: Install specific local dependencies
19+
pip:
20+
name: openai
21+
virtualenv: "{{ galaxy_venv_dir }}"
22+

0 commit comments

Comments
 (0)