Skip to content

Commit

Permalink
Set max resources in jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Mar 6, 2024
1 parent 355f5d9 commit 7d6d321
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions artifacts/k8s_galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
NAMESPACE: galaxy
admin_users: "{{ galaxy_admin_users | default('[email protected]') }}"
brand: "{{ galaxy_brand | default('IM Deployed Galaxy K8s Cluster') }}"
max_mem: "{{ galaxy_max_mem | default(0) }}"
max_cores: "{{ galaxy_max_cores | default(0) }}"
tasks:
- name: Install Git
package: name=git
Expand Down Expand Up @@ -69,6 +71,11 @@
environment:
KUBECONFIG: /etc/kubernetes/admin.conf

- name: Remove GB from max_mem
set_fact:
max_mem: "{{ max_mem[:-2] | float - 0.5 }}"
when: max_mem and "GB" in max_mem

- name: Create galaxy helm chart values file
copy:
dest: /opt/galaxy_values.yaml
Expand All @@ -84,6 +91,14 @@
galaxy:
admin_users: {{ admin_users }}
brand: {{ brand }}
jobs:
rules:
tpv_rules_local.yml:
destinations:
k8s:
runner: k8s
{{ 'max_cores: ' ~ max_cores if max_cores else '' }}
{{ 'max_mem: ' ~ max_mem if max_mem else '' }}
- name: Deploy Galaxy
command: helm install --create-namespace -n {{ NAMESPACE }} galaxy . --timeout 15m -f /opt/galaxy_values.yaml
Expand Down
2 changes: 2 additions & 0 deletions templates/k8s_galaxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ topology_template:
inputs:
galaxy_admin_users: { get_input: galaxy_admin_users }
galaxy_brand: { get_input: galaxy_brand }
galaxy_max_memory: { get_input: wn_mem }
galaxy_max_cores: { get_input: wn_cpus }

outputs:
galaxy_endpoint:
Expand Down

0 comments on commit 7d6d321

Please sign in to comment.