Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource params #81

Draft
wants to merge 6 commits into
base: anvil
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions galaxykubeman/templates/config-job-resource-params-conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-galaxy-resource-params-conf
labels:
app.kubernetes.io/name: {{ include "galaxykubeman.name" . }}
helm.sh/chart: {{ include "galaxykubeman.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
job_resource_params_conf.xml: |
<parameters>
<param label="Processors" name="processors" type="integer" min="1" max="{{ .Values.limits.cores }}" value="" help="Number of processing cores, 'ppn' value (1-{{ .Values.limits.cores }}). Leave blank to use default value." />
<param label="Memory" name="mem" type="integer" min="1" max="{{ .Values.limits.mem }}" value="" help="Memory size in gigabytes, 'pmem' value (1-{{ .Values.limits.mem }}). Leave blank to use default value." />
<param label="Wall Time" name="time" type="integer" min="1" max="{{ .Values.limits.walltime }}" value="" help="Maximum job time in hours, 'walltime' value (1-{{ .Values.limits.walltime }}). Leave blank to use default value." />
</parameters>
54 changes: 47 additions & 7 deletions galaxykubeman/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ configs: {}
secrets: {}
# db-password: changeme

# The following values are used to configure the resources that can be allocated
# to tools. These values should be passed in by Leo.
# https://github.com/DataBiosphere/leonardo/blob/60fb6ba708a40200b3d33ea9cec7e75e1e81f328/http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/util/BuildHelmChartValues.scala#L97
limits:
cores: 28
mem: 100
walltime: 744

restore:
persistence:
nfs:
Expand Down Expand Up @@ -72,6 +80,19 @@ galaxy:
chart:
repository: https://raw.githubusercontent.com/cloudve/helm-charts/anvil/
jobs:
rules:
tpv_rules_local.yml:
tools:
default:
rules:
- id: resource_params_defined
if: |
param_dict = job.get_param_values(app)
param_dict.get('__job_resource', {}).get('__job_resource__select') == 'yes'
cores: int(job.get_param_values(app)['__job_resource']['processors'])
mem: int(job.get_param_values(app)['__job_resource']['mem'])
params:
walltime: "{int(job.get_param_values(app)['__job_resource']['time'])}"
priorityClass:
existingClass: "{{ .Release.Namespace }}-priority-class"
maxRequests:
Expand Down Expand Up @@ -275,14 +296,25 @@ galaxy:
logo_src: /static/images/galaxy_project_logo_white_square.png
# The custom brand image source
logo_src_secondary: /static/images/anvilwhite.png
# Enable resource parameter configuration
job_resource_params_file: "/galaxy/server/config/job_resource_params_conf.xml"
job_conf.yml:
execution:
environments:
tpv_dispatcher:
tpv_config_files:
- https://raw.githubusercontent.com/galaxyproject/tpv-shared-database/main/tools.yml
- lib/galaxy/jobs/rules/tpv_rules_local.yml
- https://raw.githubusercontent.com/galaxyproject/galaxykubeman-helm/anvil/tool-configs.yaml
resources:
default: default
groups:
default: [ processors, mem, time ]
tools:
- class: local
resources: default
- class: requires_galaxy
resources: default
execution:
environments:
tpv_dispatcher:
tpv_config_files:
- https://gxy.io/tpv/db.yml
- lib/galaxy/jobs/rules/tpv_rules_local.yml
- https://raw.githubusercontent.com/galaxyproject/galaxykubeman-helm/anvil/tool-configs.yaml
file_sources_conf.yml:
- doc: "{{ .Values.terra.launch.workspace }}"
id: "{{ .Values.terra.launch.workspace }}"
Expand Down Expand Up @@ -398,6 +430,14 @@ galaxy:
cpu: 2
memory: 8G
ephemeral-storage: 20Gi
extraVolumes:
- name: job-resource-params-conf
configMap:
name: "{{ .Release.Name }}-resource-params-conf"
extraVolumeMounts:
- name: job-resource-params-conf
mountPath: /galaxy/server/config/job_resource_params_conf.xml
subPath: job_resource_params_conf.xml
extraFileMappings:
/galaxy/server/static/welcome.html:
applyToWeb: true
Expand Down
Loading